From ef91ae5b31b5f4598ab178da027dac3d595de3cb Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 17 Dec 2020 05:50:15 +0000 Subject: [PATCH] CodeGen from PR 11847 in Azure/azure-rest-api-specs add kusto track2 config (#11847) --- eng/versioning/external_dependencies.txt | 3 +- eng/versioning/version_client.txt | 46 +- eng/versioning/version_data.txt | 2 +- pom.xml | 14 +- .../azure-resourcemanager-kusto/CHANGELOG.md | 5 + .../azure-resourcemanager-kusto/README.md | 84 + sdk/kusto/azure-resourcemanager-kusto/pom.xml | 62 + .../resourcemanager/kusto/KustoManager.java | 279 ++ .../AttachedDatabaseConfigurationsClient.java | 215 + .../ClusterPrincipalAssignmentsClient.java | 250 ++ .../kusto/fluent/ClustersClient.java | 760 ++++ .../kusto/fluent/DataConnectionsClient.java | 443 ++ .../DatabasePrincipalAssignmentsClient.java | 286 ++ .../kusto/fluent/DatabasesClient.java | 409 ++ .../kusto/fluent/KustoManagementClient.java | 96 + .../kusto/fluent/OperationsClient.java | 36 + .../AttachedDatabaseConfigurationInner.java | 173 + .../fluent/models/AzureResourceSkuInner.java | 110 + .../fluent/models/CheckNameResultInner.java | 132 + .../kusto/fluent/models/ClusterInner.java | 480 +++ .../ClusterPrincipalAssignmentInner.java | 182 + .../fluent/models/DataConnectionInner.java | 68 + .../models/DataConnectionValidationInner.java | 79 + ...taConnectionValidationListResultInner.java | 55 + .../kusto/fluent/models/DatabaseInner.java | 66 + .../DatabasePrincipalAssignmentInner.java | 182 + .../fluent/models/DatabasePrincipalInner.java | 212 + .../DatabasePrincipalListResultInner.java | 54 + .../DiagnoseVirtualNetworkResultInner.java | 51 + .../FollowerDatabaseDefinitionInner.java | 111 + .../fluent/models/LanguageExtensionInner.java | 51 + .../kusto/fluent/models/OperationInner.java | 132 + .../fluent/models/SkuDescriptionInner.java | 119 + .../kusto/fluent/models/package-info.java | 10 + .../kusto/fluent/package-info.java | 10 + .../AttachedDatabaseConfigurationImpl.java | 198 + ...achedDatabaseConfigurationsClientImpl.java | 1080 +++++ .../AttachedDatabaseConfigurationsImpl.java | 215 + .../implementation/AzureResourceSkuImpl.java | 42 + .../implementation/CheckNameResultImpl.java | 45 + .../kusto/implementation/ClusterImpl.java | 378 ++ .../ClusterPrincipalAssignmentImpl.java | 176 + ...ClusterPrincipalAssignmentsClientImpl.java | 1264 ++++++ .../ClusterPrincipalAssignmentsImpl.java | 241 ++ .../implementation/ClustersClientImpl.java | 3812 +++++++++++++++++ .../kusto/implementation/ClustersImpl.java | 333 ++ .../implementation/DataConnectionImpl.java | 44 + .../DataConnectionValidationImpl.java | 43 + ...ataConnectionValidationListResultImpl.java | 41 + .../DataConnectionsClientImpl.java | 2070 +++++++++ .../implementation/DataConnectionsImpl.java | 229 + .../kusto/implementation/DatabaseImpl.java | 44 + .../DatabasePrincipalAssignmentImpl.java | 193 + ...atabasePrincipalAssignmentsClientImpl.java | 1407 ++++++ .../DatabasePrincipalAssignmentsImpl.java | 290 ++ .../implementation/DatabasePrincipalImpl.java | 58 + .../DatabasePrincipalListResultImpl.java | 47 + .../implementation/DatabasesClientImpl.java | 2125 +++++++++ .../kusto/implementation/DatabasesImpl.java | 248 ++ .../DiagnoseVirtualNetworkResultImpl.java | 39 + .../FollowerDatabaseDefinitionImpl.java | 40 + .../KustoManagementClientBuilder.java | 149 + .../KustoManagementClientImpl.java | 382 ++ .../implementation/LanguageExtensionImpl.java | 33 + .../kusto/implementation/OperationImpl.java | 45 + .../implementation/OperationsClientImpl.java | 269 ++ .../kusto/implementation/OperationsImpl.java | 46 + .../implementation/SkuDescriptionImpl.java | 70 + .../kusto/implementation/Utils.java | 67 + .../kusto/implementation/package-info.java | 10 + .../models/AttachedDatabaseConfiguration.java | 283 ++ ...tachedDatabaseConfigurationListResult.java | 55 + .../AttachedDatabaseConfigurations.java | 145 + .../kusto/models/AzureCapacity.java | 133 + .../kusto/models/AzureResourceSku.java | 38 + .../kusto/models/AzureScaleType.java | 37 + .../kusto/models/AzureSku.java | 110 + .../kusto/models/AzureSkuName.java | 94 + .../kusto/models/AzureSkuTier.java | 34 + .../kusto/models/BlobStorageEventType.java | 36 + .../kusto/models/CheckNameRequest.java | 86 + .../kusto/models/CheckNameResult.java | 46 + .../resourcemanager/kusto/models/Cluster.java | 580 +++ .../kusto/models/ClusterCheckNameRequest.java | 86 + .../kusto/models/ClusterListResult.java | 55 + .../models/ClusterPrincipalAssignment.java | 264 ++ ...erPrincipalAssignmentCheckNameRequest.java | 87 + .../ClusterPrincipalAssignmentListResult.java | 55 + .../models/ClusterPrincipalAssignments.java | 176 + .../kusto/models/ClusterPrincipalRole.java | 34 + .../kusto/models/ClusterUpdate.java | 478 +++ .../kusto/models/Clusters.java | 437 ++ .../kusto/models/Compression.java | 34 + .../kusto/models/DataConnection.java | 45 + .../DataConnectionCheckNameRequest.java | 88 + .../kusto/models/DataConnectionKind.java | 37 + .../models/DataConnectionListResult.java | 55 + .../models/DataConnectionValidation.java | 31 + .../DataConnectionValidationListResult.java | 25 + .../DataConnectionValidationResult.java | 50 + .../kusto/models/DataConnections.java | 257 ++ .../kusto/models/Database.java | 45 + .../kusto/models/DatabaseListResult.java | 55 + .../kusto/models/DatabasePrincipal.java | 66 + .../models/DatabasePrincipalAssignment.java | 265 ++ ...sePrincipalAssignmentCheckNameRequest.java | 88 + ...DatabasePrincipalAssignmentListResult.java | 55 + .../models/DatabasePrincipalAssignments.java | 197 + .../models/DatabasePrincipalListRequest.java | 55 + .../models/DatabasePrincipalListResult.java | 25 + .../kusto/models/DatabasePrincipalRole.java | 46 + .../kusto/models/DatabasePrincipalType.java | 37 + .../kusto/models/DatabaseStatistics.java | 51 + .../kusto/models/Databases.java | 284 ++ .../DefaultPrincipalsModificationKind.java | 37 + .../models/DiagnoseVirtualNetworkResult.java | 25 + .../kusto/models/EngineType.java | 34 + .../kusto/models/EventGridDataConnection.java | 275 ++ .../kusto/models/EventGridDataFormat.java | 76 + .../kusto/models/EventHubDataConnection.java | 247 ++ .../kusto/models/EventHubDataFormat.java | 76 + .../models/FollowerDatabaseDefinition.java | 40 + .../models/FollowerDatabaseListResult.java | 55 + .../kusto/models/Identity.java | 131 + .../kusto/models/IdentityType.java | 40 + .../IdentityUserAssignedIdentities.java | 54 + .../kusto/models/IotHubDataConnection.java | 247 ++ .../kusto/models/IotHubDataFormat.java | 76 + .../kusto/models/KeyVaultProperties.java | 138 + .../resourcemanager/kusto/models/Kind.java | 34 + .../kusto/models/LanguageExtension.java | 24 + .../kusto/models/LanguageExtensionName.java | 34 + .../kusto/models/LanguageExtensionsList.java | 55 + .../kusto/models/ListResourceSkusResult.java | 55 + .../kusto/models/Operation.java | 45 + .../kusto/models/OperationDisplay.java | 128 + .../kusto/models/OperationListResult.java | 84 + .../kusto/models/Operations.java | 31 + .../kusto/models/OptimizedAutoscale.java | 129 + .../kusto/models/PrincipalType.java | 37 + .../models/PrincipalsModificationKind.java | 37 + .../kusto/models/ProvisioningState.java | 46 + .../models/ReadOnlyFollowingDatabase.java | 162 + .../kusto/models/ReadWriteDatabase.java | 144 + .../resourcemanager/kusto/models/Reason.java | 34 + .../kusto/models/SkuDescription.java | 60 + .../kusto/models/SkuDescriptionList.java | 44 + .../kusto/models/SkuLocationInfoItem.java | 82 + .../resourcemanager/kusto/models/State.java | 55 + .../kusto/models/TrustedExternalTenant.java | 50 + .../resourcemanager/kusto/models/Type.java | 48 + .../models/VirtualNetworkConfiguration.java | 120 + .../kusto/models/package-info.java | 10 + .../resourcemanager/kusto/package-info.java | 10 + .../src/main/java/module-info.java | 19 + sdk/kusto/ci.yml | 31 + sdk/kusto/pom.xml | 14 + 157 files changed, 29426 insertions(+), 27 deletions(-) create mode 100644 sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md create mode 100644 sdk/kusto/azure-resourcemanager-kusto/README.md create mode 100644 sdk/kusto/azure-resourcemanager-kusto/pom.xml create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClusterPrincipalAssignmentsClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DataConnectionsClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasePrincipalAssignmentsClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/OperationsClient.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AttachedDatabaseConfigurationInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AzureResourceSkuInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/CheckNameResultInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterPrincipalAssignmentInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationListResultInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabaseInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalAssignmentInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalListResultInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DiagnoseVirtualNetworkResultInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/FollowerDatabaseDefinitionInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/LanguageExtensionInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/SkuDescriptionInner.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/package-info.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/package-info.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AzureResourceSkuImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/CheckNameResultImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationListResultImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabaseImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalListResultImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DiagnoseVirtualNetworkResultImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/FollowerDatabaseDefinitionImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientBuilder.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/LanguageExtensionImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsClientImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/SkuDescriptionImpl.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/Utils.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/package-info.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfiguration.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurationListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureCapacity.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureResourceSku.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureScaleType.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSku.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuName.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuTier.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/BlobStorageEventType.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameRequest.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterCheckNameRequest.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignment.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentCheckNameRequest.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignments.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalRole.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Compression.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnection.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionCheckNameRequest.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionKind.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidation.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnections.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Database.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipal.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignment.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentCheckNameRequest.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignments.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListRequest.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalRole.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalType.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseStatistics.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DefaultPrincipalsModificationKind.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DiagnoseVirtualNetworkResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EngineType.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataConnection.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataFormat.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataConnection.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataFormat.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseDefinition.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityType.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityUserAssignedIdentities.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataConnection.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataFormat.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Kind.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtension.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionName.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionsList.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ListResourceSkusResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationListResult.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operations.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OptimizedAutoscale.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalType.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalsModificationKind.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ProvisioningState.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadOnlyFollowingDatabase.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadWriteDatabase.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Reason.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescription.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescriptionList.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuLocationInfoItem.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/State.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/TrustedExternalTenant.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Type.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/VirtualNetworkConfiguration.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/package-info.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/package-info.java create mode 100644 sdk/kusto/azure-resourcemanager-kusto/src/main/java/module-info.java create mode 100644 sdk/kusto/ci.yml create mode 100644 sdk/kusto/pom.xml diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 62906a566fee..9d4a741ab466 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -110,6 +110,7 @@ org.springframework.kafka:spring-kafka;2.5.7.RELEASE org.springframework.security:spring-security-config;5.3.5.RELEASE org.springframework.security:spring-security-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-client;5.3.5.RELEASE +org.springframework.security:spring-security-oauth2-resource-server;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-jose;5.3.5.RELEASE org.springframework.security:spring-security-web;5.3.5.RELEASE @@ -126,7 +127,7 @@ org.springframework:spring-web;5.2.10.RELEASE org.springframework:spring-webmvc;5.2.10.RELEASE # spring-boot-starter-parent is not managed by spring-boot-dependencies or spring-cloud-dependencies. -org.springframework.boot:spring-boot-starter-parent;2.3.3.RELEASE +org.springframework.boot:spring-boot-starter-parent;2.3.5.RELEASE ## Spring cloud dependency versions # After you update spring-cloud-dependencies' version, please run this script: /sdk/spring/scripts/sync_version_from_spring-boot-dependencies.py diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fa2e6238ee36..ff3e5e539778 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -40,17 +40,22 @@ com.azure:azure-ai-anomalydetector;3.0.0-beta.1;3.0.0-beta.2 com.azure:azure-ai-formrecognizer;3.0.3;3.1.0-beta.2 com.azure:azure-ai-metricsadvisor;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-ai-textanalytics;5.0.1;5.1.0-beta.4 +com.azure:azure-analytics-synapse-accesscontrol;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-synapse-spark;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-communication-chat;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-common;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-administration;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-sms;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-core;1.10.0;1.11.0 -com.azure:azure-core-amqp;1.6.0;1.7.0-beta.3 +com.azure:azure-core;1.11.0;1.12.0-beta.1 +com.azure:azure-core-amqp;2.0.0;2.1.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.8;1.0.0-beta.9 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.6.3;1.7.0 -com.azure:azure-core-http-okhttp;1.3.3;1.4.0 +com.azure:azure-core-http-netty;1.7.0;1.8.0-beta.1 +com.azure:azure-core-http-okhttp;1.4.0;1.5.0-beta.1 com.azure:azure-core-management;1.0.0;1.1.0-beta.1 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 @@ -58,7 +63,7 @@ com.azure:azure-core-serializer-json-gson;1.0.3;1.1.0-beta.1 com.azure:azure-core-serializer-json-jackson;1.1.0;1.2.0-beta.1 com.azure:azure-core-test;1.5.1;1.6.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.6;1.0.0-beta.7 -com.azure:azure-cosmos;4.8.0;4.9.0-beta.1 +com.azure:azure-cosmos;4.10.0;4.11.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-cosmos-dotnet-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-cosmos-encryption;1.0.0-beta.1;1.0.0-beta.1 @@ -68,12 +73,12 @@ com.azure:azure-data-schemaregistry-avro;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-data-tables;12.0.0-beta.3;12.0.0-beta.4 com.azure:azure-digitaltwins-core;1.0.1;1.1.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.2.0;1.3.0-beta.1 +com.azure:azure-identity;1.2.0;1.2.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventgrid;2.0.0-beta.3;2.0.0-beta.4 com.azure:azure-messaging-eventhubs;5.3.1;5.4.0-beta.2 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.3.1;1.4.0-beta.2 -com.azure:azure-messaging-servicebus;7.0.0-beta.7;7.0.0-beta.8 +com.azure:azure-messaging-servicebus;7.0.0;7.1.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-search-documents;11.1.2;11.2.0-beta.4 @@ -84,19 +89,19 @@ com.azure:azure-security-keyvault-jca;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-security-keyvault-keys;4.2.3;4.3.0-beta.4 com.azure:azure-security-keyvault-secrets;4.2.3;4.3.0-beta.3 com.azure:azure-sdk-template;1.2.1-beta.2;1.2.1-beta.16 -com.azure:azure-spring-data-cosmos;3.1.0;3.2.0-beta.1 +com.azure:azure-spring-data-cosmos;3.2.0;3.3.0-beta.1 com.azure:azure-spring-data-cosmos-test;3.0.0-beta.1;3.0.0-beta.1 -com.azure:azure-storage-blob;12.9.0;12.10.0-beta.1 -com.azure:azure-storage-blob-batch;12.7.0;12.8.0-beta.1 +com.azure:azure-storage-blob;12.9.0;12.10.0-beta.2 +com.azure:azure-storage-blob-batch;12.7.0;12.8.0-beta.2 com.azure:azure-storage-blob-changefeed;12.0.0-beta.4;12.0.0-beta.5 -com.azure:azure-storage-blob-cryptography;12.9.0;12.10.0-beta.1 +com.azure:azure-storage-blob-cryptography;12.9.0;12.10.0-beta.2 com.azure:azure-storage-blob-nio;12.0.0-beta.2;12.0.0-beta.3 -com.azure:azure-storage-common;12.9.0;12.10.0-beta.1 -com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.1 -com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.1 -com.azure:azure-storage-internal-avro;12.0.1;12.1.0-beta.1 +com.azure:azure-storage-common;12.9.0;12.10.0-beta.2 +com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.2 +com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.2 +com.azure:azure-storage-internal-avro;12.0.1;12.0.2-beta.2 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-storage-queue;12.7.0;12.8.0-beta.1 +com.azure:azure-storage-queue;12.7.0;12.8.0-beta.2 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure.spring:azure-spring-boot-starter-active-directory-b2c;3.0.0-beta.1;3.0.0-beta.2 com.azure.spring:azure-spring-boot-starter-active-directory;3.0.0-beta.1;3.0.0-beta.2 @@ -168,6 +173,10 @@ com.azure.resourcemanager:azure-resourcemanager-sql;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storage;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.1;2.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-mediaservices;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-mysql;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-postgresql;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-kusto;1.0.0-beta.1;1.0.0-beta.1 com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-beta.2 @@ -176,9 +185,7 @@ com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-b # Format; # unreleased_:;dependency-version # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. -unreleased_com.azure:azure-core;1.11.0 -unreleased_com.azure:azure-core-amqp;1.7.0-beta.3 -unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 +unreleased_com.azure:azure-messaging-servicebus;7.0.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid @@ -188,4 +195,3 @@ unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 # beta_:;dependency-version # note: Released beta versions will not be manipulated with the automatic PR creation code. beta_com.azure:azure-security-keyvault-keys;4.3.0-beta.1 -beta_com.azure:azure-core-amqp;1.7.0-beta.2 diff --git a/eng/versioning/version_data.txt b/eng/versioning/version_data.txt index 61c6a98825df..da53965c2792 100644 --- a/eng/versioning/version_data.txt +++ b/eng/versioning/version_data.txt @@ -34,7 +34,7 @@ com.microsoft.azure:azure-keyvault-cryptography;1.2.4;1.3.0-beta.1 com.microsoft.azure:azure-keyvault-extensions;1.2.4;1.3.0-beta.1 com.microsoft.azure:azure-keyvault-test;1.2.3;1.2.4 com.microsoft.azure:azure-keyvault-webkey;1.2.4;1.3.0-beta.1 -com.microsoft.azure:azure-servicebus;3.5.0;3.5.1 +com.microsoft.azure:azure-servicebus;3.5.1;3.6.0-beta.1 com.microsoft.azure:azure-storage-blob;11.0.2;11.0.2 com.microsoft.azure.msi_auth_token_provider:azure-authentication-msi-token-provider;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure:azure-eventgrid;1.4.0-beta.1;1.4.0-beta.1 diff --git a/pom.xml b/pom.xml index d97614e5dba3..40e28757f0b9 100644 --- a/pom.xml +++ b/pom.xml @@ -9,35 +9,39 @@ 1.0.0 common/perf-test-core - eng/jacoco-test-coverage eng/code-quality-reports + eng/jacoco-test-coverage sdk/anomalydetector sdk/appconfiguration sdk/authorization sdk/batch sdk/boms - sdk/core - sdk/cosmos sdk/cognitiveservices sdk/communication + sdk/core + sdk/cosmos sdk/digitaltwins sdk/eventgrid sdk/eventhubs sdk/formrecognizer sdk/identity sdk/keyvault + sdk/kusto sdk/loganalytics sdk/mediaservices - sdk/monitor sdk/metricsadvisor + sdk/monitor + sdk/mysql + sdk/postgresql sdk/resourcemanager sdk/schemaregistry sdk/search sdk/servicebus + sdk/spring sdk/storage + sdk/synapse sdk/tables sdk/template sdk/textanalytics - sdk/spring diff --git a/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md b/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md new file mode 100644 index 000000000000..03b75f419c56 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2020-12-17) + +- Azure Resource Manager Kusto client library for Java. This package contains Microsoft Azure SDK for Kusto Management SDK. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2020-09-18. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/kusto/azure-resourcemanager-kusto/README.md b/sdk/kusto/azure-resourcemanager-kusto/README.md new file mode 100644 index 000000000000..d15301a51ef0 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/README.md @@ -0,0 +1,84 @@ +# Azure Resource Manager Kusto client library for Java + +Azure Resource Manager Kusto client library for Java. + +This package contains Microsoft Azure SDK for Kusto Management SDK. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2020-09-18. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## 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-kusto;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-kusto + 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(); +KustoManager manager = KustoManager + .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 + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft +Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +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 + + +[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/kusto/azure-resourcemanager-kusto/pom.xml b/sdk/kusto/azure-resourcemanager-kusto/pom.xml new file mode 100644 index 000000000000..86f362d3b8b0 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-kusto + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Kusto Management + This package contains Microsoft Azure SDK for Kusto Management SDK. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2020-09-18. 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-management + 1.0.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java new file mode 100644 index 000000000000..e35bcd166bdd --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.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.kusto; + +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.kusto.fluent.KustoManagementClient; +import com.azure.resourcemanager.kusto.implementation.AttachedDatabaseConfigurationsImpl; +import com.azure.resourcemanager.kusto.implementation.ClusterPrincipalAssignmentsImpl; +import com.azure.resourcemanager.kusto.implementation.ClustersImpl; +import com.azure.resourcemanager.kusto.implementation.DataConnectionsImpl; +import com.azure.resourcemanager.kusto.implementation.DatabasePrincipalAssignmentsImpl; +import com.azure.resourcemanager.kusto.implementation.DatabasesImpl; +import com.azure.resourcemanager.kusto.implementation.KustoManagementClientBuilder; +import com.azure.resourcemanager.kusto.implementation.OperationsImpl; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurations; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignments; +import com.azure.resourcemanager.kusto.models.Clusters; +import com.azure.resourcemanager.kusto.models.DataConnections; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignments; +import com.azure.resourcemanager.kusto.models.Databases; +import com.azure.resourcemanager.kusto.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Entry point to KustoManager. The Azure Kusto management API provides a RESTful set of web services that interact with + * Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete + * clusters and databases. + */ +public final class KustoManager { + private Clusters clusters; + + private ClusterPrincipalAssignments clusterPrincipalAssignments; + + private Databases databases; + + private DatabasePrincipalAssignments databasePrincipalAssignments; + + private AttachedDatabaseConfigurations attachedDatabaseConfigurations; + + private DataConnections dataConnections; + + private Operations operations; + + private final KustoManagementClient clientObject; + + private KustoManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new KustoManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Kusto service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Kusto service API instance. + */ + public static KustoManager 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 KustoManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new KustoManager.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 Kusto service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Kusto service API instance. + */ + public KustoManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.kusto", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + 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 KustoManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Clusters. */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** @return Resource collection API of ClusterPrincipalAssignments. */ + public ClusterPrincipalAssignments clusterPrincipalAssignments() { + if (this.clusterPrincipalAssignments == null) { + this.clusterPrincipalAssignments = + new ClusterPrincipalAssignmentsImpl(clientObject.getClusterPrincipalAssignments(), this); + } + return clusterPrincipalAssignments; + } + + /** @return Resource collection API of Databases. */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(clientObject.getDatabases(), this); + } + return databases; + } + + /** @return Resource collection API of DatabasePrincipalAssignments. */ + public DatabasePrincipalAssignments databasePrincipalAssignments() { + if (this.databasePrincipalAssignments == null) { + this.databasePrincipalAssignments = + new DatabasePrincipalAssignmentsImpl(clientObject.getDatabasePrincipalAssignments(), this); + } + return databasePrincipalAssignments; + } + + /** @return Resource collection API of AttachedDatabaseConfigurations. */ + public AttachedDatabaseConfigurations attachedDatabaseConfigurations() { + if (this.attachedDatabaseConfigurations == null) { + this.attachedDatabaseConfigurations = + new AttachedDatabaseConfigurationsImpl(clientObject.getAttachedDatabaseConfigurations(), this); + } + return attachedDatabaseConfigurations; + } + + /** @return Resource collection API of DataConnections. */ + public DataConnections dataConnections() { + if (this.dataConnections == null) { + this.dataConnections = new DataConnectionsImpl(clientObject.getDataConnections(), this); + } + return dataConnections; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * @return Wrapped service client KustoManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public KustoManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.java new file mode 100644 index 000000000000..dc68ba727a51 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.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.kusto.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.kusto.fluent.models.AttachedDatabaseConfigurationInner; + +/** An instance of this class provides access to all the operations defined in AttachedDatabaseConfigurationsClient. */ +public interface AttachedDatabaseConfigurationsClient { + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context); + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDatabaseConfigurationInner get( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context); + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AttachedDatabaseConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters); + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AttachedDatabaseConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters, + Context context); + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDatabaseConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters); + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDatabaseConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters, + Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClusterPrincipalAssignmentsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClusterPrincipalAssignmentsClient.java new file mode 100644 index 000000000000..8d5f90bb17fa --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClusterPrincipalAssignmentsClient.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.kusto.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.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignmentCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in ClusterPrincipalAssignmentsClient. */ +public interface ClusterPrincipalAssignmentsClient { + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPrincipalAssignmentInner get(String resourceGroupName, String clusterName, String principalAssignmentName); + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String principalAssignmentName, Context context); + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters); + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters, + Context context); + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters); + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters, + Context context); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, String principalAssignmentName); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, String principalAssignmentName, Context context); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String principalAssignmentName); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String principalAssignmentName, Context context); + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java new file mode 100644 index 000000000000..6546659cda96 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java @@ -0,0 +1,760 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; +import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; +import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.kusto.models.ClusterCheckNameRequest; +import com.azure.resourcemanager.kusto.models.ClusterUpdate; +import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +public interface ClustersClient { + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdate parameters); + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context); + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate parameters); + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context); + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName); + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, Context context); + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, Context context); + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName); + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, Context context); + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, Context context); + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStart(String resourceGroupName, String clusterName); + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStart(String resourceGroupName, String clusterName, Context context); + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String clusterName); + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String clusterName, Context context); + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listFollowerDatabases(String resourceGroupName, String clusterName); + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listFollowerDatabases( + String resourceGroupName, String clusterName, Context context); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDetachFollowerDatabases( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDetachFollowerDatabases( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context); + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, DiagnoseVirtualNetworkResultInner> + beginDiagnoseVirtualNetwork(String resourceGroupName, String clusterName); + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, DiagnoseVirtualNetworkResultInner> + beginDiagnoseVirtualNetwork(String resourceGroupName, String clusterName, Context context); + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + DiagnoseVirtualNetworkResultInner diagnoseVirtualNetwork(String resourceGroupName, String clusterName); + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + DiagnoseVirtualNetworkResultInner diagnoseVirtualNetwork( + String resourceGroupName, String clusterName, Context context); + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkus(); + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkus(Context context); + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability(String location, ClusterCheckNameRequest clusterName); + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, ClusterCheckNameRequest clusterName, Context context); + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkusByResource(String resourceGroupName, String clusterName); + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkusByResource( + String resourceGroupName, String clusterName, Context context); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLanguageExtensions(String resourceGroupName, String clusterName); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLanguageExtensions( + String resourceGroupName, String clusterName, Context context); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginAddLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginAddLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRemoveLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRemoveLanguageExtensions( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DataConnectionsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DataConnectionsClient.java new file mode 100644 index 000000000000..3fca0fd0c0fe --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DataConnectionsClient.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.kusto.models.DataConnectionCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in DataConnectionsClient. */ +public interface DataConnectionsClient { + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabase( + String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabase( + String resourceGroupName, String clusterName, String databaseName, Context context); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, String clusterName, String databaseName, DataConnectionValidationInner parameters); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context); + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName); + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner get( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasePrincipalAssignmentsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasePrincipalAssignmentsClient.java new file mode 100644 index 000000000000..695e0d04be85 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasePrincipalAssignmentsClient.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignmentCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in DatabasePrincipalAssignmentsClient. */ +public interface DatabasePrincipalAssignmentsClient { + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalAssignmentInner get( + String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName); + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + Context context); + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabasePrincipalAssignmentInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters); + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabasePrincipalAssignmentInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters, + Context context); + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters); + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters, + Context context); + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, String databaseName, String principalAssignmentName); + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, + String databaseName, + String principalAssignmentName, + Context context); + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String databaseName, String principalAssignmentName); + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, + String databaseName, + String principalAssignmentName, + Context context); + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterName, String databaseName); + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterName, String databaseName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java new file mode 100644 index 000000000000..4c040687b5b4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalListResultInner; +import com.azure.resourcemanager.kusto.models.CheckNameRequest; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalListRequest; + +/** An instance of this class provides access to all the operations defined in DatabasesClient. */ +public interface DatabasesClient { + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String resourceGroupName, String clusterName, CheckNameRequest resourceName); + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String clusterName, CheckNameRequest resourceName, Context context); + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner get(String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner update(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner update( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, String databaseName); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 clusterName, String databaseName, Context context); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String databaseName); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String databaseName, Context context); + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrincipals( + String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrincipals( + String resourceGroupName, String clusterName, String databaseName, Context context); + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalListResultInner addPrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd); + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response addPrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd, + Context context); + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalListResultInner removePrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove); + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response removePrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove, + Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.java new file mode 100644 index 000000000000..ce174ba1d47f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.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.kusto.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for KustoManagementClient class. */ +public interface KustoManagementClient { + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @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 ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * Gets the ClusterPrincipalAssignmentsClient object to access its operations. + * + * @return the ClusterPrincipalAssignmentsClient object. + */ + ClusterPrincipalAssignmentsClient getClusterPrincipalAssignments(); + + /** + * Gets the DatabasesClient object to access its operations. + * + * @return the DatabasesClient object. + */ + DatabasesClient getDatabases(); + + /** + * Gets the DatabasePrincipalAssignmentsClient object to access its operations. + * + * @return the DatabasePrincipalAssignmentsClient object. + */ + DatabasePrincipalAssignmentsClient getDatabasePrincipalAssignments(); + + /** + * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * + * @return the AttachedDatabaseConfigurationsClient object. + */ + AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations(); + + /** + * Gets the DataConnectionsClient object to access its operations. + * + * @return the DataConnectionsClient object. + */ + DataConnectionsClient getDataConnections(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/OperationsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/OperationsClient.java new file mode 100644 index 000000000000..48396b10970e --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/OperationsClient.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.kusto.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.kusto.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AttachedDatabaseConfigurationInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AttachedDatabaseConfigurationInner.java new file mode 100644 index 000000000000..f807a5ad8e45 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AttachedDatabaseConfigurationInner.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.kusto.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.kusto.models.DefaultPrincipalsModificationKind; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class representing an attached database configuration. */ +@JsonFlatten +@Fluent +public class AttachedDatabaseConfigurationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The name of the database which you would like to attach, use * if you + * want to follow all current and future databases. + */ + @JsonProperty(value = "properties.databaseName") + private String databaseName; + + /* + * The resource id of the cluster where the databases you would like to + * attach reside. + */ + @JsonProperty(value = "properties.clusterResourceId") + private String clusterResourceId; + + /* + * The list of databases from the clusterResourceId which are currently + * attached to the cluster. + */ + @JsonProperty(value = "properties.attachedDatabaseNames", access = JsonProperty.Access.WRITE_ONLY) + private List attachedDatabaseNames; + + /* + * The default principals modification kind + */ + @JsonProperty(value = "properties.defaultPrincipalsModificationKind") + private DefaultPrincipalsModificationKind defaultPrincipalsModificationKind; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the databaseName property: The name of the database which you would like to attach, use * if you want to + * follow all current and future databases. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The name of the database which you would like to attach, use * if you want to + * follow all current and future databases. + * + * @param databaseName the databaseName value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the clusterResourceId property: The resource id of the cluster where the databases you would like to attach + * reside. + * + * @return the clusterResourceId value. + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the clusterResourceId property: The resource id of the cluster where the databases you would like to attach + * reside. + * + * @param clusterResourceId the clusterResourceId value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the attachedDatabaseNames property: The list of databases from the clusterResourceId which are currently + * attached to the cluster. + * + * @return the attachedDatabaseNames value. + */ + public List attachedDatabaseNames() { + return this.attachedDatabaseNames; + } + + /** + * Get the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @return the defaultPrincipalsModificationKind value. + */ + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.defaultPrincipalsModificationKind; + } + + /** + * Set the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @param defaultPrincipalsModificationKind the defaultPrincipalsModificationKind value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.defaultPrincipalsModificationKind = defaultPrincipalsModificationKind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AzureResourceSkuInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AzureResourceSkuInner.java new file mode 100644 index 000000000000..70f01a247b23 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/AzureResourceSkuInner.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.AzureCapacity; +import com.azure.resourcemanager.kusto.models.AzureSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure resource SKU definition. */ +@Fluent +public final class AzureResourceSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResourceSkuInner.class); + + /* + * Resource Namespace and Type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The SKU details. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /* + * The number of instances of the cluster. + */ + @JsonProperty(value = "capacity") + private AzureCapacity capacity; + + /** + * Get the resourceType property: Resource Namespace and Type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Resource Namespace and Type. + * + * @param resourceType the resourceType value to set. + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the sku property: The SKU details. + * + * @return the sku value. + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU details. + * + * @param sku the sku value to set. + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the capacity property: The number of instances of the cluster. + * + * @return the capacity value. + */ + public AzureCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The number of instances of the cluster. + * + * @param capacity the capacity value to set. + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withCapacity(AzureCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (capacity() != null) { + capacity().validate(); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/CheckNameResultInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/CheckNameResultInner.java new file mode 100644 index 000000000000..68673f699903 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/CheckNameResultInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.Reason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result returned from a check name availability request. */ +@Fluent +public final class CheckNameResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameResultInner.class); + + /* + * Specifies a Boolean value that indicates if the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The name that was checked. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Message indicating an unavailable name due to a conflict, or a + * description of the naming rules that are violated. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Message providing the reason why the given name is invalid. + */ + @JsonProperty(value = "reason") + private Reason reason; + + /** + * Get the nameAvailable property: Specifies a Boolean value that indicates if the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Specifies a Boolean value that indicates if the name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the name property: The name that was checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name that was checked. + * + * @param name the name value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the message property: Message indicating an unavailable name due to a conflict, or a description of the + * naming rules that are violated. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message indicating an unavailable name due to a conflict, or a description of the + * naming rules that are violated. + * + * @param message the message value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the reason property: Message providing the reason why the given name is invalid. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Set the reason property: Message providing the reason why the given name is invalid. + * + * @param reason the reason value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withReason(Reason reason) { + this.reason = reason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java new file mode 100644 index 000000000000..2268acf74e3a --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.models.AzureSku; +import com.azure.resourcemanager.kusto.models.EngineType; +import com.azure.resourcemanager.kusto.models.Identity; +import com.azure.resourcemanager.kusto.models.KeyVaultProperties; +import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; +import com.azure.resourcemanager.kusto.models.OptimizedAutoscale; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.azure.resourcemanager.kusto.models.State; +import com.azure.resourcemanager.kusto.models.TrustedExternalTenant; +import com.azure.resourcemanager.kusto.models.VirtualNetworkConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Class representing a Kusto cluster. */ +@JsonFlatten +@Fluent +public class ClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); + + /* + * The SKU of the cluster. + */ + @JsonProperty(value = "sku", required = true) + private AzureSku sku; + + /* + * The availability zones of the cluster. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The state of the resource. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The cluster URI. + */ + @JsonProperty(value = "properties.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /* + * The cluster data ingestion URI. + */ + @JsonProperty(value = "properties.dataIngestionUri", access = JsonProperty.Access.WRITE_ONLY) + private String dataIngestionUri; + + /* + * The reason for the cluster's current state. + */ + @JsonProperty(value = "properties.stateReason", access = JsonProperty.Access.WRITE_ONLY) + private String stateReason; + + /* + * The cluster's external tenants. + */ + @JsonProperty(value = "properties.trustedExternalTenants") + private List trustedExternalTenants; + + /* + * Optimized auto scale definition. + */ + @JsonProperty(value = "properties.optimizedAutoscale") + private OptimizedAutoscale optimizedAutoscale; + + /* + * A boolean value that indicates if the cluster's disks are encrypted. + */ + @JsonProperty(value = "properties.enableDiskEncryption") + private Boolean enableDiskEncryption; + + /* + * A boolean value that indicates if the streaming ingest is enabled. + */ + @JsonProperty(value = "properties.enableStreamingIngest") + private Boolean enableStreamingIngest; + + /* + * Virtual network definition. + */ + @JsonProperty(value = "properties.virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /* + * KeyVault properties for the cluster encryption. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /* + * A boolean value that indicates if the purge operations are enabled. + */ + @JsonProperty(value = "properties.enablePurge") + private Boolean enablePurge; + + /* + * List of the cluster's language extensions. + */ + @JsonProperty(value = "properties.languageExtensions", access = JsonProperty.Access.WRITE_ONLY) + private LanguageExtensionsList languageExtensions; + + /* + * A boolean value that indicates if double encryption is enabled. + */ + @JsonProperty(value = "properties.enableDoubleEncryption") + private Boolean enableDoubleEncryption; + + /* + * The engine type + */ + @JsonProperty(value = "properties.engineType") + private EngineType engineType; + + /** + * Get the sku property: The SKU of the cluster. + * + * @return the sku value. + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the cluster. + * + * @param sku the sku value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the zones property: The availability zones of the cluster. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The availability zones of the cluster. + * + * @param zones the zones value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity property: The identity of the cluster, if configured. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the cluster, if configured. + * + * @param identity the identity value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the state property: The state of the resource. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the uri property: The cluster URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the dataIngestionUri property: The cluster data ingestion URI. + * + * @return the dataIngestionUri value. + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the stateReason property: The reason for the cluster's current state. + * + * @return the stateReason value. + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the trustedExternalTenants property: The cluster's external tenants. + * + * @return the trustedExternalTenants value. + */ + public List trustedExternalTenants() { + return this.trustedExternalTenants; + } + + /** + * Set the trustedExternalTenants property: The cluster's external tenants. + * + * @param trustedExternalTenants the trustedExternalTenants value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withTrustedExternalTenants(List trustedExternalTenants) { + this.trustedExternalTenants = trustedExternalTenants; + return this; + } + + /** + * Get the optimizedAutoscale property: Optimized auto scale definition. + * + * @return the optimizedAutoscale value. + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set the optimizedAutoscale property: Optimized auto scale definition. + * + * @param optimizedAutoscale the optimizedAutoscale value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + this.optimizedAutoscale = optimizedAutoscale; + return this; + } + + /** + * Get the enableDiskEncryption property: A boolean value that indicates if the cluster's disks are encrypted. + * + * @return the enableDiskEncryption value. + */ + public Boolean enableDiskEncryption() { + return this.enableDiskEncryption; + } + + /** + * Set the enableDiskEncryption property: A boolean value that indicates if the cluster's disks are encrypted. + * + * @param enableDiskEncryption the enableDiskEncryption value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableDiskEncryption(Boolean enableDiskEncryption) { + this.enableDiskEncryption = enableDiskEncryption; + return this; + } + + /** + * Get the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value. + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @param enableStreamingIngest the enableStreamingIngest value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableStreamingIngest(Boolean enableStreamingIngest) { + this.enableStreamingIngest = enableStreamingIngest; + return this; + } + + /** + * Get the virtualNetworkConfiguration property: Virtual network definition. + * + * @return the virtualNetworkConfiguration value. + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set the virtualNetworkConfiguration property: Virtual network definition. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get the keyVaultProperties property: KeyVault properties for the cluster encryption. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: KeyVault properties for the cluster encryption. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value. + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @param enablePurge the enablePurge value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEnablePurge(Boolean enablePurge) { + this.enablePurge = enablePurge; + return this; + } + + /** + * Get the languageExtensions property: List of the cluster's language extensions. + * + * @return the languageExtensions value. + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Get the enableDoubleEncryption property: A boolean value that indicates if double encryption is enabled. + * + * @return the enableDoubleEncryption value. + */ + public Boolean enableDoubleEncryption() { + return this.enableDoubleEncryption; + } + + /** + * Set the enableDoubleEncryption property: A boolean value that indicates if double encryption is enabled. + * + * @param enableDoubleEncryption the enableDoubleEncryption value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableDoubleEncryption(Boolean enableDoubleEncryption) { + this.enableDoubleEncryption = enableDoubleEncryption; + return this; + } + + /** + * Get the engineType property: The engine type. + * + * @return the engineType value. + */ + public EngineType engineType() { + return this.engineType; + } + + /** + * Set the engineType property: The engine type. + * + * @param engineType the engineType value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEngineType(EngineType engineType) { + this.engineType = engineType; + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner 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) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model ClusterInner")); + } else { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (trustedExternalTenants() != null) { + trustedExternalTenants().forEach(e -> e.validate()); + } + if (optimizedAutoscale() != null) { + optimizedAutoscale().validate(); + } + if (virtualNetworkConfiguration() != null) { + virtualNetworkConfiguration().validate(); + } + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (languageExtensions() != null) { + languageExtensions().validate(); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterPrincipalAssignmentInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterPrincipalAssignmentInner.java new file mode 100644 index 000000000000..b02333396cd0 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterPrincipalAssignmentInner.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.kusto.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.kusto.models.ClusterPrincipalRole; +import com.azure.resourcemanager.kusto.models.PrincipalType; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class representing a cluster principal assignment. */ +@JsonFlatten +@Fluent +public class ClusterPrincipalAssignmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentInner.class); + + /* + * The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /* + * Cluster principal role. + */ + @JsonProperty(value = "properties.role") + private ClusterPrincipalRole role; + + /* + * The tenant id of the principal + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /* + * Principal type. + */ + @JsonProperty(value = "properties.principalType") + private PrincipalType principalType; + + /* + * The tenant name of the principal + */ + @JsonProperty(value = "properties.tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /* + * The principal name + */ + @JsonProperty(value = "properties.principalName", access = JsonProperty.Access.WRITE_ONLY) + private String principalName; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the principalId property: The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * + * @param principalId the principalId value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the role property: Cluster principal role. + * + * @return the role value. + */ + public ClusterPrincipalRole role() { + return this.role; + } + + /** + * Set the role property: Cluster principal role. + * + * @param role the role value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withRole(ClusterPrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id of the principal. + * + * @param tenantId the tenantId value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the principalType property: Principal type. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: Principal type. + * + * @param principalType the principalType value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principalName property: The principal name. + * + * @return the principalName value. + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionInner.java new file mode 100644 index 000000000000..ba6d8314d502 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionInner.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.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.EventGridDataConnection; +import com.azure.resourcemanager.kusto.models.EventHubDataConnection; +import com.azure.resourcemanager.kusto.models.IotHubDataConnection; +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; + +/** Class representing an data connection. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DataConnectionInner.class) +@JsonTypeName("DataConnection") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "EventHub", value = EventHubDataConnection.class), + @JsonSubTypes.Type(name = "IotHub", value = IotHubDataConnection.class), + @JsonSubTypes.Type(name = "EventGrid", value = EventGridDataConnection.class) +}) +@Fluent +public class DataConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the DataConnectionInner object itself. + */ + public DataConnectionInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationInner.java new file mode 100644 index 000000000000..1af06baf9738 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationInner.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.kusto.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; + +/** Class representing an data connection validation. */ +@Fluent +public final class DataConnectionValidationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionValidationInner.class); + + /* + * The name of the data connection. + */ + @JsonProperty(value = "dataConnectionName") + private String dataConnectionName; + + /* + * The data connection properties to validate. + */ + @JsonProperty(value = "properties") + private DataConnectionInner properties; + + /** + * Get the dataConnectionName property: The name of the data connection. + * + * @return the dataConnectionName value. + */ + public String dataConnectionName() { + return this.dataConnectionName; + } + + /** + * Set the dataConnectionName property: The name of the data connection. + * + * @param dataConnectionName the dataConnectionName value to set. + * @return the DataConnectionValidationInner object itself. + */ + public DataConnectionValidationInner withDataConnectionName(String dataConnectionName) { + this.dataConnectionName = dataConnectionName; + return this; + } + + /** + * Get the properties property: The data connection properties to validate. + * + * @return the properties value. + */ + public DataConnectionInner properties() { + return this.properties; + } + + /** + * Set the properties property: The data connection properties to validate. + * + * @param properties the properties value to set. + * @return the DataConnectionValidationInner object itself. + */ + public DataConnectionValidationInner withProperties(DataConnectionInner 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationListResultInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationListResultInner.java new file mode 100644 index 000000000000..1244c23b4dfb --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DataConnectionValidationListResultInner.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.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.DataConnectionValidationResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto data connection validation result. */ +@Fluent +public final class DataConnectionValidationListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionValidationListResultInner.class); + + /* + * The list of Kusto data connection validation errors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto data connection validation errors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto data connection validation errors. + * + * @param value the value value to set. + * @return the DataConnectionValidationListResultInner object itself. + */ + public DataConnectionValidationListResultInner 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabaseInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabaseInner.java new file mode 100644 index 000000000000..c9ae8759baae --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabaseInner.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.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.ReadOnlyFollowingDatabase; +import com.azure.resourcemanager.kusto.models.ReadWriteDatabase; +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; + +/** Class representing a Kusto database. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DatabaseInner.class) +@JsonTypeName("Database") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ReadWrite", value = ReadWriteDatabase.class), + @JsonSubTypes.Type(name = "ReadOnlyFollowing", value = ReadOnlyFollowingDatabase.class) +}) +@Fluent +public class DatabaseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the DatabaseInner object itself. + */ + public DatabaseInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalAssignmentInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalAssignmentInner.java new file mode 100644 index 000000000000..96fe584012ad --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalAssignmentInner.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.kusto.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.kusto.models.DatabasePrincipalRole; +import com.azure.resourcemanager.kusto.models.PrincipalType; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class representing a database principal assignment. */ +@JsonFlatten +@Fluent +public class DatabasePrincipalAssignmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentInner.class); + + /* + * The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /* + * Database principal role. + */ + @JsonProperty(value = "properties.role") + private DatabasePrincipalRole role; + + /* + * The tenant id of the principal + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /* + * Principal type. + */ + @JsonProperty(value = "properties.principalType") + private PrincipalType principalType; + + /* + * The tenant name of the principal + */ + @JsonProperty(value = "properties.tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /* + * The principal name + */ + @JsonProperty(value = "properties.principalName", access = JsonProperty.Access.WRITE_ONLY) + private String principalName; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the principalId property: The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * + * @param principalId the principalId value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the role property: Database principal role. + * + * @return the role value. + */ + public DatabasePrincipalRole role() { + return this.role; + } + + /** + * Set the role property: Database principal role. + * + * @param role the role value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withRole(DatabasePrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id of the principal. + * + * @param tenantId the tenantId value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the principalType property: Principal type. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: Principal type. + * + * @param principalType the principalType value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principalName property: The principal name. + * + * @return the principalName value. + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalInner.java new file mode 100644 index 000000000000..c3bf3d9b6cbe --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A class representing database principal entity. */ +@Fluent +public final class DatabasePrincipalInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalInner.class); + + /* + * Database principal role. + */ + @JsonProperty(value = "role", required = true) + private DatabasePrincipalRole role; + + /* + * Database principal name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Database principal type. + */ + @JsonProperty(value = "type", required = true) + private DatabasePrincipalType type; + + /* + * Database principal fully qualified name. + */ + @JsonProperty(value = "fqn") + private String fqn; + + /* + * Database principal email if exists. + */ + @JsonProperty(value = "email") + private String email; + + /* + * Application id - relevant only for application principal type. + */ + @JsonProperty(value = "appId") + private String appId; + + /* + * The tenant name of the principal + */ + @JsonProperty(value = "tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /** + * Get the role property: Database principal role. + * + * @return the role value. + */ + public DatabasePrincipalRole role() { + return this.role; + } + + /** + * Set the role property: Database principal role. + * + * @param role the role value to set. + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withRole(DatabasePrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the name property: Database principal name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Database principal name. + * + * @param name the name value to set. + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Database principal type. + * + * @return the type value. + */ + public DatabasePrincipalType type() { + return this.type; + } + + /** + * Set the type property: Database principal type. + * + * @param type the type value to set. + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withType(DatabasePrincipalType type) { + this.type = type; + return this; + } + + /** + * Get the fqn property: Database principal fully qualified name. + * + * @return the fqn value. + */ + public String fqn() { + return this.fqn; + } + + /** + * Set the fqn property: Database principal fully qualified name. + * + * @param fqn the fqn value to set. + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withFqn(String fqn) { + this.fqn = fqn; + return this; + } + + /** + * Get the email property: Database principal email if exists. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Database principal email if exists. + * + * @param email the email value to set. + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the appId property: Application id - relevant only for application principal type. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Set the appId property: Application id - relevant only for application principal type. + * + * @param appId the appId value to set. + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (role() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property role in model DatabasePrincipalInner")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model DatabasePrincipalInner")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model DatabasePrincipalInner")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalListResultInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalListResultInner.java new file mode 100644 index 000000000000..73313f38d677 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DatabasePrincipalListResultInner.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.kusto.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; +import java.util.List; + +/** The list Kusto database principals operation response. */ +@Fluent +public final class DatabasePrincipalListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalListResultInner.class); + + /* + * The list of Kusto database principals. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto database principals. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto database principals. + * + * @param value the value value to set. + * @return the DatabasePrincipalListResultInner object itself. + */ + public DatabasePrincipalListResultInner 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DiagnoseVirtualNetworkResultInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DiagnoseVirtualNetworkResultInner.java new file mode 100644 index 000000000000..53be09782411 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/DiagnoseVirtualNetworkResultInner.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.kusto.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; +import java.util.List; + +/** The DiagnoseVirtualNetworkResult model. */ +@Fluent +public final class DiagnoseVirtualNetworkResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnoseVirtualNetworkResultInner.class); + + /* + * The list of network connectivity diagnostic finding + */ + @JsonProperty(value = "findings") + private List findings; + + /** + * Get the findings property: The list of network connectivity diagnostic finding. + * + * @return the findings value. + */ + public List findings() { + return this.findings; + } + + /** + * Set the findings property: The list of network connectivity diagnostic finding. + * + * @param findings the findings value to set. + * @return the DiagnoseVirtualNetworkResultInner object itself. + */ + public DiagnoseVirtualNetworkResultInner withFindings(List findings) { + this.findings = findings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/FollowerDatabaseDefinitionInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/FollowerDatabaseDefinitionInner.java new file mode 100644 index 000000000000..c034c8bdf5bc --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/FollowerDatabaseDefinitionInner.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.kusto.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 class representing follower database request. */ +@Fluent +public final class FollowerDatabaseDefinitionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FollowerDatabaseDefinitionInner.class); + + /* + * Resource id of the cluster that follows a database owned by this + * cluster. + */ + @JsonProperty(value = "clusterResourceId", required = true) + private String clusterResourceId; + + /* + * Resource name of the attached database configuration in the follower + * cluster. + */ + @JsonProperty(value = "attachedDatabaseConfigurationName", required = true) + private String attachedDatabaseConfigurationName; + + /* + * The database name owned by this cluster that was followed. * in case + * following all databases. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Get the clusterResourceId property: Resource id of the cluster that follows a database owned by this cluster. + * + * @return the clusterResourceId value. + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the clusterResourceId property: Resource id of the cluster that follows a database owned by this cluster. + * + * @param clusterResourceId the clusterResourceId value to set. + * @return the FollowerDatabaseDefinitionInner object itself. + */ + public FollowerDatabaseDefinitionInner withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the attachedDatabaseConfigurationName property: Resource name of the attached database configuration in the + * follower cluster. + * + * @return the attachedDatabaseConfigurationName value. + */ + public String attachedDatabaseConfigurationName() { + return this.attachedDatabaseConfigurationName; + } + + /** + * Set the attachedDatabaseConfigurationName property: Resource name of the attached database configuration in the + * follower cluster. + * + * @param attachedDatabaseConfigurationName the attachedDatabaseConfigurationName value to set. + * @return the FollowerDatabaseDefinitionInner object itself. + */ + public FollowerDatabaseDefinitionInner withAttachedDatabaseConfigurationName( + String attachedDatabaseConfigurationName) { + this.attachedDatabaseConfigurationName = attachedDatabaseConfigurationName; + return this; + } + + /** + * Get the databaseName property: The database name owned by this cluster that was followed. * in case following all + * databases. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterResourceId in model FollowerDatabaseDefinitionInner")); + } + if (attachedDatabaseConfigurationName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property attachedDatabaseConfigurationName in model" + + " FollowerDatabaseDefinitionInner")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/LanguageExtensionInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/LanguageExtensionInner.java new file mode 100644 index 000000000000..c50b194ff78b --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/LanguageExtensionInner.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.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.LanguageExtensionName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The language extension object. */ +@Fluent +public final class LanguageExtensionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LanguageExtensionInner.class); + + /* + * The language extension name. + */ + @JsonProperty(value = "languageExtensionName") + private LanguageExtensionName languageExtensionName; + + /** + * Get the languageExtensionName property: The language extension name. + * + * @return the languageExtensionName value. + */ + public LanguageExtensionName languageExtensionName() { + return this.languageExtensionName; + } + + /** + * Set the languageExtensionName property: The language extension name. + * + * @param languageExtensionName the languageExtensionName value to set. + * @return the LanguageExtensionInner object itself. + */ + public LanguageExtensionInner withLanguageExtensionName(LanguageExtensionName languageExtensionName) { + this.languageExtensionName = languageExtensionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java new file mode 100644 index 000000000000..5a7278a8f268 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A REST API operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * This is of the format {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Any object + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: This is of the format {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: This is of the format {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that describes the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that describes the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Any object. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Any object. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/SkuDescriptionInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/SkuDescriptionInner.java new file mode 100644 index 000000000000..f1104f4a5584 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/SkuDescriptionInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.SkuLocationInfoItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Kusto SKU description of given resource type. */ +@Immutable +public final class SkuDescriptionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuDescriptionInner.class); + + /* + * The resource type + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The name of the SKU + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The tier of the SKU + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /* + * The set of locations that the SKU is available + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * Locations and zones + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /* + * The restrictions because of which SKU cannot be used + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: The tier of the SKU. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the locationInfo property: Locations and zones. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/package-info.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/package-info.java new file mode 100644 index 000000000000..4ee666c53976 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/package-info.java @@ -0,0 +1,10 @@ +// 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 KustoManagementClient. The Azure Kusto management API provides a RESTful + * set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables + * you to create, update, and delete clusters and databases. + */ +package com.azure.resourcemanager.kusto.fluent.models; diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/package-info.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/package-info.java new file mode 100644 index 000000000000..d8a6cc37d624 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/package-info.java @@ -0,0 +1,10 @@ +// 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 KustoManagementClient. The Azure Kusto management API provides a RESTful + * set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables + * you to create, update, and delete clusters and databases. + */ +package com.azure.resourcemanager.kusto.fluent; diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationImpl.java new file mode 100644 index 000000000000..cfe56f98f753 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfiguration; +import com.azure.resourcemanager.kusto.models.DefaultPrincipalsModificationKind; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class AttachedDatabaseConfigurationImpl + implements AttachedDatabaseConfiguration, + AttachedDatabaseConfiguration.Definition, + AttachedDatabaseConfiguration.Update { + private AttachedDatabaseConfigurationInner innerObject; + + private final KustoManager 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String databaseName() { + return this.innerModel().databaseName(); + } + + public String clusterResourceId() { + return this.innerModel().clusterResourceId(); + } + + public List attachedDatabaseNames() { + List inner = this.innerModel().attachedDatabaseNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.innerModel().defaultPrincipalsModificationKind(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AttachedDatabaseConfigurationInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String attachedDatabaseConfigurationName; + + public AttachedDatabaseConfigurationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public AttachedDatabaseConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public AttachedDatabaseConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.innerModel(), context); + return this; + } + + AttachedDatabaseConfigurationImpl(String name, KustoManager serviceManager) { + this.innerObject = new AttachedDatabaseConfigurationInner(); + this.serviceManager = serviceManager; + this.attachedDatabaseConfigurationName = name; + } + + public AttachedDatabaseConfigurationImpl update() { + return this; + } + + public AttachedDatabaseConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public AttachedDatabaseConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.innerModel(), context); + return this; + } + + AttachedDatabaseConfigurationImpl(AttachedDatabaseConfigurationInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.attachedDatabaseConfigurationName = + Utils.getValueFromIdByName(innerObject.id(), "attachedDatabaseConfigurations"); + } + + public AttachedDatabaseConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .getWithResponse(resourceGroupName, clusterName, attachedDatabaseConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public AttachedDatabaseConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .getWithResponse(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context) + .getValue(); + return this; + } + + public AttachedDatabaseConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AttachedDatabaseConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AttachedDatabaseConfigurationImpl withDatabaseName(String databaseName) { + this.innerModel().withDatabaseName(databaseName); + return this; + } + + public AttachedDatabaseConfigurationImpl withClusterResourceId(String clusterResourceId) { + this.innerModel().withClusterResourceId(clusterResourceId); + return this; + } + + public AttachedDatabaseConfigurationImpl withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.innerModel().withDefaultPrincipalsModificationKind(defaultPrincipalsModificationKind); + return this; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java new file mode 100644 index 000000000000..5fafae3f7d3d --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java @@ -0,0 +1,1080 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.AttachedDatabaseConfigurationsClient; +import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationListResult; +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 AttachedDatabaseConfigurationsClient. */ +public final class AttachedDatabaseConfigurationsClientImpl implements AttachedDatabaseConfigurationsClient { + private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AttachedDatabaseConfigurationsService service; + + /** The service client containing this operation class. */ + private final KustoManagementClientImpl client; + + /** + * Initializes an instance of AttachedDatabaseConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AttachedDatabaseConfigurationsClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy + .create( + AttachedDatabaseConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientAttachedDatabaseConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface AttachedDatabaseConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/attachedDatabaseConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AttachedDatabaseConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listByCluster( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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()))); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listByCluster( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster( + String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getWithResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDatabaseConfigurationInner get( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).block(); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context).block(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AttachedDatabaseConfigurationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AttachedDatabaseConfigurationInner.class, + AttachedDatabaseConfigurationInner.class, + Context.NONE); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AttachedDatabaseConfigurationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AttachedDatabaseConfigurationInner.class, + AttachedDatabaseConfigurationInner.class, + context); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AttachedDatabaseConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AttachedDatabaseConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDatabaseConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters) + .block(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDatabaseConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String attachedDatabaseConfigurationName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters, context) + .block(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return beginDeleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).getSyncPoller(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context) + .getSyncPoller(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return beginDeleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + deleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).block(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + deleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context).block(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.java new file mode 100644 index 000000000000..41909d2a27aa --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.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.kusto.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.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.AttachedDatabaseConfigurationsClient; +import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfiguration; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AttachedDatabaseConfigurationsImpl implements AttachedDatabaseConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationsImpl.class); + + private final AttachedDatabaseConfigurationsClient innerClient; + + private final KustoManager serviceManager; + + public AttachedDatabaseConfigurationsImpl( + AttachedDatabaseConfigurationsClient innerClient, KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new AttachedDatabaseConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new AttachedDatabaseConfigurationImpl(inner1, this.manager())); + } + + public AttachedDatabaseConfiguration get( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + AttachedDatabaseConfigurationInner inner = + this.serviceClient().get(resourceGroupName, clusterName, attachedDatabaseConfigurationName); + if (inner != null) { + return new AttachedDatabaseConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AttachedDatabaseConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + this.serviceClient().delete(resourceGroupName, clusterName, attachedDatabaseConfigurationName); + } + + public void delete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context); + } + + public AttachedDatabaseConfiguration 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + id))); + } + return this + .getWithResponse(resourceGroupName, clusterName, attachedDatabaseConfigurationName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, attachedDatabaseConfigurationName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + id))); + } + this.delete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + id))); + } + this.delete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, context); + } + + private AttachedDatabaseConfigurationsClient serviceClient() { + return this.innerClient; + } + + private KustoManager manager() { + return this.serviceManager; + } + + public AttachedDatabaseConfigurationImpl define(String name) { + return new AttachedDatabaseConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AzureResourceSkuImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AzureResourceSkuImpl.java new file mode 100644 index 000000000000..4c35b6f035ca --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AzureResourceSkuImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.kusto.models.AzureCapacity; +import com.azure.resourcemanager.kusto.models.AzureResourceSku; +import com.azure.resourcemanager.kusto.models.AzureSku; + +public final class AzureResourceSkuImpl implements AzureResourceSku { + private AzureResourceSkuInner innerObject; + + private final KustoManager serviceManager; + + AzureResourceSkuImpl(AzureResourceSkuInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public AzureSku sku() { + return this.innerModel().sku(); + } + + public AzureCapacity capacity() { + return this.innerModel().capacity(); + } + + public AzureResourceSkuInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/CheckNameResultImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/CheckNameResultImpl.java new file mode 100644 index 000000000000..08949b9e72d9 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/CheckNameResultImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.models.CheckNameResult; +import com.azure.resourcemanager.kusto.models.Reason; + +public final class CheckNameResultImpl implements CheckNameResult { + private CheckNameResultInner innerObject; + + private final KustoManager serviceManager; + + CheckNameResultImpl(CheckNameResultInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String name() { + return this.innerModel().name(); + } + + public String message() { + return this.innerModel().message(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public CheckNameResultInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java new file mode 100644 index 000000000000..ba154061dd4b --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; +import com.azure.resourcemanager.kusto.models.AzureSku; +import com.azure.resourcemanager.kusto.models.Cluster; +import com.azure.resourcemanager.kusto.models.ClusterUpdate; +import com.azure.resourcemanager.kusto.models.EngineType; +import com.azure.resourcemanager.kusto.models.Identity; +import com.azure.resourcemanager.kusto.models.KeyVaultProperties; +import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; +import com.azure.resourcemanager.kusto.models.OptimizedAutoscale; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.azure.resourcemanager.kusto.models.State; +import com.azure.resourcemanager.kusto.models.TrustedExternalTenant; +import com.azure.resourcemanager.kusto.models.VirtualNetworkConfiguration; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final KustoManager 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 AzureSku sku() { + return this.innerModel().sku(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public State state() { + return this.innerModel().state(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uri() { + return this.innerModel().uri(); + } + + public String dataIngestionUri() { + return this.innerModel().dataIngestionUri(); + } + + public String stateReason() { + return this.innerModel().stateReason(); + } + + public List trustedExternalTenants() { + List inner = this.innerModel().trustedExternalTenants(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OptimizedAutoscale optimizedAutoscale() { + return this.innerModel().optimizedAutoscale(); + } + + public Boolean enableDiskEncryption() { + return this.innerModel().enableDiskEncryption(); + } + + public Boolean enableStreamingIngest() { + return this.innerModel().enableStreamingIngest(); + } + + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.innerModel().virtualNetworkConfiguration(); + } + + public KeyVaultProperties keyVaultProperties() { + return this.innerModel().keyVaultProperties(); + } + + public Boolean enablePurge() { + return this.innerModel().enablePurge(); + } + + public LanguageExtensionsList languageExtensions() { + return this.innerModel().languageExtensions(); + } + + public Boolean enableDoubleEncryption() { + return this.innerModel().enableDoubleEncryption(); + } + + public EngineType engineType() { + return this.innerModel().engineType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ClusterUpdate updateParameters; + + public ClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Cluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl(String name, KustoManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + this.updateParameters = new ClusterUpdate(); + return this; + } + + public Cluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, updateParameters, Context.NONE); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, updateParameters, context); + return this; + } + + ClusterImpl(ClusterInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public ClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterImpl withSku(AzureSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public ClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ClusterImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ClusterImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public ClusterImpl withTrustedExternalTenants(List trustedExternalTenants) { + if (isInCreateMode()) { + this.innerModel().withTrustedExternalTenants(trustedExternalTenants); + return this; + } else { + this.updateParameters.withTrustedExternalTenants(trustedExternalTenants); + return this; + } + } + + public ClusterImpl withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + if (isInCreateMode()) { + this.innerModel().withOptimizedAutoscale(optimizedAutoscale); + return this; + } else { + this.updateParameters.withOptimizedAutoscale(optimizedAutoscale); + return this; + } + } + + public ClusterImpl withEnableDiskEncryption(Boolean enableDiskEncryption) { + if (isInCreateMode()) { + this.innerModel().withEnableDiskEncryption(enableDiskEncryption); + return this; + } else { + this.updateParameters.withEnableDiskEncryption(enableDiskEncryption); + return this; + } + } + + public ClusterImpl withEnableStreamingIngest(Boolean enableStreamingIngest) { + if (isInCreateMode()) { + this.innerModel().withEnableStreamingIngest(enableStreamingIngest); + return this; + } else { + this.updateParameters.withEnableStreamingIngest(enableStreamingIngest); + return this; + } + } + + public ClusterImpl withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + if (isInCreateMode()) { + this.innerModel().withVirtualNetworkConfiguration(virtualNetworkConfiguration); + return this; + } else { + this.updateParameters.withVirtualNetworkConfiguration(virtualNetworkConfiguration); + return this; + } + } + + public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + if (isInCreateMode()) { + this.innerModel().withKeyVaultProperties(keyVaultProperties); + return this; + } else { + this.updateParameters.withKeyVaultProperties(keyVaultProperties); + return this; + } + } + + public ClusterImpl withEnablePurge(Boolean enablePurge) { + if (isInCreateMode()) { + this.innerModel().withEnablePurge(enablePurge); + return this; + } else { + this.updateParameters.withEnablePurge(enablePurge); + return this; + } + } + + public ClusterImpl withEnableDoubleEncryption(Boolean enableDoubleEncryption) { + if (isInCreateMode()) { + this.innerModel().withEnableDoubleEncryption(enableDoubleEncryption); + return this; + } else { + this.updateParameters.withEnableDoubleEncryption(enableDoubleEncryption); + return this; + } + } + + public ClusterImpl withEngineType(EngineType engineType) { + if (isInCreateMode()) { + this.innerModel().withEngineType(engineType); + return this; + } else { + this.updateParameters.withEngineType(engineType); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentImpl.java new file mode 100644 index 000000000000..e62ad2143fac --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignment; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalRole; +import com.azure.resourcemanager.kusto.models.PrincipalType; +import com.azure.resourcemanager.kusto.models.ProvisioningState; + +public final class ClusterPrincipalAssignmentImpl + implements ClusterPrincipalAssignment, ClusterPrincipalAssignment.Definition, ClusterPrincipalAssignment.Update { + private ClusterPrincipalAssignmentInner innerObject; + + private final KustoManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public ClusterPrincipalRole role() { + return this.innerModel().role(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String tenantName() { + return this.innerModel().tenantName(); + } + + public String principalName() { + return this.innerModel().principalName(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ClusterPrincipalAssignmentInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String principalAssignmentName; + + public ClusterPrincipalAssignmentImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public ClusterPrincipalAssignment create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPrincipalAssignments() + .createOrUpdate( + resourceGroupName, clusterName, principalAssignmentName, this.innerModel(), Context.NONE); + return this; + } + + public ClusterPrincipalAssignment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPrincipalAssignments() + .createOrUpdate(resourceGroupName, clusterName, principalAssignmentName, this.innerModel(), context); + return this; + } + + ClusterPrincipalAssignmentImpl(String name, KustoManager serviceManager) { + this.innerObject = new ClusterPrincipalAssignmentInner(); + this.serviceManager = serviceManager; + this.principalAssignmentName = name; + } + + public ClusterPrincipalAssignmentImpl update() { + return this; + } + + public ClusterPrincipalAssignment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPrincipalAssignments() + .createOrUpdate( + resourceGroupName, clusterName, principalAssignmentName, this.innerModel(), Context.NONE); + return this; + } + + public ClusterPrincipalAssignment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPrincipalAssignments() + .createOrUpdate(resourceGroupName, clusterName, principalAssignmentName, this.innerModel(), context); + return this; + } + + ClusterPrincipalAssignmentImpl(ClusterPrincipalAssignmentInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.principalAssignmentName = Utils.getValueFromIdByName(innerObject.id(), "principalAssignments"); + } + + public ClusterPrincipalAssignment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPrincipalAssignments() + .getWithResponse(resourceGroupName, clusterName, principalAssignmentName, Context.NONE) + .getValue(); + return this; + } + + public ClusterPrincipalAssignment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPrincipalAssignments() + .getWithResponse(resourceGroupName, clusterName, principalAssignmentName, context) + .getValue(); + return this; + } + + public ClusterPrincipalAssignmentImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public ClusterPrincipalAssignmentImpl withRole(ClusterPrincipalRole role) { + this.innerModel().withRole(role); + return this; + } + + public ClusterPrincipalAssignmentImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public ClusterPrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.innerModel().withPrincipalType(principalType); + return this; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsClientImpl.java new file mode 100644 index 000000000000..d2b972bf5cdf --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsClientImpl.java @@ -0,0 +1,1264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.ClusterPrincipalAssignmentsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignmentListResult; +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 ClusterPrincipalAssignmentsClient. */ +public final class ClusterPrincipalAssignmentsClientImpl implements ClusterPrincipalAssignmentsClient { + private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClusterPrincipalAssignmentsService service; + + /** The service client containing this operation class. */ + private final KustoManagementClientImpl client; + + /** + * Initializes an instance of ClusterPrincipalAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterPrincipalAssignmentsClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy + .create( + ClusterPrincipalAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientClusterPrincipalAssignments to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface ClusterPrincipalAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/checkPrincipalAssignmentNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterPrincipalAssignmentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/principalAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + principalAssignmentName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + principalAssignmentName, + accept, + context); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, principalAssignmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityAsync(resourceGroupName, clusterName, principalAssignmentName).block(); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, principalAssignmentName, context) + .block(); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String principalAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String principalAssignmentName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String principalAssignmentName) { + return getWithResponseAsync(resourceGroupName, clusterName, principalAssignmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPrincipalAssignmentInner get( + String resourceGroupName, String clusterName, String principalAssignmentName) { + return getAsync(resourceGroupName, clusterName, principalAssignmentName).block(); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String principalAssignmentName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, principalAssignmentName, context).block(); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName 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.getSubscriptionId(), + resourceGroupName, + clusterName, + principalAssignmentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName 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.getSubscriptionId(), + resourceGroupName, + clusterName, + principalAssignmentName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterPrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterPrincipalAssignmentInner.class, + ClusterPrincipalAssignmentInner.class, + Context.NONE); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterPrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, principalAssignmentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterPrincipalAssignmentInner.class, + ClusterPrincipalAssignmentInner.class, + context); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, principalAssignmentName, parameters) + .getSyncPoller(); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, principalAssignmentName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, principalAssignmentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, principalAssignmentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).block(); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String principalAssignmentName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, principalAssignmentName, parameters, context) + .block(); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, principalAssignmentName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, principalAssignmentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName) { + return beginDeleteAsync(resourceGroupName, clusterName, principalAssignmentName).getSyncPoller(); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, principalAssignmentName, context).getSyncPoller(); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName) { + return beginDeleteAsync(resourceGroupName, clusterName, principalAssignmentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String principalAssignmentName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, principalAssignmentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String principalAssignmentName) { + deleteAsync(resourceGroupName, clusterName, principalAssignmentName).block(); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String principalAssignmentName, Context context) { + deleteAsync(resourceGroupName, clusterName, principalAssignmentName, context).block(); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + 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()))); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsImpl.java new file mode 100644 index 000000000000..9074c340fdf2 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterPrincipalAssignmentsImpl.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.kusto.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.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.ClusterPrincipalAssignmentsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.CheckNameResult; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignment; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClusterPrincipalAssignmentsImpl implements ClusterPrincipalAssignments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentsImpl.class); + + private final ClusterPrincipalAssignmentsClient innerClient; + + private final KustoManager serviceManager; + + public ClusterPrincipalAssignmentsImpl(ClusterPrincipalAssignmentsClient innerClient, KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + CheckNameResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, clusterName, principalAssignmentName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, clusterName, principalAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ClusterPrincipalAssignment get( + String resourceGroupName, String clusterName, String principalAssignmentName) { + ClusterPrincipalAssignmentInner inner = + this.serviceClient().get(resourceGroupName, clusterName, principalAssignmentName); + if (inner != null) { + return new ClusterPrincipalAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String principalAssignmentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, principalAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterPrincipalAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String principalAssignmentName) { + this.serviceClient().delete(resourceGroupName, clusterName, principalAssignmentName); + } + + public void delete(String resourceGroupName, String clusterName, String principalAssignmentName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, principalAssignmentName, context); + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new ClusterPrincipalAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new ClusterPrincipalAssignmentImpl(inner1, this.manager())); + } + + public ClusterPrincipalAssignment 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, principalAssignmentName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, principalAssignmentName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + this.delete(resourceGroupName, clusterName, principalAssignmentName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + this.delete(resourceGroupName, clusterName, principalAssignmentName, context); + } + + private ClusterPrincipalAssignmentsClient serviceClient() { + return this.innerClient; + } + + private KustoManager manager() { + return this.serviceManager; + } + + public ClusterPrincipalAssignmentImpl define(String name) { + return new ClusterPrincipalAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java new file mode 100644 index 000000000000..0f7e1cea17c3 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java @@ -0,0 +1,3812 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.ClustersClient; +import com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; +import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; +import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.kusto.models.ClusterCheckNameRequest; +import com.azure.resourcemanager.kusto.models.ClusterListResult; +import com.azure.resourcemanager.kusto.models.ClusterUpdate; +import com.azure.resourcemanager.kusto.models.FollowerDatabaseListResult; +import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; +import com.azure.resourcemanager.kusto.models.ListResourceSkusResult; +import com.azure.resourcemanager.kusto.models.SkuDescriptionList; +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 ClustersClient. */ +public final class ClustersClientImpl implements ClustersClient { + private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClustersService service; + + /** The service client containing this operation class. */ + private final KustoManagementClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(KustoManagementClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface ClustersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/listFollowerDatabases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listFollowerDatabases( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/detachFollowerDatabases") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> detachFollowerDatabases( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FollowerDatabaseDefinitionInner followerDatabaseToRemove, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/diagnoseVirtualNetwork") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> diagnoseVirtualNetwork( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkus( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @BodyParam("application/json") ClusterCheckNameRequest clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkusByResource( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/listLanguageExtensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLanguageExtensions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/addLanguageExtensions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> addLanguageExtensions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LanguageExtensionsList languageExtensionsToAdd, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/removeLanguageExtensions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> removeLanguageExtensions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LanguageExtensionsList languageExtensionsToRemove, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + } + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return updateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update( + String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { + return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .stop( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .stop( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + return beginStopAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + return beginStopAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName) { + return beginStopAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, Context context) { + return beginStopAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName) { + stopAsync(resourceGroupName, clusterName).block(); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, Context context) { + stopAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .start( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .start( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartAsync(String resourceGroupName, String clusterName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStart(String resourceGroupName, String clusterName) { + return beginStartAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStart( + String resourceGroupName, String clusterName, Context context) { + return beginStartAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String resourceGroupName, String clusterName) { + return beginStartAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String resourceGroupName, String clusterName, Context context) { + return beginStartAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 start(String resourceGroupName, String clusterName) { + startAsync(resourceGroupName, clusterName).block(); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 start(String resourceGroupName, String clusterName, Context context) { + startAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listFollowerDatabasesSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listFollowerDatabases( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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()))); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listFollowerDatabasesSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listFollowerDatabases( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listFollowerDatabasesAsync( + String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listFollowerDatabasesSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listFollowerDatabasesAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listFollowerDatabasesSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listFollowerDatabases( + String resourceGroupName, String clusterName) { + return new PagedIterable<>(listFollowerDatabasesAsync(resourceGroupName, clusterName)); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listFollowerDatabases( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listFollowerDatabasesAsync(resourceGroupName, clusterName, context)); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> detachFollowerDatabasesWithResponseAsync( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (followerDatabaseToRemove == null) { + return Mono + .error( + new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null.")); + } else { + followerDatabaseToRemove.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .detachFollowerDatabases( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + followerDatabaseToRemove, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> detachFollowerDatabasesWithResponseAsync( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (followerDatabaseToRemove == null) { + return Mono + .error( + new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null.")); + } else { + followerDatabaseToRemove.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .detachFollowerDatabases( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + followerDatabaseToRemove, + accept, + context); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDetachFollowerDatabasesAsync( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + Mono>> mono = + detachFollowerDatabasesWithResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDetachFollowerDatabasesAsync( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + detachFollowerDatabasesWithResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDetachFollowerDatabases( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return beginDetachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove) + .getSyncPoller(); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDetachFollowerDatabases( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + return beginDetachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove, context) + .getSyncPoller(); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 detachFollowerDatabasesAsync( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return beginDetachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 detachFollowerDatabasesAsync( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + return beginDetachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 detachFollowerDatabases( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + detachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove).block(); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 detachFollowerDatabases( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + detachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove, context).block(); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> diagnoseVirtualNetworkWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .diagnoseVirtualNetwork( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> diagnoseVirtualNetworkWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .diagnoseVirtualNetwork( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, DiagnoseVirtualNetworkResultInner> + beginDiagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName) { + Mono>> mono = diagnoseVirtualNetworkWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DiagnoseVirtualNetworkResultInner.class, + DiagnoseVirtualNetworkResultInner.class, + Context.NONE); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, DiagnoseVirtualNetworkResultInner> + beginDiagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + diagnoseVirtualNetworkWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DiagnoseVirtualNetworkResultInner.class, + DiagnoseVirtualNetworkResultInner.class, + context); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, DiagnoseVirtualNetworkResultInner> + beginDiagnoseVirtualNetwork(String resourceGroupName, String clusterName) { + return beginDiagnoseVirtualNetworkAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, DiagnoseVirtualNetworkResultInner> + beginDiagnoseVirtualNetwork(String resourceGroupName, String clusterName, Context context) { + return beginDiagnoseVirtualNetworkAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diagnoseVirtualNetworkAsync( + String resourceGroupName, String clusterName) { + return beginDiagnoseVirtualNetworkAsync(resourceGroupName, clusterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diagnoseVirtualNetworkAsync( + String resourceGroupName, String clusterName, Context context) { + return beginDiagnoseVirtualNetworkAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DiagnoseVirtualNetworkResultInner diagnoseVirtualNetwork(String resourceGroupName, String clusterName) { + return diagnoseVirtualNetworkAsync(resourceGroupName, clusterName).block(); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DiagnoseVirtualNetworkResultInner diagnoseVirtualNetwork( + String resourceGroupName, String clusterName, Context context) { + return diagnoseVirtualNetworkAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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()))); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @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.getSubscriptionId(), + this.client.getApiVersion(), + 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()))); + } + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 + .listSkus( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + 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()))); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusSinglePageAsync(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 + .listSkus( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusAsync() { + return new PagedFlux<>(() -> listSkusSinglePageAsync()); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusAsync(Context context) { + return new PagedFlux<>(() -> listSkusSinglePageAsync(context)); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus() { + return new PagedIterable<>(listSkusAsync()); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus(Context context) { + return new PagedIterable<>(listSkusAsync(context)); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, ClusterCheckNameRequest clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } else { + clusterName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + clusterName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, ClusterCheckNameRequest clusterName, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } else { + clusterName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + clusterName, + accept, + context); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, ClusterCheckNameRequest clusterName) { + return checkNameAvailabilityWithResponseAsync(location, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability(String location, ClusterCheckNameRequest clusterName) { + return checkNameAvailabilityAsync(location, clusterName).block(); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, ClusterCheckNameRequest clusterName, Context context) { + return checkNameAvailabilityWithResponseAsync(location, clusterName, context).block(); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusByResourceSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listSkusByResource( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + 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()))); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusByResourceSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listSkusByResource( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusByResourceAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSkusByResourceSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusByResourceAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listSkusByResourceSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkusByResource(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listSkusByResourceAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available SKUs for a Kusto Cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkusByResource( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listSkusByResourceAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLanguageExtensionsSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listLanguageExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + 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()))); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLanguageExtensionsSinglePageAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLanguageExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLanguageExtensionsAsync( + String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listLanguageExtensionsSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLanguageExtensionsAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listLanguageExtensionsSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLanguageExtensions(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listLanguageExtensionsAsync(resourceGroupName, clusterName)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLanguageExtensions( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listLanguageExtensionsAsync(resourceGroupName, clusterName, context)); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> addLanguageExtensionsWithResponseAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (languageExtensionsToAdd == null) { + return Mono + .error( + new IllegalArgumentException("Parameter languageExtensionsToAdd is required and cannot be null.")); + } else { + languageExtensionsToAdd.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .addLanguageExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + languageExtensionsToAdd, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> addLanguageExtensionsWithResponseAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (languageExtensionsToAdd == null) { + return Mono + .error( + new IllegalArgumentException("Parameter languageExtensionsToAdd is required and cannot be null.")); + } else { + languageExtensionsToAdd.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .addLanguageExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + languageExtensionsToAdd, + accept, + context); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginAddLanguageExtensionsAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd) { + Mono>> mono = + addLanguageExtensionsWithResponseAsync(resourceGroupName, clusterName, languageExtensionsToAdd); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginAddLanguageExtensionsAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + addLanguageExtensionsWithResponseAsync(resourceGroupName, clusterName, languageExtensionsToAdd, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginAddLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd) { + return beginAddLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToAdd).getSyncPoller(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginAddLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context) { + return beginAddLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToAdd, context) + .getSyncPoller(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addLanguageExtensionsAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd) { + return beginAddLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToAdd) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addLanguageExtensionsAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context) { + return beginAddLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToAdd, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd) { + addLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToAdd).block(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context) { + addLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToAdd, context).block(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> removeLanguageExtensionsWithResponseAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (languageExtensionsToRemove == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter languageExtensionsToRemove is required and cannot be null.")); + } else { + languageExtensionsToRemove.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .removeLanguageExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + languageExtensionsToRemove, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> removeLanguageExtensionsWithResponseAsync( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (languageExtensionsToRemove == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter languageExtensionsToRemove is required and cannot be null.")); + } else { + languageExtensionsToRemove.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .removeLanguageExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + languageExtensionsToRemove, + accept, + context); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRemoveLanguageExtensionsAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove) { + Mono>> mono = + removeLanguageExtensionsWithResponseAsync(resourceGroupName, clusterName, languageExtensionsToRemove); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRemoveLanguageExtensionsAsync( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + removeLanguageExtensionsWithResponseAsync( + resourceGroupName, clusterName, languageExtensionsToRemove, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRemoveLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove) { + return beginRemoveLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToRemove) + .getSyncPoller(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRemoveLanguageExtensions( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + return beginRemoveLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToRemove, context) + .getSyncPoller(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 removeLanguageExtensionsAsync( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove) { + return beginRemoveLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToRemove) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 removeLanguageExtensionsAsync( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + return beginRemoveLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToRemove, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 removeLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove) { + removeLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToRemove).block(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 removeLanguageExtensions( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + removeLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToRemove, context).block(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.java new file mode 100644 index 000000000000..150184605c9e --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.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.kusto.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.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.ClustersClient; +import com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; +import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; +import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.kusto.models.AzureResourceSku; +import com.azure.resourcemanager.kusto.models.CheckNameResult; +import com.azure.resourcemanager.kusto.models.Cluster; +import com.azure.resourcemanager.kusto.models.ClusterCheckNameRequest; +import com.azure.resourcemanager.kusto.models.Clusters; +import com.azure.resourcemanager.kusto.models.DiagnoseVirtualNetworkResult; +import com.azure.resourcemanager.kusto.models.FollowerDatabaseDefinition; +import com.azure.resourcemanager.kusto.models.LanguageExtension; +import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; +import com.azure.resourcemanager.kusto.models.SkuDescription; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClustersImpl implements Clusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final KustoManager serviceManager; + + public ClustersImpl(ClustersClient innerClient, KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public void stop(String resourceGroupName, String clusterName) { + this.serviceClient().stop(resourceGroupName, clusterName); + } + + public void stop(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().stop(resourceGroupName, clusterName, context); + } + + public void start(String resourceGroupName, String clusterName) { + this.serviceClient().start(resourceGroupName, clusterName); + } + + public void start(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().start(resourceGroupName, clusterName, context); + } + + public PagedIterable listFollowerDatabases( + String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listFollowerDatabases(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new FollowerDatabaseDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listFollowerDatabases( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listFollowerDatabases(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new FollowerDatabaseDefinitionImpl(inner1, this.manager())); + } + + public void detachFollowerDatabases( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + this.serviceClient().detachFollowerDatabases(resourceGroupName, clusterName, followerDatabaseToRemove); + } + + public void detachFollowerDatabases( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + this.serviceClient().detachFollowerDatabases(resourceGroupName, clusterName, followerDatabaseToRemove, context); + } + + public DiagnoseVirtualNetworkResult diagnoseVirtualNetwork(String resourceGroupName, String clusterName) { + DiagnoseVirtualNetworkResultInner inner = + this.serviceClient().diagnoseVirtualNetwork(resourceGroupName, clusterName); + if (inner != null) { + return new DiagnoseVirtualNetworkResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DiagnoseVirtualNetworkResult diagnoseVirtualNetwork( + String resourceGroupName, String clusterName, Context context) { + DiagnoseVirtualNetworkResultInner inner = + this.serviceClient().diagnoseVirtualNetwork(resourceGroupName, clusterName, context); + if (inner != null) { + return new DiagnoseVirtualNetworkResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listSkus() { + PagedIterable inner = this.serviceClient().listSkus(); + return inner.mapPage(inner1 -> new SkuDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listSkus(Context context) { + PagedIterable inner = this.serviceClient().listSkus(context); + return inner.mapPage(inner1 -> new SkuDescriptionImpl(inner1, this.manager())); + } + + public CheckNameResult checkNameAvailability(String location, ClusterCheckNameRequest clusterName) { + CheckNameResultInner inner = this.serviceClient().checkNameAvailability(location, clusterName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String location, ClusterCheckNameRequest clusterName, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listSkusByResource(String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listSkusByResource(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new AzureResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable listSkusByResource( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listSkusByResource(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new AzureResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable listLanguageExtensions(String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listLanguageExtensions(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new LanguageExtensionImpl(inner1, this.manager())); + } + + public PagedIterable listLanguageExtensions( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listLanguageExtensions(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new LanguageExtensionImpl(inner1, this.manager())); + } + + public void addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd) { + this.serviceClient().addLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToAdd); + } + + public void addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context) { + this.serviceClient().addLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToAdd, context); + } + + public void removeLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove) { + this.serviceClient().removeLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToRemove); + } + + public void removeLanguageExtensions( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + this + .serviceClient() + .removeLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToRemove, context); + } + + public Cluster 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private KustoManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionImpl.java new file mode 100644 index 000000000000..480e8b65eeb0 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.kusto.models.DataConnection; + +public final class DataConnectionImpl implements DataConnection { + private DataConnectionInner innerObject; + + private final KustoManager serviceManager; + + DataConnectionImpl(DataConnectionInner innerObject, KustoManager 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 DataConnectionInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationImpl.java new file mode 100644 index 000000000000..624271ff9fd1 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.kusto.models.DataConnection; +import com.azure.resourcemanager.kusto.models.DataConnectionValidation; + +public final class DataConnectionValidationImpl implements DataConnectionValidation { + private DataConnectionValidationInner innerObject; + + private final KustoManager serviceManager; + + DataConnectionValidationImpl(DataConnectionValidationInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String dataConnectionName() { + return this.innerModel().dataConnectionName(); + } + + public DataConnection properties() { + DataConnectionInner inner = this.innerModel().properties(); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnectionValidationInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationListResultImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationListResultImpl.java new file mode 100644 index 000000000000..8d0c20844a8f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionValidationListResultImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.kusto.models.DataConnectionValidationListResult; +import com.azure.resourcemanager.kusto.models.DataConnectionValidationResult; +import java.util.Collections; +import java.util.List; + +public final class DataConnectionValidationListResultImpl implements DataConnectionValidationListResult { + private DataConnectionValidationListResultInner innerObject; + + private final KustoManager serviceManager; + + DataConnectionValidationListResultImpl( + DataConnectionValidationListResultInner innerObject, KustoManager 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 DataConnectionValidationListResultInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsClientImpl.java new file mode 100644 index 000000000000..2869f30c5d4f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsClientImpl.java @@ -0,0 +1,2070 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.DataConnectionsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.kusto.models.DataConnectionCheckNameRequest; +import com.azure.resourcemanager.kusto.models.DataConnectionListResult; +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 DataConnectionsClient. */ +public final class DataConnectionsClientImpl implements DataConnectionsClient { + private final ClientLogger logger = new ClientLogger(DataConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataConnectionsService service; + + /** The service client containing this operation class. */ + private final KustoManagementClientImpl client; + + /** + * Initializes an instance of DataConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectionsClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy.create(DataConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientDataConnections to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface DataConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/dataConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabase( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/dataConnectionValidation") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> dataConnectionValidation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DataConnectionValidationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DataConnectionCheckNameRequest dataConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseSinglePageAsync( + String resourceGroupName, String clusterName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .listByDatabase( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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()))); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseSinglePageAsync( + String resourceGroupName, String clusterName, String databaseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .listByDatabase( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAsync( + String resourceGroupName, String clusterName, String databaseName) { + return new PagedFlux<>(() -> listByDatabaseSinglePageAsync(resourceGroupName, clusterName, databaseName)); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAsync( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return new PagedFlux<>( + () -> listByDatabaseSinglePageAsync(resourceGroupName, clusterName, databaseName, context)); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabase( + String resourceGroupName, String clusterName, String databaseName) { + return new PagedIterable<>(listByDatabaseAsync(resourceGroupName, clusterName, databaseName)); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabase( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return new PagedIterable<>(listByDatabaseAsync(resourceGroupName, clusterName, databaseName, context)); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> dataConnectionValidationWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, DataConnectionValidationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .dataConnectionValidation( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> dataConnectionValidationWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .dataConnectionValidation( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionValidationListResultInner> + beginDataConnectionValidationAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters) { + Mono>> mono = + dataConnectionValidationWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionValidationListResultInner.class, + DataConnectionValidationListResultInner.class, + Context.NONE); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionValidationListResultInner> + beginDataConnectionValidationAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + dataConnectionValidationWithResponseAsync( + resourceGroupName, clusterName, databaseName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionValidationListResultInner.class, + DataConnectionValidationListResultInner.class, + context); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters) { + return beginDataConnectionValidationAsync(resourceGroupName, clusterName, databaseName, parameters) + .getSyncPoller(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + return beginDataConnectionValidationAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .getSyncPoller(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono dataConnectionValidationAsync( + String resourceGroupName, String clusterName, String databaseName, DataConnectionValidationInner parameters) { + return beginDataConnectionValidationAsync(resourceGroupName, clusterName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono dataConnectionValidationAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + return beginDataConnectionValidationAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, String clusterName, String databaseName, DataConnectionValidationInner parameters) { + return dataConnectionValidationAsync(resourceGroupName, clusterName, databaseName, parameters).block(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + return dataConnectionValidationAsync(resourceGroupName, clusterName, databaseName, parameters, context).block(); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } else { + dataConnectionName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + dataConnectionName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } else { + dataConnectionName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + dataConnectionName, + accept, + context); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + return checkNameAvailabilityAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).block(); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context) { + return checkNameAvailabilityWithResponseAsync( + resourceGroupName, clusterName, databaseName, dataConnectionName, context) + .block(); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner get( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).block(); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, context).block(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, databaseName, dataConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionInner.class, + DataConnectionInner.class, + Context.NONE); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataConnectionInner.class, DataConnectionInner.class, context); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + .block(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context) + .block(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionInner.class, + DataConnectionInner.class, + Context.NONE); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataConnectionInner.class, DataConnectionInner.class, context); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return updateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).block(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return updateAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context) + .block(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + dataConnectionName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).getSyncPoller(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + deleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).block(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + deleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, context).block(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsImpl.java new file mode 100644 index 000000000000..15d6b180da3b --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DataConnectionsImpl.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.kusto.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.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.DataConnectionsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.kusto.models.CheckNameResult; +import com.azure.resourcemanager.kusto.models.DataConnection; +import com.azure.resourcemanager.kusto.models.DataConnectionCheckNameRequest; +import com.azure.resourcemanager.kusto.models.DataConnectionValidationListResult; +import com.azure.resourcemanager.kusto.models.DataConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataConnectionsImpl implements DataConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionsImpl.class); + + private final DataConnectionsClient innerClient; + + private final KustoManager serviceManager; + + public DataConnectionsImpl(DataConnectionsClient innerClient, KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDatabase( + String resourceGroupName, String clusterName, String databaseName) { + PagedIterable inner = + this.serviceClient().listByDatabase(resourceGroupName, clusterName, databaseName); + return inner.mapPage(inner1 -> new DataConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByDatabase( + String resourceGroupName, String clusterName, String databaseName, Context context) { + PagedIterable inner = + this.serviceClient().listByDatabase(resourceGroupName, clusterName, databaseName, context); + return inner.mapPage(inner1 -> new DataConnectionImpl(inner1, this.manager())); + } + + public DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, String clusterName, String databaseName, DataConnectionValidationInner parameters) { + DataConnectionValidationListResultInner inner = + this.serviceClient().dataConnectionValidation(resourceGroupName, clusterName, databaseName, parameters); + if (inner != null) { + return new DataConnectionValidationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + DataConnectionValidationListResultInner inner = + this + .serviceClient() + .dataConnectionValidation(resourceGroupName, clusterName, databaseName, parameters, context); + if (inner != null) { + return new DataConnectionValidationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public CheckNameResult checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + CheckNameResultInner inner = + this + .serviceClient() + .checkNameAvailability(resourceGroupName, clusterName, databaseName, dataConnectionName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse( + resourceGroupName, clusterName, databaseName, dataConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataConnection get( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + DataConnectionInner inner = + this.serviceClient().get(resourceGroupName, clusterName, databaseName, dataConnectionName); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, databaseName, dataConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataConnection createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + DataConnectionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnection createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + DataConnectionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnection update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + DataConnectionInner inner = + this.serviceClient().update(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnection update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + DataConnectionInner inner = + this + .serviceClient() + .update(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, context); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + this.serviceClient().delete(resourceGroupName, clusterName, databaseName, dataConnectionName); + } + + public void delete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, databaseName, dataConnectionName, context); + } + + private DataConnectionsClient serviceClient() { + return this.innerClient; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabaseImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabaseImpl.java new file mode 100644 index 000000000000..76c9ac8d32ad --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabaseImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; +import com.azure.resourcemanager.kusto.models.Database; + +public final class DatabaseImpl implements Database { + private DatabaseInner innerObject; + + private final KustoManager serviceManager; + + DatabaseImpl(DatabaseInner innerObject, KustoManager 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 DatabaseInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentImpl.java new file mode 100644 index 000000000000..3365536b8536 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignment; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; +import com.azure.resourcemanager.kusto.models.PrincipalType; +import com.azure.resourcemanager.kusto.models.ProvisioningState; + +public final class DatabasePrincipalAssignmentImpl + implements DatabasePrincipalAssignment, DatabasePrincipalAssignment.Definition, DatabasePrincipalAssignment.Update { + private DatabasePrincipalAssignmentInner innerObject; + + private final KustoManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public DatabasePrincipalRole role() { + return this.innerModel().role(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String tenantName() { + return this.innerModel().tenantName(); + } + + public String principalName() { + return this.innerModel().principalName(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DatabasePrincipalAssignmentInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String databaseName; + + private String principalAssignmentName; + + public DatabasePrincipalAssignmentImpl withExistingDatabase( + String resourceGroupName, String clusterName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.databaseName = databaseName; + return this; + } + + public DatabasePrincipalAssignment create() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.innerModel(), + Context.NONE); + return this; + } + + public DatabasePrincipalAssignment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + resourceGroupName, clusterName, databaseName, principalAssignmentName, this.innerModel(), context); + return this; + } + + DatabasePrincipalAssignmentImpl(String name, KustoManager serviceManager) { + this.innerObject = new DatabasePrincipalAssignmentInner(); + this.serviceManager = serviceManager; + this.principalAssignmentName = name; + } + + public DatabasePrincipalAssignmentImpl update() { + return this; + } + + public DatabasePrincipalAssignment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.innerModel(), + Context.NONE); + return this; + } + + public DatabasePrincipalAssignment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + resourceGroupName, clusterName, databaseName, principalAssignmentName, this.innerModel(), context); + return this; + } + + DatabasePrincipalAssignmentImpl(DatabasePrincipalAssignmentInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.databaseName = Utils.getValueFromIdByName(innerObject.id(), "databases"); + this.principalAssignmentName = Utils.getValueFromIdByName(innerObject.id(), "principalAssignments"); + } + + public DatabasePrincipalAssignment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .getWithResponse(resourceGroupName, clusterName, databaseName, principalAssignmentName, Context.NONE) + .getValue(); + return this; + } + + public DatabasePrincipalAssignment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .getWithResponse(resourceGroupName, clusterName, databaseName, principalAssignmentName, context) + .getValue(); + return this; + } + + public DatabasePrincipalAssignmentImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public DatabasePrincipalAssignmentImpl withRole(DatabasePrincipalRole role) { + this.innerModel().withRole(role); + return this; + } + + public DatabasePrincipalAssignmentImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public DatabasePrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.innerModel().withPrincipalType(principalType); + return this; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsClientImpl.java new file mode 100644 index 000000000000..597959ce08af --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsClientImpl.java @@ -0,0 +1,1407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.DatabasePrincipalAssignmentsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignmentListResult; +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 DatabasePrincipalAssignmentsClient. */ +public final class DatabasePrincipalAssignmentsClientImpl implements DatabasePrincipalAssignmentsClient { + private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DatabasePrincipalAssignmentsService service; + + /** The service client containing this operation class. */ + private final KustoManagementClientImpl client; + + /** + * Initializes an instance of DatabasePrincipalAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabasePrincipalAssignmentsClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy + .create( + DatabasePrincipalAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientDatabasePrincipalAssignments to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface DatabasePrincipalAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabasePrincipalAssignmentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/principalAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + principalAssignmentName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + principalAssignmentName, + accept, + context); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityWithResponseAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName) + .block(); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + return checkNameAvailabilityWithResponseAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, context) + .block(); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalAssignmentInner get( + String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return getAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).block(); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, context) + .block(); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName 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.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName 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.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabasePrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabasePrincipalAssignmentInner.class, + DatabasePrincipalAssignmentInner.class, + Context.NONE); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabasePrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabasePrincipalAssignmentInner.class, + DatabasePrincipalAssignmentInner.class, + context); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabasePrincipalAssignmentInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters) + .getSyncPoller(); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabasePrincipalAssignmentInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters) + .block(); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalAssignmentInner createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters, context) + .block(); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, String principalAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, + String databaseName, + String principalAssignmentName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + principalAssignmentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, String principalAssignmentName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, + String databaseName, + String principalAssignmentName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, String principalAssignmentName) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).getSyncPoller(); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, + String databaseName, + String principalAssignmentName, + Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, context) + .getSyncPoller(); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, String principalAssignmentName) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, + String databaseName, + String principalAssignmentName, + Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String databaseName, String principalAssignmentName) { + deleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).block(); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, + String databaseName, + String principalAssignmentName, + Context context) { + deleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, context).block(); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + 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()))); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, String databaseName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, String databaseName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, databaseName)); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, databaseName, context)); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterName, String databaseName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, databaseName)); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, databaseName, context)); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsImpl.java new file mode 100644 index 000000000000..55c5c04c735c --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalAssignmentsImpl.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.DatabasePrincipalAssignmentsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.kusto.models.CheckNameResult; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignment; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DatabasePrincipalAssignmentsImpl implements DatabasePrincipalAssignments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentsImpl.class); + + private final DatabasePrincipalAssignmentsClient innerClient; + + private final KustoManager serviceManager; + + public DatabasePrincipalAssignmentsImpl( + DatabasePrincipalAssignmentsClient innerClient, KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + CheckNameResultInner inner = + this + .serviceClient() + .checkNameAvailability(resourceGroupName, clusterName, databaseName, principalAssignmentName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse( + resourceGroupName, clusterName, databaseName, principalAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabasePrincipalAssignment get( + String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + DatabasePrincipalAssignmentInner inner = + this.serviceClient().get(resourceGroupName, clusterName, databaseName, principalAssignmentName); + if (inner != null) { + return new DatabasePrincipalAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, databaseName, principalAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabasePrincipalAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + this.serviceClient().delete(resourceGroupName, clusterName, databaseName, principalAssignmentName); + } + + public void delete( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, databaseName, principalAssignmentName, context); + } + + public PagedIterable list( + String resourceGroupName, String clusterName, String databaseName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, databaseName); + return inner.mapPage(inner1 -> new DatabasePrincipalAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterName, String databaseName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, databaseName, context); + return inner.mapPage(inner1 -> new DatabasePrincipalAssignmentImpl(inner1, this.manager())); + } + + public DatabasePrincipalAssignment 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + return this + .getWithResponse(resourceGroupName, clusterName, databaseName, principalAssignmentName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, databaseName, principalAssignmentName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + this.delete(resourceGroupName, clusterName, databaseName, principalAssignmentName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + id))); + } + this.delete(resourceGroupName, clusterName, databaseName, principalAssignmentName, context); + } + + private DatabasePrincipalAssignmentsClient serviceClient() { + return this.innerClient; + } + + private KustoManager manager() { + return this.serviceManager; + } + + public DatabasePrincipalAssignmentImpl define(String name) { + return new DatabasePrincipalAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalImpl.java new file mode 100644 index 000000000000..1f30837f5ec7 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; +import com.azure.resourcemanager.kusto.models.DatabasePrincipal; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalRole; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalType; + +public final class DatabasePrincipalImpl implements DatabasePrincipal { + private DatabasePrincipalInner innerObject; + + private final KustoManager serviceManager; + + DatabasePrincipalImpl(DatabasePrincipalInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public DatabasePrincipalRole role() { + return this.innerModel().role(); + } + + public String name() { + return this.innerModel().name(); + } + + public DatabasePrincipalType type() { + return this.innerModel().type(); + } + + public String fqn() { + return this.innerModel().fqn(); + } + + public String email() { + return this.innerModel().email(); + } + + public String appId() { + return this.innerModel().appId(); + } + + public String tenantName() { + return this.innerModel().tenantName(); + } + + public DatabasePrincipalInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalListResultImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalListResultImpl.java new file mode 100644 index 000000000000..f0f95d5ed0f5 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasePrincipalListResultImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalListResultInner; +import com.azure.resourcemanager.kusto.models.DatabasePrincipal; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class DatabasePrincipalListResultImpl implements DatabasePrincipalListResult { + private DatabasePrincipalListResultInner innerObject; + + private final KustoManager serviceManager; + + DatabasePrincipalListResultImpl(DatabasePrincipalListResultInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new DatabasePrincipalImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public DatabasePrincipalListResultInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java new file mode 100644 index 000000000000..625c9557e04b --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java @@ -0,0 +1,2125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.DatabasesClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalListResultInner; +import com.azure.resourcemanager.kusto.models.CheckNameRequest; +import com.azure.resourcemanager.kusto.models.DatabaseListResult; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalListRequest; +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 DatabasesClient. */ +public final class DatabasesClientImpl implements DatabasesClient { + private final ClientLogger logger = new ClientLogger(DatabasesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DatabasesService service; + + /** The service client containing this operation class. */ + private final KustoManagementClientImpl client; + + /** + * Initializes an instance of DatabasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabasesClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy.create(DatabasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientDatabases to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface DatabasesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameRequest resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/listPrincipals") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPrincipals( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/addPrincipals") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> addPrincipals( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabasePrincipalListRequest databasePrincipalsToAdd, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/databases/{databaseName}/removePrincipals") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> removePrincipals( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabasePrincipalListRequest databasePrincipalsToRemove, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String clusterName, CheckNameRequest resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceName, + accept, + context); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityAsync(resourceGroupName, clusterName, resourceName).block(); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String clusterName, CheckNameRequest resourceName, Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, resourceName, context).block(); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listByCluster( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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()))); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required 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 + .listByCluster( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String databaseName) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner get(String resourceGroupName, String clusterName, String databaseName) { + return getAsync(resourceGroupName, clusterName, databaseName).block(); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName, context).block(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, context); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, databaseName, parameters).block(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context).block(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, context); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner update( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return updateAsync(resourceGroupName, clusterName, databaseName, parameters).block(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner update( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + return updateAsync(resourceGroupName, clusterName, databaseName, parameters, context).block(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, databaseName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, databaseName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName).getSyncPoller(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, context).getSyncPoller(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 clusterName, String databaseName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String databaseName) { + deleteAsync(resourceGroupName, clusterName, databaseName).block(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, String databaseName, Context context) { + deleteAsync(resourceGroupName, clusterName, databaseName, context).block(); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrincipalsSinglePageAsync( + String resourceGroupName, String clusterName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .listPrincipals( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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()))); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrincipalsSinglePageAsync( + String resourceGroupName, String clusterName, String databaseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 + .listPrincipals( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrincipalsAsync( + String resourceGroupName, String clusterName, String databaseName) { + return new PagedFlux<>(() -> listPrincipalsSinglePageAsync(resourceGroupName, clusterName, databaseName)); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrincipalsAsync( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return new PagedFlux<>( + () -> listPrincipalsSinglePageAsync(resourceGroupName, clusterName, databaseName, context)); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrincipals( + String resourceGroupName, String clusterName, String databaseName) { + return new PagedIterable<>(listPrincipalsAsync(resourceGroupName, clusterName, databaseName)); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrincipals( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return new PagedIterable<>(listPrincipalsAsync(resourceGroupName, clusterName, databaseName, context)); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addPrincipalsWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (databasePrincipalsToAdd == null) { + return Mono + .error( + new IllegalArgumentException("Parameter databasePrincipalsToAdd is required and cannot be null.")); + } else { + databasePrincipalsToAdd.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .addPrincipals( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + databasePrincipalsToAdd, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addPrincipalsWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (databasePrincipalsToAdd == null) { + return Mono + .error( + new IllegalArgumentException("Parameter databasePrincipalsToAdd is required and cannot be null.")); + } else { + databasePrincipalsToAdd.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .addPrincipals( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + databasePrincipalsToAdd, + accept, + context); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addPrincipalsAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd) { + return addPrincipalsWithResponseAsync(resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalListResultInner addPrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd) { + return addPrincipalsAsync(resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd).block(); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addPrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd, + Context context) { + return addPrincipalsWithResponseAsync( + resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd, context) + .block(); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> removePrincipalsWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (databasePrincipalsToRemove == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter databasePrincipalsToRemove is required and cannot be null.")); + } else { + databasePrincipalsToRemove.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .removePrincipals( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + databasePrincipalsToRemove, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> removePrincipalsWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (databasePrincipalsToRemove == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter databasePrincipalsToRemove is required and cannot be null.")); + } else { + databasePrincipalsToRemove.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .removePrincipals( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + databasePrincipalsToRemove, + accept, + context); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removePrincipalsAsync( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove) { + return removePrincipalsWithResponseAsync( + resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalListResultInner removePrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove) { + return removePrincipalsAsync(resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove).block(); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response removePrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove, + Context context) { + return removePrincipalsWithResponseAsync( + resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove, context) + .block(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesImpl.java new file mode 100644 index 000000000000..b961c2ace1b6 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.DatabasesClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalListResultInner; +import com.azure.resourcemanager.kusto.models.CheckNameRequest; +import com.azure.resourcemanager.kusto.models.CheckNameResult; +import com.azure.resourcemanager.kusto.models.Database; +import com.azure.resourcemanager.kusto.models.DatabasePrincipal; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalListRequest; +import com.azure.resourcemanager.kusto.models.DatabasePrincipalListResult; +import com.azure.resourcemanager.kusto.models.Databases; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DatabasesImpl implements Databases { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasesImpl.class); + + private final DatabasesClient innerClient; + + private final KustoManager serviceManager; + + public DatabasesImpl(DatabasesClient innerClient, KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + CheckNameResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, clusterName, resourceName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String clusterName, CheckNameRequest resourceName, Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, clusterName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new DatabaseImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new DatabaseImpl(inner1, this.manager())); + } + + public Database get(String resourceGroupName, String clusterName, String databaseName) { + DatabaseInner inner = this.serviceClient().get(resourceGroupName, clusterName, databaseName); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, databaseName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabaseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Database createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + DatabaseInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, clusterName, databaseName, parameters); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Database createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + DatabaseInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, clusterName, databaseName, parameters, context); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Database update( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + DatabaseInner inner = this.serviceClient().update(resourceGroupName, clusterName, databaseName, parameters); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Database update( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { + DatabaseInner inner = + this.serviceClient().update(resourceGroupName, clusterName, databaseName, parameters, context); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String databaseName) { + this.serviceClient().delete(resourceGroupName, clusterName, databaseName); + } + + public void delete(String resourceGroupName, String clusterName, String databaseName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, databaseName, context); + } + + public PagedIterable listPrincipals( + String resourceGroupName, String clusterName, String databaseName) { + PagedIterable inner = + this.serviceClient().listPrincipals(resourceGroupName, clusterName, databaseName); + return inner.mapPage(inner1 -> new DatabasePrincipalImpl(inner1, this.manager())); + } + + public PagedIterable listPrincipals( + String resourceGroupName, String clusterName, String databaseName, Context context) { + PagedIterable inner = + this.serviceClient().listPrincipals(resourceGroupName, clusterName, databaseName, context); + return inner.mapPage(inner1 -> new DatabasePrincipalImpl(inner1, this.manager())); + } + + public DatabasePrincipalListResult addPrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd) { + DatabasePrincipalListResultInner inner = + this.serviceClient().addPrincipals(resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd); + if (inner != null) { + return new DatabasePrincipalListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response addPrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd, + Context context) { + Response inner = + this + .serviceClient() + .addPrincipalsWithResponse( + resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabasePrincipalListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabasePrincipalListResult removePrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove) { + DatabasePrincipalListResultInner inner = + this + .serviceClient() + .removePrincipals(resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove); + if (inner != null) { + return new DatabasePrincipalListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response removePrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove, + Context context) { + Response inner = + this + .serviceClient() + .removePrincipalsWithResponse( + resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabasePrincipalListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DatabasesClient serviceClient() { + return this.innerClient; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DiagnoseVirtualNetworkResultImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DiagnoseVirtualNetworkResultImpl.java new file mode 100644 index 000000000000..4891224b7a8b --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DiagnoseVirtualNetworkResultImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; +import com.azure.resourcemanager.kusto.models.DiagnoseVirtualNetworkResult; +import java.util.Collections; +import java.util.List; + +public final class DiagnoseVirtualNetworkResultImpl implements DiagnoseVirtualNetworkResult { + private DiagnoseVirtualNetworkResultInner innerObject; + + private final KustoManager serviceManager; + + DiagnoseVirtualNetworkResultImpl(DiagnoseVirtualNetworkResultInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List findings() { + List inner = this.innerModel().findings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DiagnoseVirtualNetworkResultInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/FollowerDatabaseDefinitionImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/FollowerDatabaseDefinitionImpl.java new file mode 100644 index 000000000000..e70e2b26dbae --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/FollowerDatabaseDefinitionImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.kusto.models.FollowerDatabaseDefinition; + +public final class FollowerDatabaseDefinitionImpl implements FollowerDatabaseDefinition { + private FollowerDatabaseDefinitionInner innerObject; + + private final KustoManager serviceManager; + + FollowerDatabaseDefinitionImpl(FollowerDatabaseDefinitionInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String clusterResourceId() { + return this.innerModel().clusterResourceId(); + } + + public String attachedDatabaseConfigurationName() { + return this.innerModel().attachedDatabaseConfigurationName(); + } + + public String databaseName() { + return this.innerModel().databaseName(); + } + + public FollowerDatabaseDefinitionInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientBuilder.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientBuilder.java new file mode 100644 index 000000000000..4f125f56bacb --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 KustoManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {KustoManagementClientImpl.class}) +public final class KustoManagementClientBuilder { + /* + * Gets subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the KustoManagementClientBuilder. + */ + public KustoManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the KustoManagementClientBuilder. + */ + public KustoManagementClientBuilder 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 KustoManagementClientBuilder. + */ + public KustoManagementClientBuilder 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 KustoManagementClientBuilder. + */ + public KustoManagementClientBuilder 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 KustoManagementClientBuilder. + */ + public KustoManagementClientBuilder 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 KustoManagementClientBuilder. + */ + public KustoManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of KustoManagementClientImpl with the provided parameters. + * + * @return an instance of KustoManagementClientImpl. + */ + public KustoManagementClientImpl 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(); + } + KustoManagementClientImpl client = + new KustoManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java new file mode 100644 index 000000000000..cf1e8404ad1e --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.AttachedDatabaseConfigurationsClient; +import com.azure.resourcemanager.kusto.fluent.ClusterPrincipalAssignmentsClient; +import com.azure.resourcemanager.kusto.fluent.ClustersClient; +import com.azure.resourcemanager.kusto.fluent.DataConnectionsClient; +import com.azure.resourcemanager.kusto.fluent.DatabasePrincipalAssignmentsClient; +import com.azure.resourcemanager.kusto.fluent.DatabasesClient; +import com.azure.resourcemanager.kusto.fluent.KustoManagementClient; +import com.azure.resourcemanager.kusto.fluent.OperationsClient; +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 KustoManagementClientImpl type. */ +@ServiceClient(builder = KustoManagementClientBuilder.class) +public final class KustoManagementClientImpl implements KustoManagementClient { + private final ClientLogger logger = new ClientLogger(KustoManagementClientImpl.class); + + /** + * Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @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 ClustersClient object to access its operations. */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** The ClusterPrincipalAssignmentsClient object to access its operations. */ + private final ClusterPrincipalAssignmentsClient clusterPrincipalAssignments; + + /** + * Gets the ClusterPrincipalAssignmentsClient object to access its operations. + * + * @return the ClusterPrincipalAssignmentsClient object. + */ + public ClusterPrincipalAssignmentsClient getClusterPrincipalAssignments() { + return this.clusterPrincipalAssignments; + } + + /** The DatabasesClient object to access its operations. */ + private final DatabasesClient databases; + + /** + * Gets the DatabasesClient object to access its operations. + * + * @return the DatabasesClient object. + */ + public DatabasesClient getDatabases() { + return this.databases; + } + + /** The DatabasePrincipalAssignmentsClient object to access its operations. */ + private final DatabasePrincipalAssignmentsClient databasePrincipalAssignments; + + /** + * Gets the DatabasePrincipalAssignmentsClient object to access its operations. + * + * @return the DatabasePrincipalAssignmentsClient object. + */ + public DatabasePrincipalAssignmentsClient getDatabasePrincipalAssignments() { + return this.databasePrincipalAssignments; + } + + /** The AttachedDatabaseConfigurationsClient object to access its operations. */ + private final AttachedDatabaseConfigurationsClient attachedDatabaseConfigurations; + + /** + * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * + * @return the AttachedDatabaseConfigurationsClient object. + */ + public AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations() { + return this.attachedDatabaseConfigurations; + } + + /** The DataConnectionsClient object to access its operations. */ + private final DataConnectionsClient dataConnections; + + /** + * Gets the DataConnectionsClient object to access its operations. + * + * @return the DataConnectionsClient object. + */ + public DataConnectionsClient getDataConnections() { + return this.dataConnections; + } + + /** 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; + } + + /** + * Initializes an instance of KustoManagementClient 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 Gets subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + KustoManagementClientImpl( + 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-09-18"; + this.clusters = new ClustersClientImpl(this); + this.clusterPrincipalAssignments = new ClusterPrincipalAssignmentsClientImpl(this); + this.databases = new DatabasesClientImpl(this); + this.databasePrincipalAssignments = new DatabasePrincipalAssignmentsClientImpl(this); + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsClientImpl(this); + this.dataConnections = new DataConnectionsClientImpl(this); + this.operations = new OperationsClientImpl(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 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.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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/LanguageExtensionImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/LanguageExtensionImpl.java new file mode 100644 index 000000000000..31a79066a63a --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/LanguageExtensionImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.kusto.models.LanguageExtension; +import com.azure.resourcemanager.kusto.models.LanguageExtensionName; + +public final class LanguageExtensionImpl implements LanguageExtension { + private LanguageExtensionInner innerObject; + + private final KustoManager serviceManager; + + LanguageExtensionImpl(LanguageExtensionInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public LanguageExtensionName languageExtensionName() { + return this.innerModel().languageExtensionName(); + } + + public LanguageExtensionInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationImpl.java new file mode 100644 index 000000000000..42d795a8d158 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.OperationInner; +import com.azure.resourcemanager.kusto.models.Operation; +import com.azure.resourcemanager.kusto.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final KustoManager serviceManager; + + OperationImpl(OperationInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..501c3fd04e83 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsClientImpl.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.kusto.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.kusto.fluent.OperationsClient; +import com.azure.resourcemanager.kusto.fluent.models.OperationInner; +import com.azure.resourcemanager.kusto.models.OperationListResult; +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 KustoManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Kusto/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @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 available operations for the Microsoft.Kusto provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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 available operations for the Microsoft.Kusto provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @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 result of the request to list REST API operations. + */ + @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 result of the request to list REST API operations. + */ + @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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsImpl.java new file mode 100644 index 000000000000..b51bd4a31330 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OperationsImpl.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.kusto.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.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.OperationsClient; +import com.azure.resourcemanager.kusto.fluent.models.OperationInner; +import com.azure.resourcemanager.kusto.models.Operation; +import com.azure.resourcemanager.kusto.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final KustoManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/SkuDescriptionImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/SkuDescriptionImpl.java new file mode 100644 index 000000000000..803eba13c488 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/SkuDescriptionImpl.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.kusto.implementation; + +import com.azure.resourcemanager.kusto.KustoManager; +import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.kusto.models.SkuDescription; +import com.azure.resourcemanager.kusto.models.SkuLocationInfoItem; +import java.util.Collections; +import java.util.List; + +public final class SkuDescriptionImpl implements SkuDescription { + private SkuDescriptionInner innerObject; + + private final KustoManager serviceManager; + + SkuDescriptionImpl(SkuDescriptionInner innerObject, KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuDescriptionInner innerModel() { + return this.innerObject; + } + + private KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/Utils.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/Utils.java new file mode 100644 index 000000000000..457814f522a1 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/Utils.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.kusto.implementation; + +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; + +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; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/package-info.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/package-info.java new file mode 100644 index 000000000000..ee1fea3b244e --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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 KustoManagementClient. The Azure Kusto management API provides a RESTful + * set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables + * you to create, update, and delete clusters and databases. + */ +package com.azure.resourcemanager.kusto.implementation; diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfiguration.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfiguration.java new file mode 100644 index 000000000000..eca433cd458f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfiguration.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.kusto.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of AttachedDatabaseConfiguration. */ +public interface AttachedDatabaseConfiguration { + /** + * 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 provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the databaseName property: The name of the database which you would like to attach, use * if you want to + * follow all current and future databases. + * + * @return the databaseName value. + */ + String databaseName(); + + /** + * Gets the clusterResourceId property: The resource id of the cluster where the databases you would like to attach + * reside. + * + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * Gets the attachedDatabaseNames property: The list of databases from the clusterResourceId which are currently + * attached to the cluster. + * + * @return the attachedDatabaseNames value. + */ + List attachedDatabaseNames(); + + /** + * Gets the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @return the defaultPrincipalsModificationKind value. + */ + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind(); + + /** + * 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.kusto.fluent.models.AttachedDatabaseConfigurationInner object. + * + * @return the inner object. + */ + AttachedDatabaseConfigurationInner innerModel(); + + /** The entirety of the AttachedDatabaseConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AttachedDatabaseConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the AttachedDatabaseConfiguration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the AttachedDatabaseConfiguration 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.WithLocation, + DefinitionStages.WithDatabaseName, + DefinitionStages.WithClusterResourceId, + DefinitionStages.WithDefaultPrincipalsModificationKind { + /** + * Executes the create request. + * + * @return the created resource. + */ + AttachedDatabaseConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AttachedDatabaseConfiguration create(Context context); + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify databaseName. */ + interface WithDatabaseName { + /** + * Specifies the databaseName property: The name of the database which you would like to attach, use * if + * you want to follow all current and future databases.. + * + * @param databaseName The name of the database which you would like to attach, use * if you want to follow + * all current and future databases. + * @return the next definition stage. + */ + WithCreate withDatabaseName(String databaseName); + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify clusterResourceId. */ + interface WithClusterResourceId { + /** + * Specifies the clusterResourceId property: The resource id of the cluster where the databases you would + * like to attach reside.. + * + * @param clusterResourceId The resource id of the cluster where the databases you would like to attach + * reside. + * @return the next definition stage. + */ + WithCreate withClusterResourceId(String clusterResourceId); + } + /** + * The stage of the AttachedDatabaseConfiguration definition allowing to specify + * defaultPrincipalsModificationKind. + */ + interface WithDefaultPrincipalsModificationKind { + /** + * Specifies the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @param defaultPrincipalsModificationKind The default principals modification kind. + * @return the next definition stage. + */ + WithCreate withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind); + } + } + /** + * Begins update for the AttachedDatabaseConfiguration resource. + * + * @return the stage of resource update. + */ + AttachedDatabaseConfiguration.Update update(); + + /** The template for AttachedDatabaseConfiguration update. */ + interface Update + extends UpdateStages.WithDatabaseName, + UpdateStages.WithClusterResourceId, + UpdateStages.WithDefaultPrincipalsModificationKind { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AttachedDatabaseConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AttachedDatabaseConfiguration apply(Context context); + } + /** The AttachedDatabaseConfiguration update stages. */ + interface UpdateStages { + /** The stage of the AttachedDatabaseConfiguration update allowing to specify databaseName. */ + interface WithDatabaseName { + /** + * Specifies the databaseName property: The name of the database which you would like to attach, use * if + * you want to follow all current and future databases.. + * + * @param databaseName The name of the database which you would like to attach, use * if you want to follow + * all current and future databases. + * @return the next definition stage. + */ + Update withDatabaseName(String databaseName); + } + /** The stage of the AttachedDatabaseConfiguration update allowing to specify clusterResourceId. */ + interface WithClusterResourceId { + /** + * Specifies the clusterResourceId property: The resource id of the cluster where the databases you would + * like to attach reside.. + * + * @param clusterResourceId The resource id of the cluster where the databases you would like to attach + * reside. + * @return the next definition stage. + */ + Update withClusterResourceId(String clusterResourceId); + } + /** + * The stage of the AttachedDatabaseConfiguration update allowing to specify defaultPrincipalsModificationKind. + */ + interface WithDefaultPrincipalsModificationKind { + /** + * Specifies the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @param defaultPrincipalsModificationKind The default principals modification kind. + * @return the next definition stage. + */ + Update withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AttachedDatabaseConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AttachedDatabaseConfiguration refresh(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurationListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurationListResult.java new file mode 100644 index 000000000000..5f8836822d7c --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurationListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list attached database configurations operation response. */ +@Fluent +public final class AttachedDatabaseConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationListResult.class); + + /* + * The list of attached database configurations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of attached database configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of attached database configurations. + * + * @param value the value value to set. + * @return the AttachedDatabaseConfigurationListResult object itself. + */ + public AttachedDatabaseConfigurationListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.java new file mode 100644 index 000000000000..5b888e8f2f85 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.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.kusto.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 AttachedDatabaseConfigurations. */ +public interface AttachedDatabaseConfigurations { + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list attached database configurations operation response. + */ + PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context); + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + AttachedDatabaseConfiguration get( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 class representing an attached database configuration. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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. + */ + void delete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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. + */ + void delete( + String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, Context context); + + /** + * Returns an attached database 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 class representing an attached database configuration. + */ + AttachedDatabaseConfiguration getById(String id); + + /** + * Returns an attached database 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 class representing an attached database configuration. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @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 attached database configuration with the given name. + * + * @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 AttachedDatabaseConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new AttachedDatabaseConfiguration definition. + */ + AttachedDatabaseConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureCapacity.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureCapacity.java new file mode 100644 index 000000000000..28f3e982bbf7 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureCapacity.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.kusto.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; + +/** Azure capacity definition. */ +@Fluent +public final class AzureCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureCapacity.class); + + /* + * Scale type. + */ + @JsonProperty(value = "scaleType", required = true) + private AzureScaleType scaleType; + + /* + * Minimum allowed capacity. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * Maximum allowed capacity. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /* + * The default capacity that would be used. + */ + @JsonProperty(value = "default", required = true) + private int defaultProperty; + + /** + * Get the scaleType property: Scale type. + * + * @return the scaleType value. + */ + public AzureScaleType scaleType() { + return this.scaleType; + } + + /** + * Set the scaleType property: Scale type. + * + * @param scaleType the scaleType value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withScaleType(AzureScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Get the minimum property: Minimum allowed capacity. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Minimum allowed capacity. + * + * @param minimum the minimum value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: Maximum allowed capacity. + * + * @return the maximum value. + */ + public int maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Maximum allowed capacity. + * + * @param maximum the maximum value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the defaultProperty property: The default capacity that would be used. + * + * @return the defaultProperty value. + */ + public int defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The default capacity that would be used. + * + * @param defaultProperty the defaultProperty value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withDefaultProperty(int defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scaleType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property scaleType in model AzureCapacity")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureResourceSku.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureResourceSku.java new file mode 100644 index 000000000000..711118154ae9 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureResourceSku.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner; + +/** An immutable client-side representation of AzureResourceSku. */ +public interface AzureResourceSku { + /** + * Gets the resourceType property: Resource Namespace and Type. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the sku property: The SKU details. + * + * @return the sku value. + */ + AzureSku sku(); + + /** + * Gets the capacity property: The number of instances of the cluster. + * + * @return the capacity value. + */ + AzureCapacity capacity(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner object. + * + * @return the inner object. + */ + AzureResourceSkuInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureScaleType.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureScaleType.java new file mode 100644 index 000000000000..33160d73e74b --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureScaleType.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureScaleType. */ +public final class AzureScaleType extends ExpandableStringEnum { + /** Static value automatic for AzureScaleType. */ + public static final AzureScaleType AUTOMATIC = fromString("automatic"); + + /** Static value manual for AzureScaleType. */ + public static final AzureScaleType MANUAL = fromString("manual"); + + /** Static value none for AzureScaleType. */ + public static final AzureScaleType NONE = fromString("none"); + + /** + * Creates or finds a AzureScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureScaleType. + */ + @JsonCreator + public static AzureScaleType fromString(String name) { + return fromString(name, AzureScaleType.class); + } + + /** @return known AzureScaleType values. */ + public static Collection values() { + return values(AzureScaleType.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSku.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSku.java new file mode 100644 index 000000000000..e5f9bf0c7537 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSku.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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; + +/** Azure SKU definition. */ +@Fluent +public final class AzureSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSku.class); + + /* + * SKU name. + */ + @JsonProperty(value = "name", required = true) + private AzureSkuName name; + + /* + * The number of instances of the cluster. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /* + * SKU tier. + */ + @JsonProperty(value = "tier", required = true) + private AzureSkuTier tier; + + /** + * Get the name property: SKU name. + * + * @return the name value. + */ + public AzureSkuName name() { + return this.name; + } + + /** + * Set the name property: SKU name. + * + * @param name the name value to set. + * @return the AzureSku object itself. + */ + public AzureSku withName(AzureSkuName name) { + this.name = name; + return this; + } + + /** + * Get the capacity property: The number of instances of the cluster. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The number of instances of the cluster. + * + * @param capacity the capacity value to set. + * @return the AzureSku object itself. + */ + public AzureSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the tier property: SKU tier. + * + * @return the tier value. + */ + public AzureSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: SKU tier. + * + * @param tier the tier value to set. + * @return the AzureSku object itself. + */ + public AzureSku withTier(AzureSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model AzureSku")); + } + if (tier() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property tier in model AzureSku")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuName.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuName.java new file mode 100644 index 000000000000..bbbf1fcca18f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuName.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureSkuName. */ +public final class AzureSkuName extends ExpandableStringEnum { + /** Static value Standard_DS13_v2+1TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS13_V2_1TB_PS = fromString("Standard_DS13_v2+1TB_PS"); + + /** Static value Standard_DS13_v2+2TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS13_V2_2TB_PS = fromString("Standard_DS13_v2+2TB_PS"); + + /** Static value Standard_DS14_v2+3TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V2_3TB_PS = fromString("Standard_DS14_v2+3TB_PS"); + + /** Static value Standard_DS14_v2+4TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V2_4TB_PS = fromString("Standard_DS14_v2+4TB_PS"); + + /** Static value Standard_D13_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D13_V2 = fromString("Standard_D13_v2"); + + /** Static value Standard_D14_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D14_V2 = fromString("Standard_D14_v2"); + + /** Static value Standard_L8s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L8S = fromString("Standard_L8s"); + + /** Static value Standard_L16s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L16S = fromString("Standard_L16s"); + + /** Static value Standard_D11_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D11_V2 = fromString("Standard_D11_v2"); + + /** Static value Standard_D12_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D12_V2 = fromString("Standard_D12_v2"); + + /** Static value Standard_L4s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L4S = fromString("Standard_L4s"); + + /** Static value Dev(No SLA)_Standard_D11_v2 for AzureSkuName. */ + public static final AzureSkuName DEV_NO_SLA_STANDARD_D11_V2 = fromString("Dev(No SLA)_Standard_D11_v2"); + + /** Static value Standard_E64i_v3 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E64I_V3 = fromString("Standard_E64i_v3"); + + /** Static value Standard_E2a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E2A_V4 = fromString("Standard_E2a_v4"); + + /** Static value Standard_E4a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E4A_V4 = fromString("Standard_E4a_v4"); + + /** Static value Standard_E8a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E8A_V4 = fromString("Standard_E8a_v4"); + + /** Static value Standard_E16a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16A_V4 = fromString("Standard_E16a_v4"); + + /** Static value Standard_E8as_v4+1TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E8AS_V4_1TB_PS = fromString("Standard_E8as_v4+1TB_PS"); + + /** Static value Standard_E8as_v4+2TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E8AS_V4_2TB_PS = fromString("Standard_E8as_v4+2TB_PS"); + + /** Static value Standard_E16as_v4+3TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16AS_V4_3TB_PS = fromString("Standard_E16as_v4+3TB_PS"); + + /** Static value Standard_E16as_v4+4TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16AS_V4_4TB_PS = fromString("Standard_E16as_v4+4TB_PS"); + + /** Static value Dev(No SLA)_Standard_E2a_v4 for AzureSkuName. */ + public static final AzureSkuName DEV_NO_SLA_STANDARD_E2A_V4 = fromString("Dev(No SLA)_Standard_E2a_v4"); + + /** + * Creates or finds a AzureSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureSkuName. + */ + @JsonCreator + public static AzureSkuName fromString(String name) { + return fromString(name, AzureSkuName.class); + } + + /** @return known AzureSkuName values. */ + public static Collection values() { + return values(AzureSkuName.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuTier.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuTier.java new file mode 100644 index 000000000000..405399af41b3 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AzureSkuTier.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureSkuTier. */ +public final class AzureSkuTier extends ExpandableStringEnum { + /** Static value Basic for AzureSkuTier. */ + public static final AzureSkuTier BASIC = fromString("Basic"); + + /** Static value Standard for AzureSkuTier. */ + public static final AzureSkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a AzureSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureSkuTier. + */ + @JsonCreator + public static AzureSkuTier fromString(String name) { + return fromString(name, AzureSkuTier.class); + } + + /** @return known AzureSkuTier values. */ + public static Collection values() { + return values(AzureSkuTier.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/BlobStorageEventType.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/BlobStorageEventType.java new file mode 100644 index 000000000000..b1b612b33c31 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/BlobStorageEventType.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlobStorageEventType. */ +public final class BlobStorageEventType extends ExpandableStringEnum { + /** Static value Microsoft.Storage.BlobCreated for BlobStorageEventType. */ + public static final BlobStorageEventType MICROSOFT_STORAGE_BLOB_CREATED = + fromString("Microsoft.Storage.BlobCreated"); + + /** Static value Microsoft.Storage.BlobRenamed for BlobStorageEventType. */ + public static final BlobStorageEventType MICROSOFT_STORAGE_BLOB_RENAMED = + fromString("Microsoft.Storage.BlobRenamed"); + + /** + * Creates or finds a BlobStorageEventType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobStorageEventType. + */ + @JsonCreator + public static BlobStorageEventType fromString(String name) { + return fromString(name, BlobStorageEventType.class); + } + + /** @return known BlobStorageEventType values. */ + public static Collection values() { + return values(BlobStorageEventType.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameRequest.java new file mode 100644 index 000000000000..ed25c5cfc7cb --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameRequest.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.kusto.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 result returned from a database check name availability request. */ +@Fluent +public final class CheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameRequest.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, for instance Microsoft.Kusto/clusters/databases. + */ + @JsonProperty(value = "type", required = true) + private Type type; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, for instance Microsoft.Kusto/clusters/databases. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of resource, for instance Microsoft.Kusto/clusters/databases. + * + * @param type the type value to set. + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withType(Type type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CheckNameRequest")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model CheckNameRequest")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameResult.java new file mode 100644 index 000000000000..e40efa8af6fb --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/CheckNameResult.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; + +/** An immutable client-side representation of CheckNameResult. */ +public interface CheckNameResult { + /** + * Gets the nameAvailable property: Specifies a Boolean value that indicates if the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the name property: The name that was checked. + * + * @return the name value. + */ + String name(); + + /** + * Gets the message property: Message indicating an unavailable name due to a conflict, or a description of the + * naming rules that are violated. + * + * @return the message value. + */ + String message(); + + /** + * Gets the reason property: Message providing the reason why the given name is invalid. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner object. + * + * @return the inner object. + */ + CheckNameResultInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.java new file mode 100644 index 000000000000..b547f4c0c56e --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.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.kusto.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Cluster. */ +public interface Cluster { + /** + * 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: The SKU of the cluster. + * + * @return the sku value. + */ + AzureSku sku(); + + /** + * Gets the zones property: The availability zones of the cluster. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the identity property: The identity of the cluster, if configured. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the state property: The state of the resource. + * + * @return the state value. + */ + State state(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the uri property: The cluster URI. + * + * @return the uri value. + */ + String uri(); + + /** + * Gets the dataIngestionUri property: The cluster data ingestion URI. + * + * @return the dataIngestionUri value. + */ + String dataIngestionUri(); + + /** + * Gets the stateReason property: The reason for the cluster's current state. + * + * @return the stateReason value. + */ + String stateReason(); + + /** + * Gets the trustedExternalTenants property: The cluster's external tenants. + * + * @return the trustedExternalTenants value. + */ + List trustedExternalTenants(); + + /** + * Gets the optimizedAutoscale property: Optimized auto scale definition. + * + * @return the optimizedAutoscale value. + */ + OptimizedAutoscale optimizedAutoscale(); + + /** + * Gets the enableDiskEncryption property: A boolean value that indicates if the cluster's disks are encrypted. + * + * @return the enableDiskEncryption value. + */ + Boolean enableDiskEncryption(); + + /** + * Gets the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value. + */ + Boolean enableStreamingIngest(); + + /** + * Gets the virtualNetworkConfiguration property: Virtual network definition. + * + * @return the virtualNetworkConfiguration value. + */ + VirtualNetworkConfiguration virtualNetworkConfiguration(); + + /** + * Gets the keyVaultProperties property: KeyVault properties for the cluster encryption. + * + * @return the keyVaultProperties value. + */ + KeyVaultProperties keyVaultProperties(); + + /** + * Gets the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value. + */ + Boolean enablePurge(); + + /** + * Gets the languageExtensions property: List of the cluster's language extensions. + * + * @return the languageExtensions value. + */ + LanguageExtensionsList languageExtensions(); + + /** + * Gets the enableDoubleEncryption property: A boolean value that indicates if double encryption is enabled. + * + * @return the enableDoubleEncryption value. + */ + Boolean enableDoubleEncryption(); + + /** + * Gets the engineType property: The engine type. + * + * @return the engineType value. + */ + EngineType engineType(); + + /** + * 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.kusto.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** The entirety of the Cluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The Cluster definition stages. */ + interface DefinitionStages { + /** The first stage of the Cluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Cluster 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 Cluster definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Cluster definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the cluster.. + * + * @param sku The SKU of the cluster. + * @return the next definition stage. + */ + WithCreate withSku(AzureSku sku); + } + /** + * The stage of the Cluster 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.WithZones, + DefinitionStages.WithIdentity, + DefinitionStages.WithTrustedExternalTenants, + DefinitionStages.WithOptimizedAutoscale, + DefinitionStages.WithEnableDiskEncryption, + DefinitionStages.WithEnableStreamingIngest, + DefinitionStages.WithVirtualNetworkConfiguration, + DefinitionStages.WithKeyVaultProperties, + DefinitionStages.WithEnablePurge, + DefinitionStages.WithEnableDoubleEncryption, + DefinitionStages.WithEngineType { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + /** The stage of the Cluster 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 Cluster definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: The availability zones of the cluster.. + * + * @param zones The availability zones of the cluster. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the Cluster definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the cluster, if configured.. + * + * @param identity The identity of the cluster, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** The stage of the Cluster definition allowing to specify trustedExternalTenants. */ + interface WithTrustedExternalTenants { + /** + * Specifies the trustedExternalTenants property: The cluster's external tenants.. + * + * @param trustedExternalTenants The cluster's external tenants. + * @return the next definition stage. + */ + WithCreate withTrustedExternalTenants(List trustedExternalTenants); + } + /** The stage of the Cluster definition allowing to specify optimizedAutoscale. */ + interface WithOptimizedAutoscale { + /** + * Specifies the optimizedAutoscale property: Optimized auto scale definition.. + * + * @param optimizedAutoscale Optimized auto scale definition. + * @return the next definition stage. + */ + WithCreate withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + /** The stage of the Cluster definition allowing to specify enableDiskEncryption. */ + interface WithEnableDiskEncryption { + /** + * Specifies the enableDiskEncryption property: A boolean value that indicates if the cluster's disks are + * encrypted.. + * + * @param enableDiskEncryption A boolean value that indicates if the cluster's disks are encrypted. + * @return the next definition stage. + */ + WithCreate withEnableDiskEncryption(Boolean enableDiskEncryption); + } + /** The stage of the Cluster definition allowing to specify enableStreamingIngest. */ + interface WithEnableStreamingIngest { + /** + * Specifies the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is + * enabled.. + * + * @param enableStreamingIngest A boolean value that indicates if the streaming ingest is enabled. + * @return the next definition stage. + */ + WithCreate withEnableStreamingIngest(Boolean enableStreamingIngest); + } + /** The stage of the Cluster definition allowing to specify virtualNetworkConfiguration. */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies the virtualNetworkConfiguration property: Virtual network definition.. + * + * @param virtualNetworkConfiguration Virtual network definition. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + /** The stage of the Cluster definition allowing to specify keyVaultProperties. */ + interface WithKeyVaultProperties { + /** + * Specifies the keyVaultProperties property: KeyVault properties for the cluster encryption.. + * + * @param keyVaultProperties KeyVault properties for the cluster encryption. + * @return the next definition stage. + */ + WithCreate withKeyVaultProperties(KeyVaultProperties keyVaultProperties); + } + /** The stage of the Cluster definition allowing to specify enablePurge. */ + interface WithEnablePurge { + /** + * Specifies the enablePurge property: A boolean value that indicates if the purge operations are enabled.. + * + * @param enablePurge A boolean value that indicates if the purge operations are enabled. + * @return the next definition stage. + */ + WithCreate withEnablePurge(Boolean enablePurge); + } + /** The stage of the Cluster definition allowing to specify enableDoubleEncryption. */ + interface WithEnableDoubleEncryption { + /** + * Specifies the enableDoubleEncryption property: A boolean value that indicates if double encryption is + * enabled.. + * + * @param enableDoubleEncryption A boolean value that indicates if double encryption is enabled. + * @return the next definition stage. + */ + WithCreate withEnableDoubleEncryption(Boolean enableDoubleEncryption); + } + /** The stage of the Cluster definition allowing to specify engineType. */ + interface WithEngineType { + /** + * Specifies the engineType property: The engine type. + * + * @param engineType The engine type. + * @return the next definition stage. + */ + WithCreate withEngineType(EngineType engineType); + } + } + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** The template for Cluster update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithTrustedExternalTenants, + UpdateStages.WithOptimizedAutoscale, + UpdateStages.WithEnableDiskEncryption, + UpdateStages.WithEnableStreamingIngest, + UpdateStages.WithVirtualNetworkConfiguration, + UpdateStages.WithKeyVaultProperties, + UpdateStages.WithEnablePurge, + UpdateStages.WithEnableDoubleEncryption, + UpdateStages.WithEngineType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + /** The Cluster update stages. */ + interface UpdateStages { + /** The stage of the Cluster 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 Cluster update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the cluster.. + * + * @param sku The SKU of the cluster. + * @return the next definition stage. + */ + Update withSku(AzureSku sku); + } + /** The stage of the Cluster update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the cluster, if configured.. + * + * @param identity The identity of the cluster, if configured. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + /** The stage of the Cluster update allowing to specify trustedExternalTenants. */ + interface WithTrustedExternalTenants { + /** + * Specifies the trustedExternalTenants property: The cluster's external tenants.. + * + * @param trustedExternalTenants The cluster's external tenants. + * @return the next definition stage. + */ + Update withTrustedExternalTenants(List trustedExternalTenants); + } + /** The stage of the Cluster update allowing to specify optimizedAutoscale. */ + interface WithOptimizedAutoscale { + /** + * Specifies the optimizedAutoscale property: Optimized auto scale definition.. + * + * @param optimizedAutoscale Optimized auto scale definition. + * @return the next definition stage. + */ + Update withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + /** The stage of the Cluster update allowing to specify enableDiskEncryption. */ + interface WithEnableDiskEncryption { + /** + * Specifies the enableDiskEncryption property: A boolean value that indicates if the cluster's disks are + * encrypted.. + * + * @param enableDiskEncryption A boolean value that indicates if the cluster's disks are encrypted. + * @return the next definition stage. + */ + Update withEnableDiskEncryption(Boolean enableDiskEncryption); + } + /** The stage of the Cluster update allowing to specify enableStreamingIngest. */ + interface WithEnableStreamingIngest { + /** + * Specifies the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is + * enabled.. + * + * @param enableStreamingIngest A boolean value that indicates if the streaming ingest is enabled. + * @return the next definition stage. + */ + Update withEnableStreamingIngest(Boolean enableStreamingIngest); + } + /** The stage of the Cluster update allowing to specify virtualNetworkConfiguration. */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies the virtualNetworkConfiguration property: Virtual network definition.. + * + * @param virtualNetworkConfiguration Virtual network definition. + * @return the next definition stage. + */ + Update withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + /** The stage of the Cluster update allowing to specify keyVaultProperties. */ + interface WithKeyVaultProperties { + /** + * Specifies the keyVaultProperties property: KeyVault properties for the cluster encryption.. + * + * @param keyVaultProperties KeyVault properties for the cluster encryption. + * @return the next definition stage. + */ + Update withKeyVaultProperties(KeyVaultProperties keyVaultProperties); + } + /** The stage of the Cluster update allowing to specify enablePurge. */ + interface WithEnablePurge { + /** + * Specifies the enablePurge property: A boolean value that indicates if the purge operations are enabled.. + * + * @param enablePurge A boolean value that indicates if the purge operations are enabled. + * @return the next definition stage. + */ + Update withEnablePurge(Boolean enablePurge); + } + /** The stage of the Cluster update allowing to specify enableDoubleEncryption. */ + interface WithEnableDoubleEncryption { + /** + * Specifies the enableDoubleEncryption property: A boolean value that indicates if double encryption is + * enabled.. + * + * @param enableDoubleEncryption A boolean value that indicates if double encryption is enabled. + * @return the next definition stage. + */ + Update withEnableDoubleEncryption(Boolean enableDoubleEncryption); + } + /** The stage of the Cluster update allowing to specify engineType. */ + interface WithEngineType { + /** + * Specifies the engineType property: The engine type. + * + * @param engineType The engine type. + * @return the next definition stage. + */ + Update withEngineType(EngineType engineType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterCheckNameRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterCheckNameRequest.java new file mode 100644 index 000000000000..fd0734d7cebe --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterCheckNameRequest.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.kusto.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 result returned from a cluster check name availability request. */ +@Fluent +public final class ClusterCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterCheckNameRequest.class); + + /* + * Cluster name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, Microsoft.Kusto/clusters. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of ClusterCheckNameRequest class. */ + public ClusterCheckNameRequest() { + type = "Microsoft.Kusto/clusters"; + } + + /** + * Get the name property: Cluster name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Cluster name. + * + * @param name the name value to set. + * @return the ClusterCheckNameRequest object itself. + */ + public ClusterCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Kusto/clusters. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Kusto/clusters. + * + * @param type the type value to set. + * @return the ClusterCheckNameRequest object itself. + */ + public ClusterCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ClusterCheckNameRequest")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterListResult.java new file mode 100644 index 000000000000..86aa929aaacb --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto clusters operation response. */ +@Fluent +public final class ClusterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterListResult.class); + + /* + * The list of Kusto clusters. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto clusters. + * + * @param value the value value to set. + * @return the ClusterListResult object itself. + */ + public ClusterListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignment.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignment.java new file mode 100644 index 000000000000..d8644c459556 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignment.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; + +/** An immutable client-side representation of ClusterPrincipalAssignment. */ +public interface ClusterPrincipalAssignment { + /** + * 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 principalId property: The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the role property: Cluster principal role. + * + * @return the role value. + */ + ClusterPrincipalRole role(); + + /** + * Gets the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the principalType property: Principal type. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + String tenantName(); + + /** + * Gets the principalName property: The principal name. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner object. + * + * @return the inner object. + */ + ClusterPrincipalAssignmentInner innerModel(); + + /** The entirety of the ClusterPrincipalAssignment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ClusterPrincipalAssignment definition stages. */ + interface DefinitionStages { + /** The first stage of the ClusterPrincipalAssignment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the ClusterPrincipalAssignment 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.WithPrincipalId, + DefinitionStages.WithRole, + DefinitionStages.WithTenantId, + DefinitionStages.WithPrincipalType { + /** + * Executes the create request. + * + * @return the created resource. + */ + ClusterPrincipalAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ClusterPrincipalAssignment create(Context context); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Cluster principal role.. + * + * @param role Cluster principal role. + * @return the next definition stage. + */ + WithCreate withRole(ClusterPrincipalRole role); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + WithCreate withPrincipalType(PrincipalType principalType); + } + } + /** + * Begins update for the ClusterPrincipalAssignment resource. + * + * @return the stage of resource update. + */ + ClusterPrincipalAssignment.Update update(); + + /** The template for ClusterPrincipalAssignment update. */ + interface Update + extends UpdateStages.WithPrincipalId, + UpdateStages.WithRole, + UpdateStages.WithTenantId, + UpdateStages.WithPrincipalType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ClusterPrincipalAssignment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ClusterPrincipalAssignment apply(Context context); + } + /** The ClusterPrincipalAssignment update stages. */ + interface UpdateStages { + /** The stage of the ClusterPrincipalAssignment update allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + Update withPrincipalId(String principalId); + } + /** The stage of the ClusterPrincipalAssignment update allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Cluster principal role.. + * + * @param role Cluster principal role. + * @return the next definition stage. + */ + Update withRole(ClusterPrincipalRole role); + } + /** The stage of the ClusterPrincipalAssignment update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the ClusterPrincipalAssignment update allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + Update withPrincipalType(PrincipalType principalType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ClusterPrincipalAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ClusterPrincipalAssignment refresh(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentCheckNameRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentCheckNameRequest.java new file mode 100644 index 000000000000..9b558a139561 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentCheckNameRequest.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.kusto.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 principal assignment check name availability request. */ +@Fluent +public final class ClusterPrincipalAssignmentCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentCheckNameRequest.class); + + /* + * Principal Assignment resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, Microsoft.Kusto/clusters/principalAssignments. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of ClusterPrincipalAssignmentCheckNameRequest class. */ + public ClusterPrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Kusto/clusters/principalAssignments"; + } + + /** + * Get the name property: Principal Assignment resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Principal Assignment resource name. + * + * @param name the name value to set. + * @return the ClusterPrincipalAssignmentCheckNameRequest object itself. + */ + public ClusterPrincipalAssignmentCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Kusto/clusters/principalAssignments. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Kusto/clusters/principalAssignments. + * + * @param type the type value to set. + * @return the ClusterPrincipalAssignmentCheckNameRequest object itself. + */ + public ClusterPrincipalAssignmentCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ClusterPrincipalAssignmentCheckNameRequest")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentListResult.java new file mode 100644 index 000000000000..edc36b4ecc2f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignmentListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.ClusterPrincipalAssignmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto cluster principal assignments operation response. */ +@Fluent +public final class ClusterPrincipalAssignmentListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentListResult.class); + + /* + * The list of Kusto cluster principal assignments. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto cluster principal assignments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto cluster principal assignments. + * + * @param value the value value to set. + * @return the ClusterPrincipalAssignmentListResult object itself. + */ + public ClusterPrincipalAssignmentListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignments.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignments.java new file mode 100644 index 000000000000..0767f9399fee --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalAssignments.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 ClusterPrincipalAssignments. */ +public interface ClusterPrincipalAssignments { + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + CheckNameResult checkNameAvailability( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + ClusterPrincipalAssignment get(String resourceGroupName, String clusterName, String principalAssignmentName); + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster principalAssignment. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String principalAssignmentName, Context context); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String principalAssignmentName); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String principalAssignmentName, Context context); + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto cluster principal assignments operation response. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Gets a Kusto cluster principalAssignment. + * + * @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 Kusto cluster principalAssignment. + */ + ClusterPrincipalAssignment getById(String id); + + /** + * Gets a Kusto cluster principalAssignment. + * + * @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 Kusto cluster principalAssignment. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @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 Kusto cluster principalAssignment. + * + * @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 ClusterPrincipalAssignment resource. + * + * @param name resource name. + * @return the first stage of the new ClusterPrincipalAssignment definition. + */ + ClusterPrincipalAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalRole.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalRole.java new file mode 100644 index 000000000000..332f6a83c703 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterPrincipalRole.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterPrincipalRole. */ +public final class ClusterPrincipalRole extends ExpandableStringEnum { + /** Static value AllDatabasesAdmin for ClusterPrincipalRole. */ + public static final ClusterPrincipalRole ALL_DATABASES_ADMIN = fromString("AllDatabasesAdmin"); + + /** Static value AllDatabasesViewer for ClusterPrincipalRole. */ + public static final ClusterPrincipalRole ALL_DATABASES_VIEWER = fromString("AllDatabasesViewer"); + + /** + * Creates or finds a ClusterPrincipalRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterPrincipalRole. + */ + @JsonCreator + public static ClusterPrincipalRole fromString(String name) { + return fromString(name, ClusterPrincipalRole.class); + } + + /** @return known ClusterPrincipalRole values. */ + public static Collection values() { + return values(ClusterPrincipalRole.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.java new file mode 100644 index 000000000000..bcd5f3062f45 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.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.kusto.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; +import java.util.List; +import java.util.Map; + +/** Class representing an update to a Kusto cluster. */ +@JsonFlatten +@Fluent +public class ClusterUpdate extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The SKU of the cluster. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /* + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The state of the resource. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The cluster URI. + */ + @JsonProperty(value = "properties.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /* + * The cluster data ingestion URI. + */ + @JsonProperty(value = "properties.dataIngestionUri", access = JsonProperty.Access.WRITE_ONLY) + private String dataIngestionUri; + + /* + * The reason for the cluster's current state. + */ + @JsonProperty(value = "properties.stateReason", access = JsonProperty.Access.WRITE_ONLY) + private String stateReason; + + /* + * The cluster's external tenants. + */ + @JsonProperty(value = "properties.trustedExternalTenants") + private List trustedExternalTenants; + + /* + * Optimized auto scale definition. + */ + @JsonProperty(value = "properties.optimizedAutoscale") + private OptimizedAutoscale optimizedAutoscale; + + /* + * A boolean value that indicates if the cluster's disks are encrypted. + */ + @JsonProperty(value = "properties.enableDiskEncryption") + private Boolean enableDiskEncryption; + + /* + * A boolean value that indicates if the streaming ingest is enabled. + */ + @JsonProperty(value = "properties.enableStreamingIngest") + private Boolean enableStreamingIngest; + + /* + * Virtual network definition. + */ + @JsonProperty(value = "properties.virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /* + * KeyVault properties for the cluster encryption. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /* + * A boolean value that indicates if the purge operations are enabled. + */ + @JsonProperty(value = "properties.enablePurge") + private Boolean enablePurge; + + /* + * List of the cluster's language extensions. + */ + @JsonProperty(value = "properties.languageExtensions", access = JsonProperty.Access.WRITE_ONLY) + private LanguageExtensionsList languageExtensions; + + /* + * A boolean value that indicates if double encryption is enabled. + */ + @JsonProperty(value = "properties.enableDoubleEncryption") + private Boolean enableDoubleEncryption; + + /* + * The engine type + */ + @JsonProperty(value = "properties.engineType") + private EngineType engineType; + + /** + * 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 ClusterUpdate object itself. + */ + public ClusterUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the sku property: The SKU of the cluster. + * + * @return the sku value. + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the cluster. + * + * @param sku the sku value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: The identity of the cluster, if configured. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the cluster, if configured. + * + * @param identity the identity value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the state property: The state of the resource. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the uri property: The cluster URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the dataIngestionUri property: The cluster data ingestion URI. + * + * @return the dataIngestionUri value. + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the stateReason property: The reason for the cluster's current state. + * + * @return the stateReason value. + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the trustedExternalTenants property: The cluster's external tenants. + * + * @return the trustedExternalTenants value. + */ + public List trustedExternalTenants() { + return this.trustedExternalTenants; + } + + /** + * Set the trustedExternalTenants property: The cluster's external tenants. + * + * @param trustedExternalTenants the trustedExternalTenants value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withTrustedExternalTenants(List trustedExternalTenants) { + this.trustedExternalTenants = trustedExternalTenants; + return this; + } + + /** + * Get the optimizedAutoscale property: Optimized auto scale definition. + * + * @return the optimizedAutoscale value. + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set the optimizedAutoscale property: Optimized auto scale definition. + * + * @param optimizedAutoscale the optimizedAutoscale value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + this.optimizedAutoscale = optimizedAutoscale; + return this; + } + + /** + * Get the enableDiskEncryption property: A boolean value that indicates if the cluster's disks are encrypted. + * + * @return the enableDiskEncryption value. + */ + public Boolean enableDiskEncryption() { + return this.enableDiskEncryption; + } + + /** + * Set the enableDiskEncryption property: A boolean value that indicates if the cluster's disks are encrypted. + * + * @param enableDiskEncryption the enableDiskEncryption value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnableDiskEncryption(Boolean enableDiskEncryption) { + this.enableDiskEncryption = enableDiskEncryption; + return this; + } + + /** + * Get the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value. + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @param enableStreamingIngest the enableStreamingIngest value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnableStreamingIngest(Boolean enableStreamingIngest) { + this.enableStreamingIngest = enableStreamingIngest; + return this; + } + + /** + * Get the virtualNetworkConfiguration property: Virtual network definition. + * + * @return the virtualNetworkConfiguration value. + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set the virtualNetworkConfiguration property: Virtual network definition. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get the keyVaultProperties property: KeyVault properties for the cluster encryption. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: KeyVault properties for the cluster encryption. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value. + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @param enablePurge the enablePurge value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnablePurge(Boolean enablePurge) { + this.enablePurge = enablePurge; + return this; + } + + /** + * Get the languageExtensions property: List of the cluster's language extensions. + * + * @return the languageExtensions value. + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Get the enableDoubleEncryption property: A boolean value that indicates if double encryption is enabled. + * + * @return the enableDoubleEncryption value. + */ + public Boolean enableDoubleEncryption() { + return this.enableDoubleEncryption; + } + + /** + * Set the enableDoubleEncryption property: A boolean value that indicates if double encryption is enabled. + * + * @param enableDoubleEncryption the enableDoubleEncryption value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnableDoubleEncryption(Boolean enableDoubleEncryption) { + this.enableDoubleEncryption = enableDoubleEncryption; + return this; + } + + /** + * Get the engineType property: The engine type. + * + * @return the engineType value. + */ + public EngineType engineType() { + return this.engineType; + } + + /** + * Set the engineType property: The engine type. + * + * @param engineType the engineType value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEngineType(EngineType engineType) { + this.engineType = engineType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (trustedExternalTenants() != null) { + trustedExternalTenants().forEach(e -> e.validate()); + } + if (optimizedAutoscale() != null) { + optimizedAutoscale().validate(); + } + if (virtualNetworkConfiguration() != null) { + virtualNetworkConfiguration().validate(); + } + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (languageExtensions() != null) { + languageExtensions().validate(); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java new file mode 100644 index 000000000000..8f1279501c31 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; + +/** Resource collection API of Clusters. */ +public interface Clusters { + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + Cluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, Context context); + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, Context context); + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String clusterName); + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String clusterName, Context context); + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + PagedIterable listFollowerDatabases(String resourceGroupName, String clusterName); + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + PagedIterable listFollowerDatabases( + String resourceGroupName, String clusterName, Context context); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String resourceGroupName, + String clusterName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context); + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + DiagnoseVirtualNetworkResult diagnoseVirtualNetwork(String resourceGroupName, String clusterName); + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + DiagnoseVirtualNetworkResult diagnoseVirtualNetwork(String resourceGroupName, String clusterName, Context context); + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto clusters operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + PagedIterable list(); + + /** + * Lists all Kusto clusters within 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 the list Kusto clusters operation response. + */ + PagedIterable list(Context context); + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + PagedIterable listSkus(); + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the EngagementFabric SKU descriptions. + */ + PagedIterable listSkus(Context context); + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + CheckNameResult checkNameAvailability(String location, ClusterCheckNameRequest clusterName); + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String location, ClusterCheckNameRequest clusterName, Context context); + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 available SKUs for a Kusto Cluster. + */ + PagedIterable listSkusByResource(String resourceGroupName, String clusterName); + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 available SKUs for a Kusto Cluster. + */ + PagedIterable listSkusByResource(String resourceGroupName, String clusterName, Context context); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + PagedIterable listLanguageExtensions(String resourceGroupName, String clusterName); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + PagedIterable listLanguageExtensions( + String resourceGroupName, String clusterName, Context context); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToAdd, Context context); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String resourceGroupName, String clusterName, LanguageExtensionsList languageExtensionsToRemove); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String resourceGroupName, + String clusterName, + LanguageExtensionsList languageExtensionsToRemove, + Context context); + + /** + * Gets a Kusto cluster. + * + * @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 Kusto cluster. + */ + Cluster getById(String id); + + /** + * Gets a Kusto cluster. + * + * @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 Kusto cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Kusto cluster. + * + * @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 Kusto cluster. + * + * @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 Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Compression.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Compression.java new file mode 100644 index 000000000000..1cd8891815d5 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Compression.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Compression. */ +public final class Compression extends ExpandableStringEnum { + /** Static value None for Compression. */ + public static final Compression NONE = fromString("None"); + + /** Static value GZip for Compression. */ + public static final Compression GZIP = fromString("GZip"); + + /** + * Creates or finds a Compression from its string representation. + * + * @param name a name to look for. + * @return the corresponding Compression. + */ + @JsonCreator + public static Compression fromString(String name) { + return fromString(name, Compression.class); + } + + /** @return known Compression values. */ + public static Collection values() { + return values(Compression.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnection.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnection.java new file mode 100644 index 000000000000..76b85eeaa894 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnection.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; + +/** An immutable client-side representation of DataConnection. */ +public interface DataConnection { + /** + * 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 inner com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner object. + * + * @return the inner object. + */ + DataConnectionInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionCheckNameRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionCheckNameRequest.java new file mode 100644 index 000000000000..fa24170e0490 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionCheckNameRequest.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.kusto.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 data connection check name availability request. */ +@Fluent +public final class DataConnectionCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionCheckNameRequest.class); + + /* + * Data Connection name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, + * Microsoft.Kusto/clusters/databases/dataConnections. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of DataConnectionCheckNameRequest class. */ + public DataConnectionCheckNameRequest() { + type = "Microsoft.Kusto/clusters/databases/dataConnections"; + } + + /** + * Get the name property: Data Connection name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Data Connection name. + * + * @param name the name value to set. + * @return the DataConnectionCheckNameRequest object itself. + */ + public DataConnectionCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + * + * @param type the type value to set. + * @return the DataConnectionCheckNameRequest object itself. + */ + public DataConnectionCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model DataConnectionCheckNameRequest")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionKind.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionKind.java new file mode 100644 index 000000000000..c14a9e905124 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionKind.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataConnectionKind. */ +public final class DataConnectionKind extends ExpandableStringEnum { + /** Static value EventHub for DataConnectionKind. */ + public static final DataConnectionKind EVENT_HUB = fromString("EventHub"); + + /** Static value EventGrid for DataConnectionKind. */ + public static final DataConnectionKind EVENT_GRID = fromString("EventGrid"); + + /** Static value IotHub for DataConnectionKind. */ + public static final DataConnectionKind IOT_HUB = fromString("IotHub"); + + /** + * Creates or finds a DataConnectionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectionKind. + */ + @JsonCreator + public static DataConnectionKind fromString(String name) { + return fromString(name, DataConnectionKind.class); + } + + /** @return known DataConnectionKind values. */ + public static Collection values() { + return values(DataConnectionKind.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionListResult.java new file mode 100644 index 000000000000..4d5481061b4d --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto data connections operation response. */ +@Fluent +public final class DataConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionListResult.class); + + /* + * The list of Kusto data connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto data connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto data connections. + * + * @param value the value value to set. + * @return the DataConnectionListResult object itself. + */ + public DataConnectionListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidation.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidation.java new file mode 100644 index 000000000000..c6d0f53ac46d --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidation.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; + +/** An immutable client-side representation of DataConnectionValidation. */ +public interface DataConnectionValidation { + /** + * Gets the dataConnectionName property: The name of the data connection. + * + * @return the dataConnectionName value. + */ + String dataConnectionName(); + + /** + * Gets the properties property: The data connection properties to validate. + * + * @return the properties value. + */ + DataConnection properties(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner object. + * + * @return the inner object. + */ + DataConnectionValidationInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationListResult.java new file mode 100644 index 000000000000..73e84031c79e --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationListResult.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationListResultInner; +import java.util.List; + +/** An immutable client-side representation of DataConnectionValidationListResult. */ +public interface DataConnectionValidationListResult { + /** + * Gets the value property: The list of Kusto data connection validation errors. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationListResultInner object. + * + * @return the inner object. + */ + DataConnectionValidationListResultInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationResult.java new file mode 100644 index 000000000000..b0c24f3bddcb --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnectionValidationResult.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.kusto.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 result returned from a data connection validation request. */ +@Fluent +public final class DataConnectionValidationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionValidationResult.class); + + /* + * A message which indicates a problem in data connection validation. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get the errorMessage property: A message which indicates a problem in data connection validation. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: A message which indicates a problem in data connection validation. + * + * @param errorMessage the errorMessage value to set. + * @return the DataConnectionValidationResult object itself. + */ + public DataConnectionValidationResult withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnections.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnections.java new file mode 100644 index 000000000000..41e255376f1f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DataConnections.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionValidationInner; + +/** Resource collection API of DataConnections. */ +public interface DataConnections { + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + PagedIterable listByDatabase(String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connections operation response. + */ + PagedIterable listByDatabase( + String resourceGroupName, String clusterName, String databaseName, Context context); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, String clusterName, String databaseName, DataConnectionValidationInner parameters); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto data connection validation result. + */ + DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionValidationInner parameters, + Context context); + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName); + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + DataConnection get(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 class representing an data connection. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + DataConnection createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + DataConnection createOrUpdate( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + DataConnection update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing an data connection. + */ + DataConnection update( + String resourceGroupName, + String clusterName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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. + */ + void delete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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. + */ + void delete( + String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Database.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Database.java new file mode 100644 index 000000000000..ae353ea1bdb4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Database.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; + +/** An immutable client-side representation of Database. */ +public interface Database { + /** + * 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 inner com.azure.resourcemanager.kusto.fluent.models.DatabaseInner object. + * + * @return the inner object. + */ + DatabaseInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseListResult.java new file mode 100644 index 000000000000..8d32cf763057 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto databases operation response. */ +@Fluent +public final class DatabaseListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseListResult.class); + + /* + * The list of Kusto databases. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto databases. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto databases. + * + * @param value the value value to set. + * @return the DatabaseListResult object itself. + */ + public DatabaseListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipal.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipal.java new file mode 100644 index 000000000000..485513197581 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipal.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; + +/** An immutable client-side representation of DatabasePrincipal. */ +public interface DatabasePrincipal { + /** + * Gets the role property: Database principal role. + * + * @return the role value. + */ + DatabasePrincipalRole role(); + + /** + * Gets the name property: Database principal name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Database principal type. + * + * @return the type value. + */ + DatabasePrincipalType type(); + + /** + * Gets the fqn property: Database principal fully qualified name. + * + * @return the fqn value. + */ + String fqn(); + + /** + * Gets the email property: Database principal email if exists. + * + * @return the email value. + */ + String email(); + + /** + * Gets the appId property: Application id - relevant only for application principal type. + * + * @return the appId value. + */ + String appId(); + + /** + * Gets the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + String tenantName(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner object. + * + * @return the inner object. + */ + DatabasePrincipalInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignment.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignment.java new file mode 100644 index 000000000000..1feb2533bd43 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignment.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.kusto.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; + +/** An immutable client-side representation of DatabasePrincipalAssignment. */ +public interface DatabasePrincipalAssignment { + /** + * 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 principalId property: The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the role property: Database principal role. + * + * @return the role value. + */ + DatabasePrincipalRole role(); + + /** + * Gets the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the principalType property: Principal type. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + String tenantName(); + + /** + * Gets the principalName property: The principal name. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner object. + * + * @return the inner object. + */ + DatabasePrincipalAssignmentInner innerModel(); + + /** The entirety of the DatabasePrincipalAssignment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DatabasePrincipalAssignment definition stages. */ + interface DefinitionStages { + /** The first stage of the DatabasePrincipalAssignment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, databaseName. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @return the next definition stage. + */ + WithCreate withExistingDatabase(String resourceGroupName, String clusterName, String databaseName); + } + /** + * The stage of the DatabasePrincipalAssignment 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.WithPrincipalId, + DefinitionStages.WithRole, + DefinitionStages.WithTenantId, + DefinitionStages.WithPrincipalType { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabasePrincipalAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabasePrincipalAssignment create(Context context); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Database principal role.. + * + * @param role Database principal role. + * @return the next definition stage. + */ + WithCreate withRole(DatabasePrincipalRole role); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + WithCreate withPrincipalType(PrincipalType principalType); + } + } + /** + * Begins update for the DatabasePrincipalAssignment resource. + * + * @return the stage of resource update. + */ + DatabasePrincipalAssignment.Update update(); + + /** The template for DatabasePrincipalAssignment update. */ + interface Update + extends UpdateStages.WithPrincipalId, + UpdateStages.WithRole, + UpdateStages.WithTenantId, + UpdateStages.WithPrincipalType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabasePrincipalAssignment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabasePrincipalAssignment apply(Context context); + } + /** The DatabasePrincipalAssignment update stages. */ + interface UpdateStages { + /** The stage of the DatabasePrincipalAssignment update allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + Update withPrincipalId(String principalId); + } + /** The stage of the DatabasePrincipalAssignment update allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Database principal role.. + * + * @param role Database principal role. + * @return the next definition stage. + */ + Update withRole(DatabasePrincipalRole role); + } + /** The stage of the DatabasePrincipalAssignment update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the DatabasePrincipalAssignment update allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + Update withPrincipalType(PrincipalType principalType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabasePrincipalAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabasePrincipalAssignment refresh(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentCheckNameRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentCheckNameRequest.java new file mode 100644 index 000000000000..786a11f2d2b4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentCheckNameRequest.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.kusto.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 principal assignment check name availability request. */ +@Fluent +public final class DatabasePrincipalAssignmentCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentCheckNameRequest.class); + + /* + * Principal Assignment resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, + * Microsoft.Kusto/clusters/databases/principalAssignments. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of DatabasePrincipalAssignmentCheckNameRequest class. */ + public DatabasePrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Kusto/clusters/databases/principalAssignments"; + } + + /** + * Get the name property: Principal Assignment resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Principal Assignment resource name. + * + * @param name the name value to set. + * @return the DatabasePrincipalAssignmentCheckNameRequest object itself. + */ + public DatabasePrincipalAssignmentCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + * + * @param type the type value to set. + * @return the DatabasePrincipalAssignmentCheckNameRequest object itself. + */ + public DatabasePrincipalAssignmentCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model DatabasePrincipalAssignmentCheckNameRequest")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentListResult.java new file mode 100644 index 000000000000..cfd1445be68a --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignmentListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalAssignmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto database principal assignments operation response. */ +@Fluent +public final class DatabasePrincipalAssignmentListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentListResult.class); + + /* + * The list of Kusto database principal assignments. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto database principal assignments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto database principal assignments. + * + * @param value the value value to set. + * @return the DatabasePrincipalAssignmentListResult object itself. + */ + public DatabasePrincipalAssignmentListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignments.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignments.java new file mode 100644 index 000000000000..b9afe30f56b6 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalAssignments.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.kusto.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 DatabasePrincipalAssignments. */ +public interface DatabasePrincipalAssignments { + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the 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 the result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + DatabasePrincipalAssignment get( + String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName); + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto cluster database principalAssignment. + */ + Response getWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + String principalAssignmentName, + Context context); + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String databaseName, String principalAssignmentName); + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, + String databaseName, + String principalAssignmentName, + Context context); + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + PagedIterable list(String resourceGroupName, String clusterName, String databaseName); + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principal assignments operation response. + */ + PagedIterable list( + String resourceGroupName, String clusterName, String databaseName, Context context); + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @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 Kusto cluster database principalAssignment. + */ + DatabasePrincipalAssignment getById(String id); + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @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 Kusto cluster database principalAssignment. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Kusto principalAssignment. + * + * @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 Kusto principalAssignment. + * + * @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 DatabasePrincipalAssignment resource. + * + * @param name resource name. + * @return the first stage of the new DatabasePrincipalAssignment definition. + */ + DatabasePrincipalAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListRequest.java new file mode 100644 index 000000000000..36c960009842 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListRequest.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto database principals operation request. */ +@Fluent +public final class DatabasePrincipalListRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalListRequest.class); + + /* + * The list of Kusto database principals. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto database principals. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto database principals. + * + * @param value the value value to set. + * @return the DatabasePrincipalListRequest object itself. + */ + public DatabasePrincipalListRequest 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListResult.java new file mode 100644 index 000000000000..309ec96f2b96 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalListResult.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalListResultInner; +import java.util.List; + +/** An immutable client-side representation of DatabasePrincipalListResult. */ +public interface DatabasePrincipalListResult { + /** + * Gets the value property: The list of Kusto database principals. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.DatabasePrincipalListResultInner object. + * + * @return the inner object. + */ + DatabasePrincipalListResultInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalRole.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalRole.java new file mode 100644 index 000000000000..9e4be42ba80a --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalRole.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabasePrincipalRole. */ +public final class DatabasePrincipalRole extends ExpandableStringEnum { + /** Static value Admin for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole ADMIN = fromString("Admin"); + + /** Static value Ingestor for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole INGESTOR = fromString("Ingestor"); + + /** Static value Monitor for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole MONITOR = fromString("Monitor"); + + /** Static value User for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole USER = fromString("User"); + + /** Static value UnrestrictedViewers for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole UNRESTRICTED_VIEWERS = fromString("UnrestrictedViewers"); + + /** Static value Viewer for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole VIEWER = fromString("Viewer"); + + /** + * Creates or finds a DatabasePrincipalRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabasePrincipalRole. + */ + @JsonCreator + public static DatabasePrincipalRole fromString(String name) { + return fromString(name, DatabasePrincipalRole.class); + } + + /** @return known DatabasePrincipalRole values. */ + public static Collection values() { + return values(DatabasePrincipalRole.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalType.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalType.java new file mode 100644 index 000000000000..98cfd9f0e260 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabasePrincipalType.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabasePrincipalType. */ +public final class DatabasePrincipalType extends ExpandableStringEnum { + /** Static value App for DatabasePrincipalType. */ + public static final DatabasePrincipalType APP = fromString("App"); + + /** Static value Group for DatabasePrincipalType. */ + public static final DatabasePrincipalType GROUP = fromString("Group"); + + /** Static value User for DatabasePrincipalType. */ + public static final DatabasePrincipalType USER = fromString("User"); + + /** + * Creates or finds a DatabasePrincipalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabasePrincipalType. + */ + @JsonCreator + public static DatabasePrincipalType fromString(String name) { + return fromString(name, DatabasePrincipalType.class); + } + + /** @return known DatabasePrincipalType values. */ + public static Collection values() { + return values(DatabasePrincipalType.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseStatistics.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseStatistics.java new file mode 100644 index 000000000000..ed23dbb4eb51 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DatabaseStatistics.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.kusto.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 class that contains database statistics information. */ +@Fluent +public final class DatabaseStatistics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseStatistics.class); + + /* + * The database size - the total size of compressed data and index in + * bytes. + */ + @JsonProperty(value = "size") + private Float size; + + /** + * Get the size property: The database size - the total size of compressed data and index in bytes. + * + * @return the size value. + */ + public Float size() { + return this.size; + } + + /** + * Set the size property: The database size - the total size of compressed data and index in bytes. + * + * @param size the size value to set. + * @return the DatabaseStatistics object itself. + */ + public DatabaseStatistics withSize(Float size) { + this.size = size; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.java new file mode 100644 index 000000000000..de3115cc4208 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.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.kusto.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; + +/** Resource collection API of Databases. */ +public interface Databases { + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability(String resourceGroupName, String clusterName, CheckNameRequest resourceName); + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 the result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String clusterName, CheckNameRequest resourceName, Context context); + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto databases operation response. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + Database get(String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + Database createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + Database createOrUpdate( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + Database update(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto database. + */ + Database update( + String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String databaseName); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName, String databaseName, Context context); + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + PagedIterable listPrincipals(String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + PagedIterable listPrincipals( + String resourceGroupName, String clusterName, String databaseName, Context context); + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + DatabasePrincipalListResult addPrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd); + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToAdd List of database principals to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + Response addPrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToAdd, + Context context); + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + DatabasePrincipalListResult removePrincipals( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove); + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param databasePrincipalsToRemove List of database principals to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + Response removePrincipalsWithResponse( + String resourceGroupName, + String clusterName, + String databaseName, + DatabasePrincipalListRequest databasePrincipalsToRemove, + Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DefaultPrincipalsModificationKind.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DefaultPrincipalsModificationKind.java new file mode 100644 index 000000000000..b0d1ea538877 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DefaultPrincipalsModificationKind.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultPrincipalsModificationKind. */ +public final class DefaultPrincipalsModificationKind extends ExpandableStringEnum { + /** Static value Union for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind UNION = fromString("Union"); + + /** Static value Replace for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind REPLACE = fromString("Replace"); + + /** Static value None for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind NONE = fromString("None"); + + /** + * Creates or finds a DefaultPrincipalsModificationKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultPrincipalsModificationKind. + */ + @JsonCreator + public static DefaultPrincipalsModificationKind fromString(String name) { + return fromString(name, DefaultPrincipalsModificationKind.class); + } + + /** @return known DefaultPrincipalsModificationKind values. */ + public static Collection values() { + return values(DefaultPrincipalsModificationKind.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DiagnoseVirtualNetworkResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DiagnoseVirtualNetworkResult.java new file mode 100644 index 000000000000..0dc2910d6d00 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/DiagnoseVirtualNetworkResult.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; +import java.util.List; + +/** An immutable client-side representation of DiagnoseVirtualNetworkResult. */ +public interface DiagnoseVirtualNetworkResult { + /** + * Gets the findings property: The list of network connectivity diagnostic finding. + * + * @return the findings value. + */ + List findings(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner object. + * + * @return the inner object. + */ + DiagnoseVirtualNetworkResultInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EngineType.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EngineType.java new file mode 100644 index 000000000000..22042c6247a4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EngineType.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EngineType. */ +public final class EngineType extends ExpandableStringEnum { + /** Static value V2 for EngineType. */ + public static final EngineType V2 = fromString("V2"); + + /** Static value V3 for EngineType. */ + public static final EngineType V3 = fromString("V3"); + + /** + * Creates or finds a EngineType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EngineType. + */ + @JsonCreator + public static EngineType fromString(String name) { + return fromString(name, EngineType.class); + } + + /** @return known EngineType values. */ + public static Collection values() { + return values(EngineType.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataConnection.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataConnection.java new file mode 100644 index 000000000000..2262c59b6806 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataConnection.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Class representing an Event Grid data connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EventGrid") +@JsonFlatten +@Fluent +public class EventGridDataConnection extends DataConnectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventGridDataConnection.class); + + /* + * The resource ID of the storage account where the data resides. + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /* + * The resource ID where the event grid is configured to send events. + */ + @JsonProperty(value = "properties.eventHubResourceId") + private String eventHubResourceId; + + /* + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup") + private String consumerGroup; + + /* + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /* + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /* + * The data format of the message. Optionally the data format can be added + * to each message. + */ + @JsonProperty(value = "properties.dataFormat") + private EventGridDataFormat dataFormat; + + /* + * A Boolean value that, if set to true, indicates that ingestion should + * ignore the first record of every file + */ + @JsonProperty(value = "properties.ignoreFirstRecord") + private Boolean ignoreFirstRecord; + + /* + * The name of blob storage event type to process. + */ + @JsonProperty(value = "properties.blobStorageEventType") + private BlobStorageEventType blobStorageEventType; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the storageAccountResourceId property: The resource ID of the storage account where the data resides. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: The resource ID of the storage account where the data resides. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the eventHubResourceId property: The resource ID where the event grid is configured to send events. + * + * @return the eventHubResourceId value. + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the eventHubResourceId property: The resource ID where the event grid is configured to send events. + * + * @param eventHubResourceId the eventHubResourceId value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the consumerGroup property: The event hub consumer group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: The event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @param tableName the tableName value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @return the mappingRuleName value. + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @return the dataFormat value. + */ + public EventGridDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @param dataFormat the dataFormat value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withDataFormat(EventGridDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get the ignoreFirstRecord property: A Boolean value that, if set to true, indicates that ingestion should ignore + * the first record of every file. + * + * @return the ignoreFirstRecord value. + */ + public Boolean ignoreFirstRecord() { + return this.ignoreFirstRecord; + } + + /** + * Set the ignoreFirstRecord property: A Boolean value that, if set to true, indicates that ingestion should ignore + * the first record of every file. + * + * @param ignoreFirstRecord the ignoreFirstRecord value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withIgnoreFirstRecord(Boolean ignoreFirstRecord) { + this.ignoreFirstRecord = ignoreFirstRecord; + return this; + } + + /** + * Get the blobStorageEventType property: The name of blob storage event type to process. + * + * @return the blobStorageEventType value. + */ + public BlobStorageEventType blobStorageEventType() { + return this.blobStorageEventType; + } + + /** + * Set the blobStorageEventType property: The name of blob storage event type to process. + * + * @param blobStorageEventType the blobStorageEventType value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withBlobStorageEventType(BlobStorageEventType blobStorageEventType) { + this.blobStorageEventType = blobStorageEventType; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public EventGridDataConnection withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataFormat.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataFormat.java new file mode 100644 index 000000000000..1539cba795b9 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventGridDataFormat.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EventGridDataFormat. */ +public final class EventGridDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for EventGridDataFormat. */ + public static final EventGridDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for EventGridDataFormat. */ + public static final EventGridDataFormat JSON = fromString("JSON"); + + /** Static value CSV for EventGridDataFormat. */ + public static final EventGridDataFormat CSV = fromString("CSV"); + + /** Static value TSV for EventGridDataFormat. */ + public static final EventGridDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for EventGridDataFormat. */ + public static final EventGridDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for EventGridDataFormat. */ + public static final EventGridDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for EventGridDataFormat. */ + public static final EventGridDataFormat PSV = fromString("PSV"); + + /** Static value TXT for EventGridDataFormat. */ + public static final EventGridDataFormat TXT = fromString("TXT"); + + /** Static value RAW for EventGridDataFormat. */ + public static final EventGridDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for EventGridDataFormat. */ + public static final EventGridDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for EventGridDataFormat. */ + public static final EventGridDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for EventGridDataFormat. */ + public static final EventGridDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for EventGridDataFormat. */ + public static final EventGridDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for EventGridDataFormat. */ + public static final EventGridDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for EventGridDataFormat. */ + public static final EventGridDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for EventGridDataFormat. */ + public static final EventGridDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a EventGridDataFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventGridDataFormat. + */ + @JsonCreator + public static EventGridDataFormat fromString(String name) { + return fromString(name, EventGridDataFormat.class); + } + + /** @return known EventGridDataFormat values. */ + public static Collection values() { + return values(EventGridDataFormat.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataConnection.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataConnection.java new file mode 100644 index 000000000000..222b1366281c --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataConnection.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +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; + +/** Class representing an event hub data connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EventHub") +@JsonFlatten +@Fluent +public class EventHubDataConnection extends DataConnectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventHubDataConnection.class); + + /* + * The resource ID of the event hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.eventHubResourceId") + private String eventHubResourceId; + + /* + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup") + private String consumerGroup; + + /* + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /* + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /* + * The data format of the message. Optionally the data format can be added + * to each message. + */ + @JsonProperty(value = "properties.dataFormat") + private EventHubDataFormat dataFormat; + + /* + * System properties of the event hub + */ + @JsonProperty(value = "properties.eventSystemProperties") + private List eventSystemProperties; + + /* + * The event hub messages compression type + */ + @JsonProperty(value = "properties.compression") + private Compression compression; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the eventHubResourceId property: The resource ID of the event hub to be used to create a data connection. + * + * @return the eventHubResourceId value. + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the eventHubResourceId property: The resource ID of the event hub to be used to create a data connection. + * + * @param eventHubResourceId the eventHubResourceId value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the consumerGroup property: The event hub consumer group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: The event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @param tableName the tableName value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @return the mappingRuleName value. + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @return the dataFormat value. + */ + public EventHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @param dataFormat the dataFormat value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withDataFormat(EventHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get the eventSystemProperties property: System properties of the event hub. + * + * @return the eventSystemProperties value. + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set the eventSystemProperties property: System properties of the event hub. + * + * @param eventSystemProperties the eventSystemProperties value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withEventSystemProperties(List eventSystemProperties) { + this.eventSystemProperties = eventSystemProperties; + return this; + } + + /** + * Get the compression property: The event hub messages compression type. + * + * @return the compression value. + */ + public Compression compression() { + return this.compression; + } + + /** + * Set the compression property: The event hub messages compression type. + * + * @param compression the compression value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withCompression(Compression compression) { + this.compression = compression; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public EventHubDataConnection withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataFormat.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataFormat.java new file mode 100644 index 000000000000..260c268bea82 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EventHubDataFormat.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EventHubDataFormat. */ +public final class EventHubDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for EventHubDataFormat. */ + public static final EventHubDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for EventHubDataFormat. */ + public static final EventHubDataFormat JSON = fromString("JSON"); + + /** Static value CSV for EventHubDataFormat. */ + public static final EventHubDataFormat CSV = fromString("CSV"); + + /** Static value TSV for EventHubDataFormat. */ + public static final EventHubDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for EventHubDataFormat. */ + public static final EventHubDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for EventHubDataFormat. */ + public static final EventHubDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for EventHubDataFormat. */ + public static final EventHubDataFormat PSV = fromString("PSV"); + + /** Static value TXT for EventHubDataFormat. */ + public static final EventHubDataFormat TXT = fromString("TXT"); + + /** Static value RAW for EventHubDataFormat. */ + public static final EventHubDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for EventHubDataFormat. */ + public static final EventHubDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for EventHubDataFormat. */ + public static final EventHubDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for EventHubDataFormat. */ + public static final EventHubDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for EventHubDataFormat. */ + public static final EventHubDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for EventHubDataFormat. */ + public static final EventHubDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for EventHubDataFormat. */ + public static final EventHubDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for EventHubDataFormat. */ + public static final EventHubDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a EventHubDataFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventHubDataFormat. + */ + @JsonCreator + public static EventHubDataFormat fromString(String name) { + return fromString(name, EventHubDataFormat.class); + } + + /** @return known EventHubDataFormat values. */ + public static Collection values() { + return values(EventHubDataFormat.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseDefinition.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseDefinition.java new file mode 100644 index 000000000000..ab03f17aa728 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseDefinition.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; + +/** An immutable client-side representation of FollowerDatabaseDefinition. */ +public interface FollowerDatabaseDefinition { + /** + * Gets the clusterResourceId property: Resource id of the cluster that follows a database owned by this cluster. + * + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * Gets the attachedDatabaseConfigurationName property: Resource name of the attached database configuration in the + * follower cluster. + * + * @return the attachedDatabaseConfigurationName value. + */ + String attachedDatabaseConfigurationName(); + + /** + * Gets the databaseName property: The database name owned by this cluster that was followed. * in case following + * all databases. + * + * @return the databaseName value. + */ + String databaseName(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner object. + * + * @return the inner object. + */ + FollowerDatabaseDefinitionInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseListResult.java new file mode 100644 index 000000000000..a3b0a458ee2c --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/FollowerDatabaseListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto database principals operation response. */ +@Fluent +public final class FollowerDatabaseListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FollowerDatabaseListResult.class); + + /* + * The list of follower database result. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of follower database result. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of follower database result. + * + * @param value the value value to set. + * @return the FollowerDatabaseListResult object itself. + */ + public FollowerDatabaseListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.java new file mode 100644 index 000000000000..3b6f5137cf60 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.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.kusto.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; + +/** Identity for the resource. */ +@Fluent +public class Identity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); + + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of managed identity used. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user-assigned identities. The type 'None' will remove all identities. + */ + @JsonProperty(value = "type", required = true) + private IdentityType type; + + /* + * The list of user identities associated with the Kusto cluster. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove all identities. + * + * @return the type value. + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove all identities. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the Kusto cluster. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the Kusto cluster. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityType.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityType.java new file mode 100644 index 000000000000..bb07e66440cc --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityType.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityType. */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value None for IdentityType. */ + public static final IdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for IdentityType. */ + public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned, UserAssigned"); + + /** + * Creates or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** @return known IdentityType values. */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityUserAssignedIdentities.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityUserAssignedIdentities.java new file mode 100644 index 000000000000..45463c8a9509 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IdentityUserAssignedIdentities.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.kusto.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 IdentityUserAssignedIdentities model. */ +@Immutable +public final class IdentityUserAssignedIdentities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityUserAssignedIdentities.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataConnection.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataConnection.java new file mode 100644 index 000000000000..408ef69af38f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataConnection.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DataConnectionInner; +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; + +/** Class representing an iot hub data connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("IotHub") +@JsonFlatten +@Fluent +public class IotHubDataConnection extends DataConnectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotHubDataConnection.class); + + /* + * The resource ID of the Iot hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.iotHubResourceId") + private String iotHubResourceId; + + /* + * The iot hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup") + private String consumerGroup; + + /* + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /* + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /* + * The data format of the message. Optionally the data format can be added + * to each message. + */ + @JsonProperty(value = "properties.dataFormat") + private IotHubDataFormat dataFormat; + + /* + * System properties of the iot hub + */ + @JsonProperty(value = "properties.eventSystemProperties") + private List eventSystemProperties; + + /* + * The name of the share access policy + */ + @JsonProperty(value = "properties.sharedAccessPolicyName") + private String sharedAccessPolicyName; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the iotHubResourceId property: The resource ID of the Iot hub to be used to create a data connection. + * + * @return the iotHubResourceId value. + */ + public String iotHubResourceId() { + return this.iotHubResourceId; + } + + /** + * Set the iotHubResourceId property: The resource ID of the Iot hub to be used to create a data connection. + * + * @param iotHubResourceId the iotHubResourceId value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withIotHubResourceId(String iotHubResourceId) { + this.iotHubResourceId = iotHubResourceId; + return this; + } + + /** + * Get the consumerGroup property: The iot hub consumer group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: The iot hub consumer group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @param tableName the tableName value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @return the mappingRuleName value. + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @return the dataFormat value. + */ + public IotHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @param dataFormat the dataFormat value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withDataFormat(IotHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get the eventSystemProperties property: System properties of the iot hub. + * + * @return the eventSystemProperties value. + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set the eventSystemProperties property: System properties of the iot hub. + * + * @param eventSystemProperties the eventSystemProperties value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withEventSystemProperties(List eventSystemProperties) { + this.eventSystemProperties = eventSystemProperties; + return this; + } + + /** + * Get the sharedAccessPolicyName property: The name of the share access policy. + * + * @return the sharedAccessPolicyName value. + */ + public String sharedAccessPolicyName() { + return this.sharedAccessPolicyName; + } + + /** + * Set the sharedAccessPolicyName property: The name of the share access policy. + * + * @param sharedAccessPolicyName the sharedAccessPolicyName value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withSharedAccessPolicyName(String sharedAccessPolicyName) { + this.sharedAccessPolicyName = sharedAccessPolicyName; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public IotHubDataConnection withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataFormat.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataFormat.java new file mode 100644 index 000000000000..487128f9d4bb --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/IotHubDataFormat.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IotHubDataFormat. */ +public final class IotHubDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for IotHubDataFormat. */ + public static final IotHubDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for IotHubDataFormat. */ + public static final IotHubDataFormat JSON = fromString("JSON"); + + /** Static value CSV for IotHubDataFormat. */ + public static final IotHubDataFormat CSV = fromString("CSV"); + + /** Static value TSV for IotHubDataFormat. */ + public static final IotHubDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for IotHubDataFormat. */ + public static final IotHubDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for IotHubDataFormat. */ + public static final IotHubDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for IotHubDataFormat. */ + public static final IotHubDataFormat PSV = fromString("PSV"); + + /** Static value TXT for IotHubDataFormat. */ + public static final IotHubDataFormat TXT = fromString("TXT"); + + /** Static value RAW for IotHubDataFormat. */ + public static final IotHubDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for IotHubDataFormat. */ + public static final IotHubDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for IotHubDataFormat. */ + public static final IotHubDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for IotHubDataFormat. */ + public static final IotHubDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for IotHubDataFormat. */ + public static final IotHubDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for IotHubDataFormat. */ + public static final IotHubDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for IotHubDataFormat. */ + public static final IotHubDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for IotHubDataFormat. */ + public static final IotHubDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a IotHubDataFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding IotHubDataFormat. + */ + @JsonCreator + public static IotHubDataFormat fromString(String name) { + return fromString(name, IotHubDataFormat.class); + } + + /** @return known IotHubDataFormat values. */ + public static Collection values() { + return values(IotHubDataFormat.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java new file mode 100644 index 000000000000..19f5320998e6 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 the key vault. */ +@Fluent +public final class KeyVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultProperties.class); + + /* + * The name of the key vault key. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /* + * The version of the key vault key. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /* + * The Uri of the key vault. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /* + * The user assigned identity (ARM resource id) that has access to the key. + */ + @JsonProperty(value = "userIdentity") + private String userIdentity; + + /** + * Get the keyName property: The name of the key vault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of the key vault key. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of the key vault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of the key vault key. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the keyVaultUri property: The Uri of the key vault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Uri of the key vault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the userIdentity property: The user assigned identity (ARM resource id) that has access to the key. + * + * @return the userIdentity value. + */ + public String userIdentity() { + return this.userIdentity; + } + + /** + * Set the userIdentity property: The user assigned identity (ARM resource id) that has access to the key. + * + * @param userIdentity the userIdentity value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withUserIdentity(String userIdentity) { + this.userIdentity = userIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyName in model KeyVaultProperties")); + } + if (keyVaultUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyVaultUri in model KeyVaultProperties")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Kind.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Kind.java new file mode 100644 index 000000000000..fd1aab768d20 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Kind.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Kind. */ +public final class Kind extends ExpandableStringEnum { + /** Static value ReadWrite for Kind. */ + public static final Kind READ_WRITE = fromString("ReadWrite"); + + /** Static value ReadOnlyFollowing for Kind. */ + public static final Kind READ_ONLY_FOLLOWING = fromString("ReadOnlyFollowing"); + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** @return known Kind values. */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtension.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtension.java new file mode 100644 index 000000000000..26f5e1a79304 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtension.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; + +/** An immutable client-side representation of LanguageExtension. */ +public interface LanguageExtension { + /** + * Gets the languageExtensionName property: The language extension name. + * + * @return the languageExtensionName value. + */ + LanguageExtensionName languageExtensionName(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner object. + * + * @return the inner object. + */ + LanguageExtensionInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionName.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionName.java new file mode 100644 index 000000000000..8c7750fc451f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionName.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LanguageExtensionName. */ +public final class LanguageExtensionName extends ExpandableStringEnum { + /** Static value PYTHON for LanguageExtensionName. */ + public static final LanguageExtensionName PYTHON = fromString("PYTHON"); + + /** Static value R for LanguageExtensionName. */ + public static final LanguageExtensionName R = fromString("R"); + + /** + * Creates or finds a LanguageExtensionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding LanguageExtensionName. + */ + @JsonCreator + public static LanguageExtensionName fromString(String name) { + return fromString(name, LanguageExtensionName.class); + } + + /** @return known LanguageExtensionName values. */ + public static Collection values() { + return values(LanguageExtensionName.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionsList.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionsList.java new file mode 100644 index 000000000000..022f0521f4b2 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/LanguageExtensionsList.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of language extension objects. */ +@Fluent +public final class LanguageExtensionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LanguageExtensionsList.class); + + /* + * The list of language extensions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of language extensions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of language extensions. + * + * @param value the value value to set. + * @return the LanguageExtensionsList object itself. + */ + public LanguageExtensionsList 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ListResourceSkusResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ListResourceSkusResult.java new file mode 100644 index 000000000000..3c3001a916fa --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ListResourceSkusResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.AzureResourceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of available SKUs for a Kusto Cluster. */ +@Fluent +public final class ListResourceSkusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListResourceSkusResult.class); + + /* + * The collection of available SKUs for an existing resource. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The collection of available SKUs for an existing resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection of available SKUs for an existing resource. + * + * @param value the value value to set. + * @return the ListResourceSkusResult object itself. + */ + public ListResourceSkusResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.java new file mode 100644 index 000000000000..1bdf41daaaf1 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: This is of the format {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that describes the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Any object. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.java new file mode 100644 index 000000000000..3ae7b56abbd4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.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.kusto.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 object that describes the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Friendly name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * For example: read, write, delete. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The friendly name of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Friendly name of the resource provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Friendly name of the resource provider. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the operation property: For example: read, write, delete. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: For example: read, write, delete. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the resource property: The resource type on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource type on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the description property: The friendly name of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The friendly name of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationListResult.java new file mode 100644 index 000000000000..11d8a23c0709 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationListResult.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the + * next set of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * The list of operations supported by the resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of operations supported by the resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operations.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operations.java new file mode 100644 index 000000000000..fbc205622eec --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operations.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.kusto.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + PagedIterable list(); + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OptimizedAutoscale.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OptimizedAutoscale.java new file mode 100644 index 000000000000..cf22c25be5af --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OptimizedAutoscale.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.kusto.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 class that contains the optimized auto scale definition. */ +@Fluent +public final class OptimizedAutoscale { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OptimizedAutoscale.class); + + /* + * The version of the template defined, for instance 1. + */ + @JsonProperty(value = "version", required = true) + private int version; + + /* + * A boolean value that indicate if the optimized autoscale feature is + * enabled or not. + */ + @JsonProperty(value = "isEnabled", required = true) + private boolean isEnabled; + + /* + * Minimum allowed instances count. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * Maximum allowed instances count. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /** + * Get the version property: The version of the template defined, for instance 1. + * + * @return the version value. + */ + public int version() { + return this.version; + } + + /** + * Set the version property: The version of the template defined, for instance 1. + * + * @param version the version value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withVersion(int version) { + this.version = version; + return this; + } + + /** + * Get the isEnabled property: A boolean value that indicate if the optimized autoscale feature is enabled or not. + * + * @return the isEnabled value. + */ + public boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: A boolean value that indicate if the optimized autoscale feature is enabled or not. + * + * @param isEnabled the isEnabled value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the minimum property: Minimum allowed instances count. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Minimum allowed instances count. + * + * @param minimum the minimum value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: Maximum allowed instances count. + * + * @return the maximum value. + */ + public int maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Maximum allowed instances count. + * + * @param maximum the maximum value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalType.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalType.java new file mode 100644 index 000000000000..5184510d1db9 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalType.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrincipalType. */ +public final class PrincipalType extends ExpandableStringEnum { + /** Static value App for PrincipalType. */ + public static final PrincipalType APP = fromString("App"); + + /** Static value Group for PrincipalType. */ + public static final PrincipalType GROUP = fromString("Group"); + + /** Static value User for PrincipalType. */ + public static final PrincipalType USER = fromString("User"); + + /** + * Creates or finds a PrincipalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrincipalType. + */ + @JsonCreator + public static PrincipalType fromString(String name) { + return fromString(name, PrincipalType.class); + } + + /** @return known PrincipalType values. */ + public static Collection values() { + return values(PrincipalType.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalsModificationKind.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalsModificationKind.java new file mode 100644 index 000000000000..555a0b468937 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrincipalsModificationKind.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrincipalsModificationKind. */ +public final class PrincipalsModificationKind extends ExpandableStringEnum { + /** Static value Union for PrincipalsModificationKind. */ + public static final PrincipalsModificationKind UNION = fromString("Union"); + + /** Static value Replace for PrincipalsModificationKind. */ + public static final PrincipalsModificationKind REPLACE = fromString("Replace"); + + /** Static value None for PrincipalsModificationKind. */ + public static final PrincipalsModificationKind NONE = fromString("None"); + + /** + * Creates or finds a PrincipalsModificationKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrincipalsModificationKind. + */ + @JsonCreator + public static PrincipalsModificationKind fromString(String name) { + return fromString(name, PrincipalsModificationKind.class); + } + + /** @return known PrincipalsModificationKind values. */ + public static Collection values() { + return values(PrincipalsModificationKind.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ProvisioningState.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ProvisioningState.java new file mode 100644 index 000000000000..596c3e225be7 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ProvisioningState.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.kusto.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 Running for ProvisioningState. */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** + * 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadOnlyFollowingDatabase.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadOnlyFollowingDatabase.java new file mode 100644 index 000000000000..54231bd05fa2 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadOnlyFollowingDatabase.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; +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.Duration; + +/** Class representing a read only following database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ReadOnlyFollowing") +@JsonFlatten +@Fluent +public class ReadOnlyFollowingDatabase extends DatabaseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReadOnlyFollowingDatabase.class); + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The time the data should be kept before it stops being accessible to + * queries in TimeSpan. + */ + @JsonProperty(value = "properties.softDeletePeriod", access = JsonProperty.Access.WRITE_ONLY) + private Duration softDeletePeriod; + + /* + * The time the data should be kept in cache for fast queries in TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Duration hotCachePeriod; + + /* + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseStatistics statistics; + + /* + * The name of the leader cluster + */ + @JsonProperty(value = "properties.leaderClusterResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String leaderClusterResourceId; + + /* + * The name of the attached database configuration cluster + */ + @JsonProperty(value = "properties.attachedDatabaseConfigurationName", access = JsonProperty.Access.WRITE_ONLY) + private String attachedDatabaseConfigurationName; + + /* + * The principals modification kind of the database + */ + @JsonProperty(value = "properties.principalsModificationKind", access = JsonProperty.Access.WRITE_ONLY) + private PrincipalsModificationKind principalsModificationKind; + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the softDeletePeriod property: The time the data should be kept before it stops being accessible to queries + * in TimeSpan. + * + * @return the softDeletePeriod value. + */ + public Duration softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Get the hotCachePeriod property: The time the data should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value. + */ + public Duration hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set the hotCachePeriod property: The time the data should be kept in cache for fast queries in TimeSpan. + * + * @param hotCachePeriod the hotCachePeriod value to set. + * @return the ReadOnlyFollowingDatabase object itself. + */ + public ReadOnlyFollowingDatabase withHotCachePeriod(Duration hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics property: The statistics of the database. + * + * @return the statistics value. + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Get the leaderClusterResourceId property: The name of the leader cluster. + * + * @return the leaderClusterResourceId value. + */ + public String leaderClusterResourceId() { + return this.leaderClusterResourceId; + } + + /** + * Get the attachedDatabaseConfigurationName property: The name of the attached database configuration cluster. + * + * @return the attachedDatabaseConfigurationName value. + */ + public String attachedDatabaseConfigurationName() { + return this.attachedDatabaseConfigurationName; + } + + /** + * Get the principalsModificationKind property: The principals modification kind of the database. + * + * @return the principalsModificationKind value. + */ + public PrincipalsModificationKind principalsModificationKind() { + return this.principalsModificationKind; + } + + /** {@inheritDoc} */ + @Override + public ReadOnlyFollowingDatabase withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (statistics() != null) { + statistics().validate(); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadWriteDatabase.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadWriteDatabase.java new file mode 100644 index 000000000000..d4383f81c5b4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ReadWriteDatabase.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.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.DatabaseInner; +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.Duration; + +/** Class representing a read write database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ReadWrite") +@JsonFlatten +@Fluent +public class ReadWriteDatabase extends DatabaseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReadWriteDatabase.class); + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The time the data should be kept before it stops being accessible to + * queries in TimeSpan. + */ + @JsonProperty(value = "properties.softDeletePeriod") + private Duration softDeletePeriod; + + /* + * The time the data should be kept in cache for fast queries in TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Duration hotCachePeriod; + + /* + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseStatistics statistics; + + /* + * Indicates whether the database is followed. + */ + @JsonProperty(value = "properties.isFollowed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isFollowed; + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the softDeletePeriod property: The time the data should be kept before it stops being accessible to queries + * in TimeSpan. + * + * @return the softDeletePeriod value. + */ + public Duration softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Set the softDeletePeriod property: The time the data should be kept before it stops being accessible to queries + * in TimeSpan. + * + * @param softDeletePeriod the softDeletePeriod value to set. + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withSoftDeletePeriod(Duration softDeletePeriod) { + this.softDeletePeriod = softDeletePeriod; + return this; + } + + /** + * Get the hotCachePeriod property: The time the data should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value. + */ + public Duration hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set the hotCachePeriod property: The time the data should be kept in cache for fast queries in TimeSpan. + * + * @param hotCachePeriod the hotCachePeriod value to set. + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withHotCachePeriod(Duration hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics property: The statistics of the database. + * + * @return the statistics value. + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Get the isFollowed property: Indicates whether the database is followed. + * + * @return the isFollowed value. + */ + public Boolean isFollowed() { + return this.isFollowed; + } + + /** {@inheritDoc} */ + @Override + public ReadWriteDatabase withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (statistics() != null) { + statistics().validate(); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Reason.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Reason.java new file mode 100644 index 000000000000..80930f580797 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Reason.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Reason. */ +public final class Reason extends ExpandableStringEnum { + /** Static value Invalid for Reason. */ + public static final Reason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for Reason. */ + public static final Reason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a Reason from its string representation. + * + * @param name a name to look for. + * @return the corresponding Reason. + */ + @JsonCreator + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** @return known Reason values. */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescription.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescription.java new file mode 100644 index 000000000000..9589a73ea876 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescription.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.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; +import java.util.List; + +/** An immutable client-side representation of SkuDescription. */ +public interface SkuDescription { + /** + * Gets the resourceType property: The resource type. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of the SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: The tier of the SKU. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: Locations and zones. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner object. + * + * @return the inner object. + */ + SkuDescriptionInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescriptionList.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescriptionList.java new file mode 100644 index 000000000000..bc4118043dbf --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuDescriptionList.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.kusto.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of the EngagementFabric SKU descriptions. */ +@Immutable +public final class SkuDescriptionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuDescriptionList.class); + + /* + * SKU descriptions + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: SKU descriptions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuLocationInfoItem.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuLocationInfoItem.java new file mode 100644 index 000000000000..5a8ac2f1e94c --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/SkuLocationInfoItem.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.kusto.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; + +/** The locations and zones info for SKU. */ +@Fluent +public final class SkuLocationInfoItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuLocationInfoItem.class); + + /* + * The available location of the SKU. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The available zone of the SKU. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the location property: The available location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The available location of the SKU. + * + * @param location the location value to set. + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: The available zone of the SKU. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The available zone of the SKU. + * + * @param zones the zones value to set. + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model SkuLocationInfoItem")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/State.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/State.java new file mode 100644 index 000000000000..2a350ac18b22 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/State.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for State. */ +public final class State extends ExpandableStringEnum { + /** Static value Creating for State. */ + public static final State CREATING = fromString("Creating"); + + /** Static value Unavailable for State. */ + public static final State UNAVAILABLE = fromString("Unavailable"); + + /** Static value Running for State. */ + public static final State RUNNING = fromString("Running"); + + /** Static value Deleting for State. */ + public static final State DELETING = fromString("Deleting"); + + /** Static value Deleted for State. */ + public static final State DELETED = fromString("Deleted"); + + /** Static value Stopping for State. */ + public static final State STOPPING = fromString("Stopping"); + + /** Static value Stopped for State. */ + public static final State STOPPED = fromString("Stopped"); + + /** Static value Starting for State. */ + public static final State STARTING = fromString("Starting"); + + /** Static value Updating for State. */ + public static final State UPDATING = fromString("Updating"); + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** @return known State values. */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/TrustedExternalTenant.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/TrustedExternalTenant.java new file mode 100644 index 000000000000..4040850fa196 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/TrustedExternalTenant.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.kusto.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; + +/** Represents a tenant ID that is trusted by the cluster. */ +@Fluent +public final class TrustedExternalTenant { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrustedExternalTenant.class); + + /* + * GUID representing an external tenant. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value property: GUID representing an external tenant. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: GUID representing an external tenant. + * + * @param value the value value to set. + * @return the TrustedExternalTenant object itself. + */ + public TrustedExternalTenant withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Type.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Type.java new file mode 100644 index 000000000000..b019d6fe928d --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Type.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.kusto.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Type. */ +public enum Type { + /** Enum value Microsoft.Kusto/clusters/databases. */ + MICROSOFT_KUSTO_CLUSTERS_DATABASES("Microsoft.Kusto/clusters/databases"), + + /** Enum value Microsoft.Kusto/clusters/attachedDatabaseConfigurations. */ + MICROSOFT_KUSTO_CLUSTERS_ATTACHED_DATABASE_CONFIGURATIONS( + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations"); + + /** The actual serialized value for a Type instance. */ + private final String value; + + Type(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Type instance. + * + * @param value the serialized value to parse. + * @return the parsed Type object, or null if unable to parse. + */ + @JsonCreator + public static Type fromString(String value) { + Type[] items = Type.values(); + for (Type item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/VirtualNetworkConfiguration.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/VirtualNetworkConfiguration.java new file mode 100644 index 000000000000..33089dba9bd9 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/VirtualNetworkConfiguration.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.kusto.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 class that contains virtual network definition. */ +@Fluent +public final class VirtualNetworkConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkConfiguration.class); + + /* + * The subnet resource id. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /* + * Engine service's public IP address resource id. + */ + @JsonProperty(value = "enginePublicIpId", required = true) + private String enginePublicIpId; + + /* + * Data management's service public IP address resource id. + */ + @JsonProperty(value = "dataManagementPublicIpId", required = true) + private String dataManagementPublicIpId; + + /** + * Get the subnetId property: The subnet resource id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet resource id. + * + * @param subnetId the subnetId value to set. + * @return the VirtualNetworkConfiguration object itself. + */ + public VirtualNetworkConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the enginePublicIpId property: Engine service's public IP address resource id. + * + * @return the enginePublicIpId value. + */ + public String enginePublicIpId() { + return this.enginePublicIpId; + } + + /** + * Set the enginePublicIpId property: Engine service's public IP address resource id. + * + * @param enginePublicIpId the enginePublicIpId value to set. + * @return the VirtualNetworkConfiguration object itself. + */ + public VirtualNetworkConfiguration withEnginePublicIpId(String enginePublicIpId) { + this.enginePublicIpId = enginePublicIpId; + return this; + } + + /** + * Get the dataManagementPublicIpId property: Data management's service public IP address resource id. + * + * @return the dataManagementPublicIpId value. + */ + public String dataManagementPublicIpId() { + return this.dataManagementPublicIpId; + } + + /** + * Set the dataManagementPublicIpId property: Data management's service public IP address resource id. + * + * @param dataManagementPublicIpId the dataManagementPublicIpId value to set. + * @return the VirtualNetworkConfiguration object itself. + */ + public VirtualNetworkConfiguration withDataManagementPublicIpId(String dataManagementPublicIpId) { + this.dataManagementPublicIpId = dataManagementPublicIpId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model VirtualNetworkConfiguration")); + } + if (enginePublicIpId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property enginePublicIpId in model VirtualNetworkConfiguration")); + } + if (dataManagementPublicIpId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataManagementPublicIpId in model VirtualNetworkConfiguration")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/package-info.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/package-info.java new file mode 100644 index 000000000000..ed248ec38f00 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/package-info.java @@ -0,0 +1,10 @@ +// 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 KustoManagementClient. The Azure Kusto management API provides a RESTful set + * of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to + * create, update, and delete clusters and databases. + */ +package com.azure.resourcemanager.kusto.models; diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/package-info.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/package-info.java new file mode 100644 index 000000000000..356cad24ba87 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/package-info.java @@ -0,0 +1,10 @@ +// 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 KustoManagementClient. The Azure Kusto management API provides a RESTful set of + * web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to + * create, update, and delete clusters and databases. + */ +package com.azure.resourcemanager.kusto; diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/module-info.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/module-info.java new file mode 100644 index 000000000000..fd1d63313343 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/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.kusto { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.kusto; + exports com.azure.resourcemanager.kusto.fluent; + exports com.azure.resourcemanager.kusto.fluent.models; + exports com.azure.resourcemanager.kusto.models; + + opens com.azure.resourcemanager.kusto.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.kusto.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/kusto/ci.yml b/sdk/kusto/ci.yml new file mode 100644 index 000000000000..96a883fe0a99 --- /dev/null +++ b/sdk/kusto/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: kusto + Artifacts: + - name: azure-resourcemanager-kusto + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerkusto diff --git a/sdk/kusto/pom.xml b/sdk/kusto/pom.xml new file mode 100644 index 000000000000..33c8b9164bed --- /dev/null +++ b/sdk/kusto/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-kusto-service + pom + 1.0.0 + + azure-resourcemanager-kusto + +