From cd30d6163ddc290a30666f3c07a14a91e7b32560 Mon Sep 17 00:00:00 2001 From: xccc-msft Date: Tue, 26 May 2020 10:41:48 +0800 Subject: [PATCH 1/3] Kusto: generate package-2020-02-15 --- sdk/kusto/mgmt-v2020_02_15/pom.xml | 135 + .../AttachedDatabaseConfiguration.java | 179 ++ .../AttachedDatabaseConfigurations.java | 53 + .../kusto/v2020_02_15/AzureCapacity.java | 121 + .../v2020_02_15/AzureEntityResource.java | 34 + .../kusto/v2020_02_15/AzureResourceSku.java | 35 + .../kusto/v2020_02_15/AzureScaleType.java | 44 + .../kusto/v2020_02_15/AzureSku.java | 103 + .../kusto/v2020_02_15/AzureSkuName.java | 98 + .../kusto/v2020_02_15/AzureSkuTier.java | 41 + .../kusto/v2020_02_15/CheckNameRequest.java | 71 + .../kusto/v2020_02_15/CheckNameResult.java | 40 + .../management/kusto/v2020_02_15/Cluster.java | 401 +++ .../v2020_02_15/ClusterCheckNameRequest.java | 77 + .../ClusterPrincipalAssignment.java | 183 ++ ...erPrincipalAssignmentCheckNameRequest.java | 77 + .../ClusterPrincipalAssignments.java | 64 + .../v2020_02_15/ClusterPrincipalRole.java | 41 + .../kusto/v2020_02_15/ClusterUpdate.java | 412 +++ .../kusto/v2020_02_15/Clusters.java | 137 + .../kusto/v2020_02_15/Compression.java | 41 + .../kusto/v2020_02_15/DataConnection.java | 118 + .../DataConnectionCheckNameRequest.java | 78 + .../v2020_02_15/DataConnectionValidation.java | 70 + .../DataConnectionValidationListResult.java | 26 + .../DataConnectionValidationResult.java | 43 + .../kusto/v2020_02_15/DataConnections.java | 80 + .../kusto/v2020_02_15/Database.java | 117 + .../kusto/v2020_02_15/DatabasePrincipal.java | 55 + .../DatabasePrincipalAssignment.java | 184 ++ ...sePrincipalAssignmentCheckNameRequest.java | 78 + .../DatabasePrincipalAssignments.java | 68 + .../DatabasePrincipalListRequest.java | 45 + .../DatabasePrincipalListResult.java | 27 + .../v2020_02_15/DatabasePrincipalRole.java | 53 + .../v2020_02_15/DatabasePrincipalType.java | 44 + .../kusto/v2020_02_15/DatabaseStatistics.java | 44 + .../kusto/v2020_02_15/Databases.java | 97 + .../DefaultPrincipalsModificationKind.java | 44 + .../DiagnoseVirtualNetworkResult.java | 26 + .../v2020_02_15/EventGridDataConnection.java | 185 ++ .../v2020_02_15/EventGridDataFormat.java | 77 + .../v2020_02_15/EventHubDataConnection.java | 213 ++ .../kusto/v2020_02_15/EventHubDataFormat.java | 77 + .../FollowerDatabaseDefinition.java | 35 + .../kusto/v2020_02_15/Identity.java | 102 + .../kusto/v2020_02_15/IdentityType.java | 53 + .../IdentityUserAssignedIdentitiesValue.java | 47 + .../v2020_02_15/IotHubDataConnection.java | 212 ++ .../kusto/v2020_02_15/IotHubDataFormat.java | 77 + .../kusto/v2020_02_15/KeyVaultProperties.java | 95 + .../kusto/v2020_02_15/LanguageExtension.java | 25 + .../v2020_02_15/LanguageExtensionName.java | 41 + .../v2020_02_15/LanguageExtensionsList.java | 45 + .../kusto/v2020_02_15/Operation.java | 40 + .../kusto/v2020_02_15/OperationDisplay.java | 122 + .../kusto/v2020_02_15/Operations.java | 27 + .../kusto/v2020_02_15/OptimizedAutoscale.java | 122 + .../kusto/v2020_02_15/PrincipalType.java | 44 + .../PrincipalsModificationKind.java | 44 + .../kusto/v2020_02_15/ProvisioningState.java | 53 + .../ReadOnlyFollowingDatabase.java | 155 + .../kusto/v2020_02_15/ReadWriteDatabase.java | 135 + .../management/kusto/v2020_02_15/Reason.java | 41 + .../kusto/v2020_02_15/SkuDescription.java | 51 + .../v2020_02_15/SkuLocationInfoItem.java | 70 + .../management/kusto/v2020_02_15/State.java | 62 + .../v2020_02_15/TrustedExternalTenant.java | 43 + .../management/kusto/v2020_02_15/Type.java | 53 + .../VirtualNetworkConfiguration.java | 95 + .../AttachedDatabaseConfigurationImpl.java | 151 + .../AttachedDatabaseConfigurationInner.java | 162 + .../AttachedDatabaseConfigurationsImpl.java | 85 + .../AttachedDatabaseConfigurationsInner.java | 625 ++++ .../implementation/AzureResourceSkuImpl.java | 47 + .../implementation/AzureResourceSkuInner.java | 97 + .../implementation/CheckNameResultImpl.java | 47 + .../implementation/CheckNameResultInner.java | 124 + .../implementation/ClusterImpl.java | 263 ++ .../implementation/ClusterInner.java | 394 +++ .../ClusterPrincipalAssignmentImpl.java | 156 + .../ClusterPrincipalAssignmentInner.java | 175 ++ .../ClusterPrincipalAssignmentsImpl.java | 98 + .../ClusterPrincipalAssignmentsInner.java | 725 +++++ .../implementation/ClustersImpl.java | 275 ++ .../implementation/ClustersInner.java | 2638 +++++++++++++++++ .../implementation/DataConnectionImpl.java | 108 + .../implementation/DataConnectionInner.java | 54 + ...ataConnectionValidationListResultImpl.java | 33 + ...taConnectionValidationListResultInner.java | 45 + .../implementation/DataConnectionsImpl.java | 112 + .../implementation/DataConnectionsInner.java | 1091 +++++++ .../implementation/DatabaseImpl.java | 105 + .../implementation/DatabaseInner.java | 53 + .../DatabasePrincipalAssignmentImpl.java | 159 + .../DatabasePrincipalAssignmentInner.java | 175 ++ .../DatabasePrincipalAssignmentsImpl.java | 98 + .../DatabasePrincipalAssignmentsInner.java | 774 +++++ .../implementation/DatabasePrincipalImpl.java | 63 + .../DatabasePrincipalInner.java | 192 ++ .../DatabasePrincipalListResultImpl.java | 32 + .../DatabasePrincipalListResultInner.java | 44 + .../implementation/DatabasesImpl.java | 143 + .../implementation/DatabasesInner.java | 1410 +++++++++ .../DiagnoseVirtualNetworkResultImpl.java | 32 + .../DiagnoseVirtualNetworkResultInner.java | 44 + .../FollowerDatabaseDefinitionImpl.java | 41 + .../FollowerDatabaseDefinitionInner.java | 87 + .../implementation/IdParsingUtils.java | 57 + .../KustoManagementClientImpl.java | 282 ++ .../implementation/KustoManager.java | 171 ++ .../implementation/LanguageExtensionImpl.java | 32 + .../LanguageExtensionInner.java | 44 + .../implementation/OperationImpl.java | 47 + .../implementation/OperationInner.java | 123 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 ++ .../v2020_02_15/implementation/PageImpl.java | 75 + .../v2020_02_15/implementation/PageImpl1.java | 75 + .../implementation/SkuDescriptionImpl.java | 58 + .../implementation/SkuDescriptionInner.java | 109 + .../implementation/package-info.java | 11 + .../kusto/v2020_02_15/package-info.java | 11 + 123 files changed, 18509 insertions(+) create mode 100644 sdk/kusto/mgmt-v2020_02_15/pom.xml create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfiguration.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfigurations.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureCapacity.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureEntityResource.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureResourceSku.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureScaleType.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSku.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuName.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuTier.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameResult.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Cluster.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignment.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignmentCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignments.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalRole.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterUpdate.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Clusters.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Compression.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidation.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationListResult.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationResult.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnections.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Database.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipal.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignment.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignmentCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignments.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListRequest.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListResult.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalRole.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalType.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabaseStatistics.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Databases.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DefaultPrincipalsModificationKind.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DiagnoseVirtualNetworkResult.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataFormat.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataFormat.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/FollowerDatabaseDefinition.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Identity.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityType.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityUserAssignedIdentitiesValue.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataFormat.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/KeyVaultProperties.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtension.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionName.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionsList.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operation.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OperationDisplay.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operations.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OptimizedAutoscale.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalType.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalsModificationKind.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ProvisioningState.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadOnlyFollowingDatabase.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadWriteDatabase.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Reason.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuDescription.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuLocationInfoItem.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/State.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/TrustedExternalTenant.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Type.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/VirtualNetworkConfiguration.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/IdParsingUtils.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManagementClientImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManager.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl1.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionInner.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/package-info.java create mode 100644 sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/package-info.java diff --git a/sdk/kusto/mgmt-v2020_02_15/pom.xml b/sdk/kusto/mgmt-v2020_02_15/pom.xml new file mode 100644 index 000000000000..f9c05a99ac67 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.kusto.v2020_02_15 + + com.microsoft.azure + azure-arm-parent + 1.3.0 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-kusto + 1.0.0-beta + jar + Microsoft Azure SDK for Kusto Management + This package contains Microsoft Kusto Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfiguration.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfiguration.java new file mode 100644 index 000000000000..e092f2f97fea --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfiguration.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.AttachedDatabaseConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import java.util.List; + +/** + * Type representing AttachedDatabaseConfiguration. + */ +public interface AttachedDatabaseConfiguration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the attachedDatabaseNames value. + */ + List attachedDatabaseNames(); + + /** + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * @return the databaseName value. + */ + String databaseName(); + + /** + * @return the defaultPrincipalsModificationKind value. + */ + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the AttachedDatabaseConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithClusterResourceId, DefinitionStages.WithDatabaseName, DefinitionStages.WithDefaultPrincipalsModificationKind, DefinitionStages.WithCreate { + } + + /** + * Grouping of AttachedDatabaseConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AttachedDatabaseConfiguration definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * 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 + */ + WithClusterResourceId withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify ClusterResourceId. + */ + interface WithClusterResourceId { + /** + * Specifies clusterResourceId. + * @param clusterResourceId The resource id of the cluster where the databases you would like to attach reside + * @return the next definition stage + */ + WithDatabaseName withClusterResourceId(String clusterResourceId); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify DatabaseName. + */ + interface WithDatabaseName { + /** + * Specifies databaseName. + * @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 + */ + WithDefaultPrincipalsModificationKind withDatabaseName(String databaseName); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify DefaultPrincipalsModificationKind. + */ + interface WithDefaultPrincipalsModificationKind { + /** + * Specifies defaultPrincipalsModificationKind. + * @param defaultPrincipalsModificationKind The default principals modification kind. Possible values include: 'Union', 'Replace', 'None' + * @return the next definition stage + */ + WithCreate withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind defaultPrincipalsModificationKind); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation { + } + } + /** + * The template for a AttachedDatabaseConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of AttachedDatabaseConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the attacheddatabaseconfiguration update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfigurations.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfigurations.java new file mode 100644 index 000000000000..d0fee4d4c13e --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AttachedDatabaseConfigurations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.AttachedDatabaseConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AttachedDatabaseConfigurations. + */ +public interface AttachedDatabaseConfigurations extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * 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 + * @return the observable for the request + */ + Observable listByClusterAsync(String resourceGroupName, String clusterName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureCapacity.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureCapacity.java new file mode 100644 index 000000000000..f8c03331131a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureCapacity.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure capacity definition. + */ +public class AzureCapacity { + /** + * Scale type. Possible values include: 'automatic', 'manual', 'none'. + */ + @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 scale type. Possible values include: 'automatic', 'manual', 'none'. + * + * @return the scaleType value + */ + public AzureScaleType scaleType() { + return this.scaleType; + } + + /** + * Set scale type. Possible values include: 'automatic', 'manual', 'none'. + * + * @param scaleType the scaleType value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withScaleType(AzureScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Get minimum allowed capacity. + * + * @return the minimum value + */ + public int minimum() { + return this.minimum; + } + + /** + * Set 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 maximum allowed capacity. + * + * @return the maximum value + */ + public int maximum() { + return this.maximum; + } + + /** + * Set 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 default capacity that would be used. + * + * @return the defaultProperty value + */ + public int defaultProperty() { + return this.defaultProperty; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureEntityResource.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureEntityResource.java new file mode 100644 index 000000000000..c714f5317317 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureResourceSku.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureResourceSku.java new file mode 100644 index 000000000000..f6b27b54cc8a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureResourceSku.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.AzureResourceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; + +/** + * Type representing AzureResourceSku. + */ +public interface AzureResourceSku extends HasInner, HasManager { + /** + * @return the capacity value. + */ + AzureCapacity capacity(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the sku value. + */ + AzureSku sku(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureScaleType.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureScaleType.java new file mode 100644 index 000000000000..2beacc36e288 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureScaleType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSku.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSku.java new file mode 100644 index 000000000000..d147e9bae1a2 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSku.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure SKU definition. + */ +public class AzureSku { + /** + * SKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', + * 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', + * 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', + * 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', + * 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2', 'Standard_E2a_v4', + * 'Standard_E4a_v4', 'Standard_E8a_v4', 'Standard_E16a_v4', + * 'Standard_E8as_v4+1TB_PS', 'Standard_E8as_v4+2TB_PS', + * 'Standard_E16as_v4+3TB_PS', 'Standard_E16as_v4+4TB_PS', 'Dev(No + * SLA)_Standard_E2a_v4'. + */ + @JsonProperty(value = "name", required = true) + private AzureSkuName name; + + /** + * The number of instances of the cluster. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * SKU tier. Possible values include: 'Basic', 'Standard'. + */ + @JsonProperty(value = "tier", required = true) + private AzureSkuTier tier; + + /** + * Get sKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2', 'Standard_E2a_v4', 'Standard_E4a_v4', 'Standard_E8a_v4', 'Standard_E16a_v4', 'Standard_E8as_v4+1TB_PS', 'Standard_E8as_v4+2TB_PS', 'Standard_E16as_v4+3TB_PS', 'Standard_E16as_v4+4TB_PS', 'Dev(No SLA)_Standard_E2a_v4'. + * + * @return the name value + */ + public AzureSkuName name() { + return this.name; + } + + /** + * Set sKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2', 'Standard_E2a_v4', 'Standard_E4a_v4', 'Standard_E8a_v4', 'Standard_E16a_v4', 'Standard_E8as_v4+1TB_PS', 'Standard_E8as_v4+2TB_PS', 'Standard_E16as_v4+3TB_PS', 'Standard_E16as_v4+4TB_PS', 'Dev(No SLA)_Standard_E2a_v4'. + * + * @param name the name value to set + * @return the AzureSku object itself. + */ + public AzureSku withName(AzureSkuName name) { + this.name = name; + return this; + } + + /** + * Get the number of instances of the cluster. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set 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 sKU tier. Possible values include: 'Basic', 'Standard'. + * + * @return the tier value + */ + public AzureSkuTier tier() { + return this.tier; + } + + /** + * Set sKU tier. Possible values include: 'Basic', 'Standard'. + * + * @param tier the tier value to set + * @return the AzureSku object itself. + */ + public AzureSku withTier(AzureSkuTier tier) { + this.tier = tier; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuName.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuName.java new file mode 100644 index 000000000000..770c8aa444cf --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuName.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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_V21TB_PS = fromString("Standard_DS13_v2+1TB_PS"); + + /** Static value Standard_DS13_v2+2TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS13_V22TB_PS = fromString("Standard_DS13_v2+2TB_PS"); + + /** Static value Standard_DS14_v2+3TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V23TB_PS = fromString("Standard_DS14_v2+3TB_PS"); + + /** Static value Standard_DS14_v2+4TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V24TB_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_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_V41TB_PS = fromString("Standard_E8as_v4+1TB_PS"); + + /** Static value Standard_E8as_v4+2TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E8AS_V42TB_PS = fromString("Standard_E8as_v4+2TB_PS"); + + /** Static value Standard_E16as_v4+3TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16AS_V43TB_PS = fromString("Standard_E16as_v4+3TB_PS"); + + /** Static value Standard_E16as_v4+4TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16AS_V44TB_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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuTier.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuTier.java new file mode 100644 index 000000000000..1bb1f43599cf --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/AzureSkuTier.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameRequest.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameRequest.java new file mode 100644 index 000000000000..3f169abe7e9a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameRequest.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a database check name availability request. + */ +public class CheckNameRequest { + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, for instance Microsoft.Kusto/clusters/databases. + * Possible values include: 'Microsoft.Kusto/clusters/databases', + * 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + */ + @JsonProperty(value = "type", required = true) + private Type type; + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'Microsoft.Kusto/clusters/databases', 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + * + * @return the type value + */ + public Type type() { + return this.type; + } + + /** + * Set the type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'Microsoft.Kusto/clusters/databases', 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + * + * @param type the type value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withType(Type type) { + this.type = type; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameResult.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameResult.java new file mode 100644 index 000000000000..3bb3b1f4c2bf --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/CheckNameResult.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.CheckNameResultInner; + +/** + * Type representing CheckNameResult. + */ +public interface CheckNameResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + Reason reason(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Cluster.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Cluster.java new file mode 100644 index 000000000000..740faa97eaaa --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Cluster.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dataIngestionUri value. + */ + String dataIngestionUri(); + + /** + * @return the enableDiskEncryption value. + */ + Boolean enableDiskEncryption(); + + /** + * @return the enablePurge value. + */ + Boolean enablePurge(); + + /** + * @return the enableStreamingIngest value. + */ + Boolean enableStreamingIngest(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the keyVaultProperties value. + */ + KeyVaultProperties keyVaultProperties(); + + /** + * @return the languageExtensions value. + */ + LanguageExtensionsList languageExtensions(); + + /** + * @return the optimizedAutoscale value. + */ + OptimizedAutoscale optimizedAutoscale(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + AzureSku sku(); + + /** + * @return the state value. + */ + State state(); + + /** + * @return the stateReason value. + */ + String stateReason(); + + /** + * @return the trustedExternalTenants value. + */ + List trustedExternalTenants(); + + /** + * @return the uri value. + */ + String uri(); + + /** + * @return the virtualNetworkConfiguration value. + */ + VirtualNetworkConfiguration virtualNetworkConfiguration(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cluster definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cluster definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the cluster + * @return the next definition stage +*/ + WithCreate withSku(AzureSku sku); + } + + /** + * The stage of the cluster definition allowing to specify EnableDiskEncryption. + */ + interface WithEnableDiskEncryption { + /** + * Specifies enableDiskEncryption. + * @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 EnablePurge. + */ + interface WithEnablePurge { + /** + * Specifies enablePurge. + * @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 EnableStreamingIngest. + */ + interface WithEnableStreamingIngest { + /** + * Specifies enableStreamingIngest. + * @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 Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @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 KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @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 LanguageExtensions. + */ + interface WithLanguageExtensions { + /** + * Specifies languageExtensions. + * @param languageExtensions List of the cluster's language extensions + * @return the next definition stage + */ + WithCreate withLanguageExtensions(LanguageExtensionsList languageExtensions); + } + + /** + * The stage of the cluster definition allowing to specify OptimizedAutoscale. + */ + interface WithOptimizedAutoscale { + /** + * Specifies optimizedAutoscale. + * @param optimizedAutoscale Optimized auto scale definition + * @return the next definition stage + */ + WithCreate withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + + /** + * The stage of the cluster definition allowing to specify TrustedExternalTenants. + */ + interface WithTrustedExternalTenants { + /** + * Specifies trustedExternalTenants. + * @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 VirtualNetworkConfiguration. + */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies virtualNetworkConfiguration. + * @param virtualNetworkConfiguration Virtual network definition + * @return the next definition stage + */ + WithCreate withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + + /** + * The stage of the cluster definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones The availability zones of the cluster + * @return the next definition stage + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEnableDiskEncryption, DefinitionStages.WithEnablePurge, DefinitionStages.WithEnableStreamingIngest, DefinitionStages.WithIdentity, DefinitionStages.WithKeyVaultProperties, DefinitionStages.WithLanguageExtensions, DefinitionStages.WithOptimizedAutoscale, DefinitionStages.WithTrustedExternalTenants, DefinitionStages.WithVirtualNetworkConfiguration, DefinitionStages.WithZones { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEnableDiskEncryption, UpdateStages.WithEnablePurge, UpdateStages.WithEnableStreamingIngest, UpdateStages.WithIdentity, UpdateStages.WithKeyVaultProperties, UpdateStages.WithLanguageExtensions, UpdateStages.WithOptimizedAutoscale, UpdateStages.WithSku, UpdateStages.WithTrustedExternalTenants, UpdateStages.WithVirtualNetworkConfiguration { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify EnableDiskEncryption. + */ + interface WithEnableDiskEncryption { + /** + * Specifies enableDiskEncryption. + * @param enableDiskEncryption A boolean value that indicates if the cluster's disks are encrypted + * @return the next update stage + */ + Update withEnableDiskEncryption(Boolean enableDiskEncryption); + } + + /** + * The stage of the cluster update allowing to specify EnablePurge. + */ + interface WithEnablePurge { + /** + * Specifies enablePurge. + * @param enablePurge A boolean value that indicates if the purge operations are enabled + * @return the next update stage + */ + Update withEnablePurge(Boolean enablePurge); + } + + /** + * The stage of the cluster update allowing to specify EnableStreamingIngest. + */ + interface WithEnableStreamingIngest { + /** + * Specifies enableStreamingIngest. + * @param enableStreamingIngest A boolean value that indicates if the streaming ingest is enabled + * @return the next update stage + */ + Update withEnableStreamingIngest(Boolean enableStreamingIngest); + } + + /** + * The stage of the cluster update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the cluster, if configured + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the cluster update allowing to specify KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @param keyVaultProperties KeyVault properties for the cluster encryption + * @return the next update stage + */ + Update withKeyVaultProperties(KeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the cluster update allowing to specify LanguageExtensions. + */ + interface WithLanguageExtensions { + /** + * Specifies languageExtensions. + * @param languageExtensions List of the cluster's language extensions + * @return the next update stage + */ + Update withLanguageExtensions(LanguageExtensionsList languageExtensions); + } + + /** + * The stage of the cluster update allowing to specify OptimizedAutoscale. + */ + interface WithOptimizedAutoscale { + /** + * Specifies optimizedAutoscale. + * @param optimizedAutoscale Optimized auto scale definition + * @return the next update stage + */ + Update withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + + /** + * The stage of the cluster update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the cluster + * @return the next update stage + */ + Update withSku(AzureSku sku); + } + + /** + * The stage of the cluster update allowing to specify TrustedExternalTenants. + */ + interface WithTrustedExternalTenants { + /** + * Specifies trustedExternalTenants. + * @param trustedExternalTenants The cluster's external tenants + * @return the next update stage + */ + Update withTrustedExternalTenants(List trustedExternalTenants); + } + + /** + * The stage of the cluster update allowing to specify VirtualNetworkConfiguration. + */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies virtualNetworkConfiguration. + * @param virtualNetworkConfiguration Virtual network definition + * @return the next update stage + */ + Update withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterCheckNameRequest.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterCheckNameRequest.java new file mode 100644 index 000000000000..a5be600e4ea6 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterCheckNameRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a cluster check name availability request. + */ +public class ClusterCheckNameRequest { + /** + * 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. + * @param name cluster name. + */ + public ClusterCheckNameRequest() { + type = "Microsoft.Kusto/clusters"; + } + + /** + * Get cluster name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of resource, Microsoft.Kusto/clusters. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignment.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignment.java new file mode 100644 index 000000000000..5a7cc91b5887 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignment.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.ClusterPrincipalAssignmentInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; + +/** + * Type representing ClusterPrincipalAssignment. + */ +public interface ClusterPrincipalAssignment extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the principalId value. + */ + String principalId(); + + /** + * @return the principalName value. + */ + String principalName(); + + /** + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the role value. + */ + ClusterPrincipalRole role(); + + /** + * @return the tenantId value. + */ + String tenantId(); + + /** + * @return the tenantName value. + */ + String tenantName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ClusterPrincipalAssignment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithPrincipalId, DefinitionStages.WithPrincipalType, DefinitionStages.WithRole, DefinitionStages.WithCreate { + } + + /** + * Grouping of ClusterPrincipalAssignment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ClusterPrincipalAssignment definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * 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 + */ + WithPrincipalId withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify PrincipalId. + */ + interface WithPrincipalId { + /** + * Specifies principalId. + * @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 + */ + WithPrincipalType withPrincipalId(String principalId); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify PrincipalType. + */ + interface WithPrincipalType { + /** + * Specifies principalType. + * @param principalType Principal type. Possible values include: 'App', 'Group', 'User' + * @return the next definition stage + */ + WithRole withPrincipalType(PrincipalType principalType); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify Role. + */ + interface WithRole { + /** + * Specifies role. + * @param role Cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer' + * @return the next definition stage + */ + WithCreate withRole(ClusterPrincipalRole role); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next definition stage + */ + WithCreate withTenantId(String tenantId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTenantId { + } + } + /** + * The template for a ClusterPrincipalAssignment update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTenantId { + } + + /** + * Grouping of ClusterPrincipalAssignment update stages. + */ + interface UpdateStages { + /** + * The stage of the clusterprincipalassignment update allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next update stage + */ + Update withTenantId(String tenantId); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignmentCheckNameRequest.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignmentCheckNameRequest.java new file mode 100644 index 000000000000..6e1b60caa709 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignmentCheckNameRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A principal assignment check name availability request. + */ +public class ClusterPrincipalAssignmentCheckNameRequest { + /** + * 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. + * @param name principal Assignment resource name. + */ + public ClusterPrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Kusto/clusters/principalAssignments"; + } + + /** + * Get principal Assignment resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of resource, Microsoft.Kusto/clusters/principalAssignments. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignments.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignments.java new file mode 100644 index 000000000000..b79c14882146 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalAssignments.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.ClusterPrincipalAssignmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ClusterPrincipalAssignments. + */ +public interface ClusterPrincipalAssignments extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String principalAssignmentName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String clusterName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalRole.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalRole.java new file mode 100644 index 000000000000..8629e063eb27 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterPrincipalRole.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterUpdate.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterUpdate.java new file mode 100644 index 000000000000..c6880e897f50 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ClusterUpdate.java @@ -0,0 +1,412 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an update to a Kusto cluster. + */ +@JsonFlatten +public class ClusterUpdate extends ProxyResource { + /** + * 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. Possible values include: 'Creating', + * 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', + * 'Starting', 'Updating'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @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") + private LanguageExtensionsList languageExtensions; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set 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 resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set 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 of the cluster. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set 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 of the cluster, if configured. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set 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 of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the cluster URI. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Get the cluster data ingestion URI. + * + * @return the dataIngestionUri value + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the reason for the cluster's current state. + * + * @return the stateReason value + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the cluster's external tenants. + * + * @return the trustedExternalTenants value + */ + public List trustedExternalTenants() { + return this.trustedExternalTenants; + } + + /** + * Set 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 optimized auto scale definition. + * + * @return the optimizedAutoscale value + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set 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 a boolean value that indicates if the cluster's disks are encrypted. + * + * @return the enableDiskEncryption value + */ + public Boolean enableDiskEncryption() { + return this.enableDiskEncryption; + } + + /** + * Set 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 a boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set 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 virtual network definition. + * + * @return the virtualNetworkConfiguration value + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set 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 keyVault properties for the cluster encryption. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set 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 a boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set 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 list of the cluster's language extensions. + * + * @return the languageExtensions value + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Set list of the cluster's language extensions. + * + * @param languageExtensions the languageExtensions value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withLanguageExtensions(LanguageExtensionsList languageExtensions) { + this.languageExtensions = languageExtensions; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Clusters.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Clusters.java new file mode 100644 index 000000000000..e7c8dcff51fa --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Clusters.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.FollowerDatabaseDefinitionInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_02_15.AzureResourceSku; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable stopAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listFollowerDatabasesAsync(String resourceGroupName, String clusterName); + + /** + * 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 + * @return the observable for the request + */ + Completable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * 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 + * @return the observable for the request + */ + Observable diagnoseVirtualNetworkAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listLanguageExtensionsAsync(String resourceGroupName, String clusterName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable addLanguageExtensionsAsync(String resourceGroupName, String clusterName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName); + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, String name); + + /** + * 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 + * @return the observable for the request + */ + Observable listSkusByResourceAsync(String resourceGroupName, String clusterName); + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSkusAsync(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Compression.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Compression.java new file mode 100644 index 000000000000..ffd6443ca7ad --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Compression.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnection.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnection.java new file mode 100644 index 000000000000..008ff5e3daa1 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnection.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DataConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; + +/** + * Type representing DataConnection. + */ +public interface DataConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DataConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataConnection definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the dataconnection definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * 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 withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName); + } + + /** + * The stage of the dataconnection definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation { + } + } + /** + * The template for a DataConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of DataConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the dataconnection update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionCheckNameRequest.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionCheckNameRequest.java new file mode 100644 index 000000000000..be2c33e30550 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionCheckNameRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A data connection check name availability request. + */ +public class DataConnectionCheckNameRequest { + /** + * 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. + * @param name data Connection name. + */ + public DataConnectionCheckNameRequest() { + type = "Microsoft.Kusto/clusters/databases/dataConnections"; + } + + /** + * Get data Connection name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of resource, Microsoft.Kusto/clusters/databases/dataConnections. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidation.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidation.java new file mode 100644 index 000000000000..3bbbcd26c0dd --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidation.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing an data connection validation. + */ +public class DataConnectionValidation { + /** + * 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 name of the data connection. + * + * @return the dataConnectionName value + */ + public String dataConnectionName() { + return this.dataConnectionName; + } + + /** + * Set the name of the data connection. + * + * @param dataConnectionName the dataConnectionName value to set + * @return the DataConnectionValidation object itself. + */ + public DataConnectionValidation withDataConnectionName(String dataConnectionName) { + this.dataConnectionName = dataConnectionName; + return this; + } + + /** + * Get the data connection properties to validate. + * + * @return the properties value + */ + public DataConnectionInner properties() { + return this.properties; + } + + /** + * Set the data connection properties to validate. + * + * @param properties the properties value to set + * @return the DataConnectionValidation object itself. + */ + public DataConnectionValidation withProperties(DataConnectionInner properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationListResult.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationListResult.java new file mode 100644 index 000000000000..98df890c0e3e --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DataConnectionValidationListResultInner; +import java.util.List; + +/** + * Type representing DataConnectionValidationListResult. + */ +public interface DataConnectionValidationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationResult.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationResult.java new file mode 100644 index 000000000000..77848f45d8a4 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnectionValidationResult.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a data connection validation request. + */ +public class DataConnectionValidationResult { + /** + * A message which indicates a problem in data connection validation. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get a message which indicates a problem in data connection validation. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnections.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnections.java new file mode 100644 index 000000000000..5ad29660f230 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DataConnections.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DataConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataConnections. + */ +public interface DataConnections extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * 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 + * @return the observable for the request + */ + Observable listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * 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 + * @return the observable for the request + */ + Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters); + + /** + * 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 name Data Connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Database.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Database.java new file mode 100644 index 000000000000..9eb3ebc3a831 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Database.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabaseInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; + +/** + * Type representing Database. + */ +public interface Database extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Database definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Database definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Database definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the database definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * 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 database definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation { + } + } + /** + * The template for a Database update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of Database update stages. + */ + interface UpdateStages { + /** + * The stage of the database update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipal.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipal.java new file mode 100644 index 000000000000..0b8ba69b1d9e --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipal.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabasePrincipalInner; + +/** + * Type representing DatabasePrincipal. + */ +public interface DatabasePrincipal extends HasInner, HasManager { + /** + * @return the appId value. + */ + String appId(); + + /** + * @return the email value. + */ + String email(); + + /** + * @return the fqn value. + */ + String fqn(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the role value. + */ + DatabasePrincipalRole role(); + + /** + * @return the tenantName value. + */ + String tenantName(); + + /** + * @return the type value. + */ + DatabasePrincipalType type(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignment.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignment.java new file mode 100644 index 000000000000..66af36453f0d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignment.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabasePrincipalAssignmentInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; + +/** + * Type representing DatabasePrincipalAssignment. + */ +public interface DatabasePrincipalAssignment extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the principalId value. + */ + String principalId(); + + /** + * @return the principalName value. + */ + String principalName(); + + /** + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the role value. + */ + DatabasePrincipalRole role(); + + /** + * @return the tenantId value. + */ + String tenantId(); + + /** + * @return the tenantName value. + */ + String tenantName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DatabasePrincipalAssignment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithPrincipalId, DefinitionStages.WithPrincipalType, DefinitionStages.WithRole, DefinitionStages.WithCreate { + } + + /** + * Grouping of DatabasePrincipalAssignment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DatabasePrincipalAssignment definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * 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 + */ + WithPrincipalId withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify PrincipalId. + */ + interface WithPrincipalId { + /** + * Specifies principalId. + * @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 + */ + WithPrincipalType withPrincipalId(String principalId); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify PrincipalType. + */ + interface WithPrincipalType { + /** + * Specifies principalType. + * @param principalType Principal type. Possible values include: 'App', 'Group', 'User' + * @return the next definition stage + */ + WithRole withPrincipalType(PrincipalType principalType); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify Role. + */ + interface WithRole { + /** + * Specifies role. + * @param role Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' + * @return the next definition stage + */ + WithCreate withRole(DatabasePrincipalRole role); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next definition stage + */ + WithCreate withTenantId(String tenantId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTenantId { + } + } + /** + * The template for a DatabasePrincipalAssignment update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTenantId { + } + + /** + * Grouping of DatabasePrincipalAssignment update stages. + */ + interface UpdateStages { + /** + * The stage of the databaseprincipalassignment update allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next update stage + */ + Update withTenantId(String tenantId); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignmentCheckNameRequest.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignmentCheckNameRequest.java new file mode 100644 index 000000000000..973e5d611526 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignmentCheckNameRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A principal assignment check name availability request. + */ +public class DatabasePrincipalAssignmentCheckNameRequest { + /** + * 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. + * @param name principal Assignment resource name. + */ + public DatabasePrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Kusto/clusters/databases/principalAssignments"; + } + + /** + * Get principal Assignment resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignments.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignments.java new file mode 100644 index 000000000000..02f07b4cb841 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalAssignments.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabasePrincipalAssignmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DatabasePrincipalAssignments. + */ +public interface DatabasePrincipalAssignments extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListRequest.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListRequest.java new file mode 100644 index 000000000000..ba12aed5aaa3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListRequest.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabasePrincipalInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto database principals operation request. + */ +public class DatabasePrincipalListRequest { + /** + * The list of Kusto database principals. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto database principals. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListResult.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListResult.java new file mode 100644 index 000000000000..1b2a072450f0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabasePrincipalListResultInner; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabasePrincipalInner; +import java.util.List; + +/** + * Type representing DatabasePrincipalListResult. + */ +public interface DatabasePrincipalListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalRole.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalRole.java new file mode 100644 index 000000000000..62e4aefd02bb --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalRole.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalType.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalType.java new file mode 100644 index 000000000000..8799a10ba0f3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabasePrincipalType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabaseStatistics.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabaseStatistics.java new file mode 100644 index 000000000000..cec3718cb2c5 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DatabaseStatistics.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains database statistics information. + */ +public class DatabaseStatistics { + /** + * The database size - the total size of compressed data and index in + * bytes. + */ + @JsonProperty(value = "size") + private Double size; + + /** + * Get the database size - the total size of compressed data and index in bytes. + * + * @return the size value + */ + public Double size() { + return this.size; + } + + /** + * Set 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(Double size) { + this.size = size; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Databases.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Databases.java new file mode 100644 index 000000000000..0854e119cd30 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Databases.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabasesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Databases. + */ +public interface Databases extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable removePrincipalsAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * 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 + * @return the observable for the request + */ + Observable listByClusterAsync(String resourceGroupName, String clusterName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * 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 + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DefaultPrincipalsModificationKind.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DefaultPrincipalsModificationKind.java new file mode 100644 index 000000000000..d6ad40ab9a1f --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DefaultPrincipalsModificationKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DiagnoseVirtualNetworkResult.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DiagnoseVirtualNetworkResult.java new file mode 100644 index 000000000000..8e7f1a39cb62 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/DiagnoseVirtualNetworkResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DiagnoseVirtualNetworkResultInner; +import java.util.List; + +/** + * Type representing DiagnoseVirtualNetworkResult. + */ +public interface DiagnoseVirtualNetworkResult extends HasInner, HasManager { + /** + * @return the findings value. + */ + List findings(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataConnection.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataConnection.java new file mode 100644 index 000000000000..3586cefd251d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataConnection.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DataConnectionInner; + +/** + * Class representing an Event Grid data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = EventGridDataConnection.class) +@JsonTypeName("EventGrid") +@JsonFlatten +public class EventGridDataConnection extends DataConnectionInner { + /** + * The resource ID of the storage account where the data resides. + */ + @JsonProperty(value = "properties.storageAccountResourceId", required = true) + private String storageAccountResourceId; + + /** + * The resource ID where the event grid is configured to send events. + */ + @JsonProperty(value = "properties.eventHubResourceId", required = true) + private String eventHubResourceId; + + /** + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + 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", required = true) + 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. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', + * 'TSVE', 'PARQUET', 'ORC'. + */ + @JsonProperty(value = "properties.dataFormat", required = true) + private EventGridDataFormat dataFormat; + + /** + * Get the resource ID of the storage account where the data resides. + * + * @return the storageAccountResourceId value + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set 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 resource ID where the event grid is configured to send events. + * + * @return the eventHubResourceId value + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set 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 event hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set 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 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 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 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 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 data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC'. + * + * @return the dataFormat value + */ + public EventGridDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC'. + * + * @param dataFormat the dataFormat value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withDataFormat(EventGridDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataFormat.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataFormat.java new file mode 100644 index 000000000000..77a06e72cf74 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventGridDataFormat.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataConnection.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataConnection.java new file mode 100644 index 000000000000..69b2c1cb946a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataConnection.java @@ -0,0 +1,213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DataConnectionInner; + +/** + * Class representing an event hub data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = EventHubDataConnection.class) +@JsonTypeName("EventHub") +@JsonFlatten +public class EventHubDataConnection extends DataConnectionInner { + /** + * The resource ID of the event hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.eventHubResourceId", required = true) + private String eventHubResourceId; + + /** + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + 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. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', + * 'TSVE', 'PARQUET', 'ORC'. + */ + @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. Possible values include: + * 'None', 'GZip'. + */ + @JsonProperty(value = "properties.compression") + private Compression compression; + + /** + * Get 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 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 event hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set 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 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 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 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 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 data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC'. + * + * @return the dataFormat value + */ + public EventHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC'. + * + * @param dataFormat the dataFormat value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withDataFormat(EventHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get system properties of the event hub. + * + * @return the eventSystemProperties value + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set 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 event hub messages compression type. Possible values include: 'None', 'GZip'. + * + * @return the compression value + */ + public Compression compression() { + return this.compression; + } + + /** + * Set the event hub messages compression type. Possible values include: 'None', 'GZip'. + * + * @param compression the compression value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withCompression(Compression compression) { + this.compression = compression; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataFormat.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataFormat.java new file mode 100644 index 000000000000..c737c431dccc --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/EventHubDataFormat.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/FollowerDatabaseDefinition.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/FollowerDatabaseDefinition.java new file mode 100644 index 000000000000..636d6c187150 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/FollowerDatabaseDefinition.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.FollowerDatabaseDefinitionInner; + +/** + * Type representing FollowerDatabaseDefinition. + */ +public interface FollowerDatabaseDefinition extends HasInner, HasManager { + /** + * @return the attachedDatabaseConfigurationName value. + */ + String attachedDatabaseConfigurationName(); + + /** + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * @return the databaseName value. + */ + String databaseName(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Identity.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Identity.java new file mode 100644 index 000000000000..136fa8ee8c49 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Identity.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * 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 identity type. Possible values include: 'None', 'SystemAssigned'. + */ + @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 principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'None', 'SystemAssigned'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'None', 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get 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 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityType.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityType.java new file mode 100644 index 000000000000..229d6df255a8 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IdentityType. + */ +public enum IdentityType { + /** Enum value None. */ + NONE("None"), + + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a IdentityType instance. */ + private String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + @JsonCreator + public static IdentityType fromString(String value) { + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityUserAssignedIdentitiesValue.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityUserAssignedIdentitiesValue.java new file mode 100644 index 000000000000..66d9c2eb260f --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IdentityUserAssignedIdentitiesValue model. + */ +public class IdentityUserAssignedIdentitiesValue { + /** + * 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 principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataConnection.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataConnection.java new file mode 100644 index 000000000000..a957a9dd6b4b --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataConnection.java @@ -0,0 +1,212 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DataConnectionInner; + +/** + * Class representing an iot hub data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = IotHubDataConnection.class) +@JsonTypeName("IotHub") +@JsonFlatten +public class IotHubDataConnection extends DataConnectionInner { + /** + * The resource ID of the Iot hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.iotHubResourceId", required = true) + private String iotHubResourceId; + + /** + * The iot hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + 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. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', + * 'TSVE', 'PARQUET', 'ORC'. + */ + @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", required = true) + private String sharedAccessPolicyName; + + /** + * Get 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 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 iot hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set 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 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 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 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 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 data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC'. + * + * @return the dataFormat value + */ + public IotHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC'. + * + * @param dataFormat the dataFormat value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withDataFormat(IotHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get system properties of the iot hub. + * + * @return the eventSystemProperties value + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set 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 name of the share access policy. + * + * @return the sharedAccessPolicyName value + */ + public String sharedAccessPolicyName() { + return this.sharedAccessPolicyName; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataFormat.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataFormat.java new file mode 100644 index 000000000000..b8c15f52820d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/IotHubDataFormat.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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"); + + /** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/KeyVaultProperties.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/KeyVaultProperties.java new file mode 100644 index 000000000000..5a6821f853d3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/KeyVaultProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the key vault. + */ +public class KeyVaultProperties { + /** + * 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", required = true) + private String keyVersion; + + /** + * The Uri of the key vault. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /** + * Get the name of the key vault key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set 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 version of the key vault key. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set 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 Uri of the key vault. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtension.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtension.java new file mode 100644 index 000000000000..32a08b9ecb1e --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtension.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.LanguageExtensionInner; + +/** + * Type representing LanguageExtension. + */ +public interface LanguageExtension extends HasInner, HasManager { + /** + * @return the languageExtensionName value. + */ + LanguageExtensionName languageExtensionName(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionName.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionName.java new file mode 100644 index 000000000000..5fa420b908b6 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionsList.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionsList.java new file mode 100644 index 000000000000..1faa04a30b50 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/LanguageExtensionsList.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.LanguageExtensionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of language extension objects. + */ +public class LanguageExtensionsList { + /** + * The list of language extensions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of language extensions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operation.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operation.java new file mode 100644 index 000000000000..85a349b68162 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + Object properties(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OperationDisplay.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OperationDisplay.java new file mode 100644 index 000000000000..4aeac3137f78 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OperationDisplay.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes the operation. + */ +public class OperationDisplay { + /** + * Friendly name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The operation type. + * 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 value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get for example: read, write, delete. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set 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 value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource value. + * + * @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 value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operations.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operations.java new file mode 100644 index 000000000000..f2f85f0f7bec --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OptimizedAutoscale.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OptimizedAutoscale.java new file mode 100644 index 000000000000..77a2c78f5c8e --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/OptimizedAutoscale.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains the optimized auto scale definition. + */ +public class OptimizedAutoscale { + /** + * 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 of the template defined, for instance 1. + * + * @return the version value + */ + public int version() { + return this.version; + } + + /** + * Set 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 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 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 minimum allowed instances count. + * + * @return the minimum value + */ + public int minimum() { + return this.minimum; + } + + /** + * Set 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 maximum allowed instances count. + * + * @return the maximum value + */ + public int maximum() { + return this.maximum; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalType.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalType.java new file mode 100644 index 000000000000..51f33eaf8306 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalsModificationKind.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalsModificationKind.java new file mode 100644 index 000000000000..44bae48d5d33 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/PrincipalsModificationKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ProvisioningState.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ProvisioningState.java new file mode 100644 index 000000000000..38589c50d485 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadOnlyFollowingDatabase.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadOnlyFollowingDatabase.java new file mode 100644 index 000000000000..0821cfe0e0e0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadOnlyFollowingDatabase.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabaseInner; + +/** + * Class representing a read only following database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = ReadOnlyFollowingDatabase.class) +@JsonTypeName("ReadOnlyFollowing") +@JsonFlatten +public class ReadOnlyFollowingDatabase extends DatabaseInner { + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @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 Period softDeletePeriod; + + /** + * The time the data should be kept in cache for fast queries in TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Period hotCachePeriod; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + 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. Possible values + * include: 'Union', 'Replace', 'None'. + */ + @JsonProperty(value = "properties.principalsModificationKind", access = JsonProperty.Access.WRITE_ONLY) + private PrincipalsModificationKind principalsModificationKind; + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @return the softDeletePeriod value + */ + public Period softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Get the time the data should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value + */ + public Period hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set 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(Period hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics of the database. + * + * @return the statistics value + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Set the statistics of the database. + * + * @param statistics the statistics value to set + * @return the ReadOnlyFollowingDatabase object itself. + */ + public ReadOnlyFollowingDatabase withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + + /** + * Get the name of the leader cluster. + * + * @return the leaderClusterResourceId value + */ + public String leaderClusterResourceId() { + return this.leaderClusterResourceId; + } + + /** + * Get the name of the attached database configuration cluster. + * + * @return the attachedDatabaseConfigurationName value + */ + public String attachedDatabaseConfigurationName() { + return this.attachedDatabaseConfigurationName; + } + + /** + * Get the principals modification kind of the database. Possible values include: 'Union', 'Replace', 'None'. + * + * @return the principalsModificationKind value + */ + public PrincipalsModificationKind principalsModificationKind() { + return this.principalsModificationKind; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadWriteDatabase.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadWriteDatabase.java new file mode 100644 index 000000000000..755b90ae0298 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/ReadWriteDatabase.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.DatabaseInner; + +/** + * Class representing a read write database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = ReadWriteDatabase.class) +@JsonTypeName("ReadWrite") +@JsonFlatten +public class ReadWriteDatabase extends DatabaseInner { + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @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 Period softDeletePeriod; + + /** + * The time the data should be kept in cache for fast queries in TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Period hotCachePeriod; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + private DatabaseStatistics statistics; + + /** + * Indicates whether the database is followed. + */ + @JsonProperty(value = "properties.isFollowed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isFollowed; + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @return the softDeletePeriod value + */ + public Period softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Set 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(Period softDeletePeriod) { + this.softDeletePeriod = softDeletePeriod; + return this; + } + + /** + * Get the time the data should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value + */ + public Period hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set 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(Period hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics of the database. + * + * @return the statistics value + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Set the statistics of the database. + * + * @param statistics the statistics value to set + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + + /** + * Get indicates whether the database is followed. + * + * @return the isFollowed value + */ + public Boolean isFollowed() { + return this.isFollowed; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Reason.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Reason.java new file mode 100644 index 000000000000..01b407e31288 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Reason.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuDescription.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuDescription.java new file mode 100644 index 000000000000..4ceaa0425c45 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuDescription.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_02_15.implementation.SkuDescriptionInner; +import java.util.List; + +/** + * Type representing SkuDescription. + */ +public interface SkuDescription extends HasInner, HasManager { + /** + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the tier value. + */ + String tier(); + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuLocationInfoItem.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuLocationInfoItem.java new file mode 100644 index 000000000000..51e6d73ce224 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/SkuLocationInfoItem.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The locations and zones info for SKU. + */ +public class SkuLocationInfoItem { + /** + * 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 available location of the SKU. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set 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 available zone of the SKU. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/State.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/State.java new file mode 100644 index 000000000000..cc5baec24f27 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/State.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/TrustedExternalTenant.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/TrustedExternalTenant.java new file mode 100644 index 000000000000..0a0262f5fd29 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/TrustedExternalTenant.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a tenant ID that is trusted by the cluster. + */ +public class TrustedExternalTenant { + /** + * GUID representing an external tenant. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get gUID representing an external tenant. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Type.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Type.java new file mode 100644 index 000000000000..4b70b8543e73 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/Type.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +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_KUSTOCLUSTERSDATABASES("Microsoft.Kusto/clusters/databases"), + + /** Enum value Microsoft.Kusto/clusters/attachedDatabaseConfigurations. */ + MICROSOFT_KUSTOCLUSTERSATTACHED_DATABASE_CONFIGURATIONS("Microsoft.Kusto/clusters/attachedDatabaseConfigurations"); + + /** The actual serialized value for a Type instance. */ + private 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/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/VirtualNetworkConfiguration.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/VirtualNetworkConfiguration.java new file mode 100644 index 000000000000..0a22182aa616 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/VirtualNetworkConfiguration.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains virtual network definition. + */ +public class VirtualNetworkConfiguration { + /** + * 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 subnet resource id. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set 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 engine service's public IP address resource id. + * + * @return the enginePublicIpId value + */ + public String enginePublicIpId() { + return this.enginePublicIpId; + } + + /** + * Set 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 data management's service public IP address resource id. + * + * @return the dataManagementPublicIpId value + */ + public String dataManagementPublicIpId() { + return this.dataManagementPublicIpId; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationImpl.java new file mode 100644 index 000000000000..b97efdeea156 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.DefaultPrincipalsModificationKind; + +class AttachedDatabaseConfigurationImpl extends CreatableUpdatableImpl implements AttachedDatabaseConfiguration, AttachedDatabaseConfiguration.Definition, AttachedDatabaseConfiguration.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String attachedDatabaseConfigurationName; + + AttachedDatabaseConfigurationImpl(String name, KustoManager manager) { + super(name, new AttachedDatabaseConfigurationInner()); + this.manager = manager; + // Set resource name + this.attachedDatabaseConfigurationName = name; + // + } + + AttachedDatabaseConfigurationImpl(AttachedDatabaseConfigurationInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.attachedDatabaseConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.attachedDatabaseConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "attachedDatabaseConfigurations"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List attachedDatabaseNames() { + return this.inner().attachedDatabaseNames(); + } + + @Override + public String clusterResourceId() { + return this.inner().clusterResourceId(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + + @Override + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.inner().defaultPrincipalsModificationKind(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AttachedDatabaseConfigurationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withClusterResourceId(String clusterResourceId) { + this.inner().withClusterResourceId(clusterResourceId); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withDatabaseName(String databaseName) { + this.inner().withDatabaseName(databaseName); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.inner().withDefaultPrincipalsModificationKind(defaultPrincipalsModificationKind); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationInner.java new file mode 100644 index 000000000000..d164bc1388eb --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationInner.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.DefaultPrincipalsModificationKind; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an attached database configuration. + */ +@JsonFlatten +public class AttachedDatabaseConfigurationInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @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", required = true) + private String databaseName; + + /** + * The resource id of the cluster where the databases you would like to + * attach reside. + */ + @JsonProperty(value = "properties.clusterResourceId", required = true) + 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. Possible values include: + * 'Union', 'Replace', 'None'. + */ + @JsonProperty(value = "properties.defaultPrincipalsModificationKind", required = true) + private DefaultPrincipalsModificationKind defaultPrincipalsModificationKind; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set 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 provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 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 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 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 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 default principals modification kind. Possible values include: 'Union', 'Replace', 'None'. + * + * @return the defaultPrincipalsModificationKind value + */ + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.defaultPrincipalsModificationKind; + } + + /** + * Set the default principals modification kind. Possible values include: 'Union', 'Replace', 'None'. + * + * @param defaultPrincipalsModificationKind the defaultPrincipalsModificationKind value to set + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.defaultPrincipalsModificationKind = defaultPrincipalsModificationKind; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsImpl.java new file mode 100644 index 000000000000..7eff5fb3343a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfiguration; + +class AttachedDatabaseConfigurationsImpl extends WrapperImpl implements AttachedDatabaseConfigurations { + private final KustoManager manager; + + AttachedDatabaseConfigurationsImpl(KustoManager manager) { + super(manager.inner().attachedDatabaseConfigurations()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public AttachedDatabaseConfigurationImpl define(String name) { + return wrapModel(name); + } + + private AttachedDatabaseConfigurationImpl wrapModel(AttachedDatabaseConfigurationInner inner) { + return new AttachedDatabaseConfigurationImpl(inner, manager()); + } + + private AttachedDatabaseConfigurationImpl wrapModel(String name) { + return new AttachedDatabaseConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listByClusterAsync(String resourceGroupName, String clusterName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public AttachedDatabaseConfiguration call(AttachedDatabaseConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName) + .flatMap(new Func1>() { + @Override + public Observable call(AttachedDatabaseConfigurationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((AttachedDatabaseConfiguration)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toCompletable(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsInner.java new file mode 100644 index 000000000000..3d1d44071c73 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AttachedDatabaseConfigurationsInner.java @@ -0,0 +1,625 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AttachedDatabaseConfigurations. + */ +public class AttachedDatabaseConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private AttachedDatabaseConfigurationsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of AttachedDatabaseConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AttachedDatabaseConfigurationsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(AttachedDatabaseConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AttachedDatabaseConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface AttachedDatabaseConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations") + Observable> listByCluster(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Body AttachedDatabaseConfigurationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Body AttachedDatabaseConfigurationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<AttachedDatabaseConfigurationInner> object if successful. + */ + public List listByCluster(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByClusterWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<AttachedDatabaseConfigurationInner> object + */ + public Observable> listByClusterAsync(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<AttachedDatabaseConfigurationInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCluster(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner get(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner createOrUpdate(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuImpl.java new file mode 100644 index 000000000000..2c2c2312379d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.AzureResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.AzureCapacity; +import com.microsoft.azure.management.kusto.v2020_02_15.AzureSku; + +class AzureResourceSkuImpl extends WrapperImpl implements AzureResourceSku { + private final KustoManager manager; + + AzureResourceSkuImpl(AzureResourceSkuInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + + + @Override + public AzureCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public AzureSku sku() { + return this.inner().sku(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuInner.java new file mode 100644 index 000000000000..32f602e27ea1 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/AzureResourceSkuInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.AzureSku; +import com.microsoft.azure.management.kusto.v2020_02_15.AzureCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure resource SKU definition. + */ +public class AzureResourceSkuInner { + /** + * 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 resource Namespace and Type. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set 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 details. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set 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 number of instances of the cluster. + * + * @return the capacity value + */ + public AzureCapacity capacity() { + return this.capacity; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultImpl.java new file mode 100644 index 000000000000..72a95d025cf0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.Reason; + +class CheckNameResultImpl extends WrapperImpl implements CheckNameResult { + private final KustoManager manager; + CheckNameResultImpl(CheckNameResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public Reason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultInner.java new file mode 100644 index 000000000000..c82f70891f9a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/CheckNameResultInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a check name availability request. + */ +public class CheckNameResultInner { + /** + * 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. Possible + * values include: 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason") + private Reason reason; + + /** + * Get specifies a Boolean value that indicates if the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set 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 that was checked. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 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 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 message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public Reason reason() { + return this.reason; + } + + /** + * Set message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @param reason the reason value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withReason(Reason reason) { + this.reason = reason; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterImpl.java new file mode 100644 index 000000000000..9d05d319cc54 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterImpl.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.Cluster; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterUpdate; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.AzureSku; +import com.microsoft.azure.management.kusto.v2020_02_15.Identity; +import com.microsoft.azure.management.kusto.v2020_02_15.State; +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; +import com.microsoft.azure.management.kusto.v2020_02_15.TrustedExternalTenant; +import com.microsoft.azure.management.kusto.v2020_02_15.OptimizedAutoscale; +import com.microsoft.azure.management.kusto.v2020_02_15.VirtualNetworkConfiguration; +import com.microsoft.azure.management.kusto.v2020_02_15.KeyVaultProperties; +import com.microsoft.azure.management.kusto.v2020_02_15.LanguageExtensionsList; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterUpdate updateParameter; + ClusterImpl(String name, ClusterInner inner, KustoManager manager) { + super(name, inner, manager); + this.updateParameter = new ClusterUpdate(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ClusterUpdate(); + } + + @Override + public String dataIngestionUri() { + return this.inner().dataIngestionUri(); + } + + @Override + public Boolean enableDiskEncryption() { + return this.inner().enableDiskEncryption(); + } + + @Override + public Boolean enablePurge() { + return this.inner().enablePurge(); + } + + @Override + public Boolean enableStreamingIngest() { + return this.inner().enableStreamingIngest(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public KeyVaultProperties keyVaultProperties() { + return this.inner().keyVaultProperties(); + } + + @Override + public LanguageExtensionsList languageExtensions() { + return this.inner().languageExtensions(); + } + + @Override + public OptimizedAutoscale optimizedAutoscale() { + return this.inner().optimizedAutoscale(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AzureSku sku() { + return this.inner().sku(); + } + + @Override + public State state() { + return this.inner().state(); + } + + @Override + public String stateReason() { + return this.inner().stateReason(); + } + + @Override + public List trustedExternalTenants() { + return this.inner().trustedExternalTenants(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + + @Override + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.inner().virtualNetworkConfiguration(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public ClusterImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + + @Override + public ClusterImpl withSku(AzureSku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public ClusterImpl withEnableDiskEncryption(Boolean enableDiskEncryption) { + if (isInCreateMode()) { + this.inner().withEnableDiskEncryption(enableDiskEncryption); + } else { + this.updateParameter.withEnableDiskEncryption(enableDiskEncryption); + } + return this; + } + + @Override + public ClusterImpl withEnablePurge(Boolean enablePurge) { + if (isInCreateMode()) { + this.inner().withEnablePurge(enablePurge); + } else { + this.updateParameter.withEnablePurge(enablePurge); + } + return this; + } + + @Override + public ClusterImpl withEnableStreamingIngest(Boolean enableStreamingIngest) { + if (isInCreateMode()) { + this.inner().withEnableStreamingIngest(enableStreamingIngest); + } else { + this.updateParameter.withEnableStreamingIngest(enableStreamingIngest); + } + return this; + } + + @Override + public ClusterImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + if (isInCreateMode()) { + this.inner().withKeyVaultProperties(keyVaultProperties); + } else { + this.updateParameter.withKeyVaultProperties(keyVaultProperties); + } + return this; + } + + @Override + public ClusterImpl withLanguageExtensions(LanguageExtensionsList languageExtensions) { + if (isInCreateMode()) { + this.inner().withLanguageExtensions(languageExtensions); + } else { + this.updateParameter.withLanguageExtensions(languageExtensions); + } + return this; + } + + @Override + public ClusterImpl withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + if (isInCreateMode()) { + this.inner().withOptimizedAutoscale(optimizedAutoscale); + } else { + this.updateParameter.withOptimizedAutoscale(optimizedAutoscale); + } + return this; + } + + @Override + public ClusterImpl withTrustedExternalTenants(List trustedExternalTenants) { + if (isInCreateMode()) { + this.inner().withTrustedExternalTenants(trustedExternalTenants); + } else { + this.updateParameter.withTrustedExternalTenants(trustedExternalTenants); + } + return this; + } + + @Override + public ClusterImpl withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + if (isInCreateMode()) { + this.inner().withVirtualNetworkConfiguration(virtualNetworkConfiguration); + } else { + this.updateParameter.withVirtualNetworkConfiguration(virtualNetworkConfiguration); + } + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterInner.java new file mode 100644 index 000000000000..796f0d6816c3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterInner.java @@ -0,0 +1,394 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.AzureSku; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.Identity; +import com.microsoft.azure.management.kusto.v2020_02_15.State; +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; +import com.microsoft.azure.management.kusto.v2020_02_15.TrustedExternalTenant; +import com.microsoft.azure.management.kusto.v2020_02_15.OptimizedAutoscale; +import com.microsoft.azure.management.kusto.v2020_02_15.VirtualNetworkConfiguration; +import com.microsoft.azure.management.kusto.v2020_02_15.KeyVaultProperties; +import com.microsoft.azure.management.kusto.v2020_02_15.LanguageExtensionsList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Class representing a Kusto cluster. + */ +@JsonFlatten +public class ClusterInner extends Resource { + /** + * 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. Possible values include: 'Creating', + * 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', + * 'Starting', 'Updating'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @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") + private LanguageExtensionsList languageExtensions; + + /** + * Get the SKU of the cluster. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set 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 availability zones of the cluster. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set 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 of the cluster, if configured. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set 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 of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the cluster URI. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Get the cluster data ingestion URI. + * + * @return the dataIngestionUri value + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the reason for the cluster's current state. + * + * @return the stateReason value + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the cluster's external tenants. + * + * @return the trustedExternalTenants value + */ + public List trustedExternalTenants() { + return this.trustedExternalTenants; + } + + /** + * Set 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 optimized auto scale definition. + * + * @return the optimizedAutoscale value + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set 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 a boolean value that indicates if the cluster's disks are encrypted. + * + * @return the enableDiskEncryption value + */ + public Boolean enableDiskEncryption() { + return this.enableDiskEncryption; + } + + /** + * Set 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 a boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set 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 virtual network definition. + * + * @return the virtualNetworkConfiguration value + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set 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 keyVault properties for the cluster encryption. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set 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 a boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set 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 list of the cluster's language extensions. + * + * @return the languageExtensions value + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Set list of the cluster's language extensions. + * + * @param languageExtensions the languageExtensions value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withLanguageExtensions(LanguageExtensionsList languageExtensions) { + this.languageExtensions = languageExtensions; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentImpl.java new file mode 100644 index 000000000000..1938434c5c1d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignment; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalRole; +import com.microsoft.azure.management.kusto.v2020_02_15.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; + +class ClusterPrincipalAssignmentImpl extends CreatableUpdatableImpl implements ClusterPrincipalAssignment, ClusterPrincipalAssignment.Definition, ClusterPrincipalAssignment.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String principalAssignmentName; + + ClusterPrincipalAssignmentImpl(String name, KustoManager manager) { + super(name, new ClusterPrincipalAssignmentInner()); + this.manager = manager; + // Set resource name + this.principalAssignmentName = name; + // + } + + ClusterPrincipalAssignmentImpl(ClusterPrincipalAssignmentInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.principalAssignmentName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.principalAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "principalAssignments"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ClusterPrincipalAssignmentsInner client = this.manager().inner().clusterPrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClusterPrincipalAssignmentsInner client = this.manager().inner().clusterPrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClusterPrincipalAssignmentsInner client = this.manager().inner().clusterPrincipalAssignments(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.principalAssignmentName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String principalId() { + return this.inner().principalId(); + } + + @Override + public String principalName() { + return this.inner().principalName(); + } + + @Override + public PrincipalType principalType() { + return this.inner().principalType(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ClusterPrincipalRole role() { + return this.inner().role(); + } + + @Override + public String tenantId() { + return this.inner().tenantId(); + } + + @Override + public String tenantName() { + return this.inner().tenantName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ClusterPrincipalAssignmentImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withPrincipalId(String principalId) { + this.inner().withPrincipalId(principalId); + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.inner().withPrincipalType(principalType); + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withRole(ClusterPrincipalRole role) { + this.inner().withRole(role); + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withTenantId(String tenantId) { + this.inner().withTenantId(tenantId); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentInner.java new file mode 100644 index 000000000000..b9d405ddc314 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentInner.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalRole; +import com.microsoft.azure.management.kusto.v2020_02_15.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a cluster principal assignment. + */ +@JsonFlatten +public class ClusterPrincipalAssignmentInner extends ProxyResource { + /** + * The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId", required = true) + private String principalId; + + /** + * Cluster principal role. Possible values include: 'AllDatabasesAdmin', + * 'AllDatabasesViewer'. + */ + @JsonProperty(value = "properties.role", required = true) + private ClusterPrincipalRole role; + + /** + * The tenant id of the principal. + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /** + * Principal type. Possible values include: 'App', 'Group', 'User'. + */ + @JsonProperty(value = "properties.principalType", required = true) + 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. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get 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 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 cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer'. + * + * @return the role value + */ + public ClusterPrincipalRole role() { + return this.role; + } + + /** + * Set cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer'. + * + * @param role the role value to set + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withRole(ClusterPrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenant id of the principal. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set 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 principal type. Possible values include: 'App', 'Group', 'User'. + * + * @return the principalType value + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set principal type. Possible values include: 'App', 'Group', 'User'. + * + * @param principalType the principalType value to set + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenant name of the principal. + * + * @return the tenantName value + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principal name. + * + * @return the principalName value + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsImpl.java new file mode 100644 index 000000000000..944549b76645 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignment; +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameResult; + +class ClusterPrincipalAssignmentsImpl extends WrapperImpl implements ClusterPrincipalAssignments { + private final KustoManager manager; + + ClusterPrincipalAssignmentsImpl(KustoManager manager) { + super(manager.inner().clusterPrincipalAssignments()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public ClusterPrincipalAssignmentImpl define(String name) { + return wrapModel(name); + } + + private ClusterPrincipalAssignmentImpl wrapModel(ClusterPrincipalAssignmentInner inner) { + return new ClusterPrincipalAssignmentImpl(inner, manager()); + } + + private ClusterPrincipalAssignmentImpl wrapModel(String name) { + return new ClusterPrincipalAssignmentImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String clusterName) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ClusterPrincipalAssignment call(ClusterPrincipalAssignmentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, principalAssignmentName) + .flatMap(new Func1>() { + @Override + public Observable call(ClusterPrincipalAssignmentInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ClusterPrincipalAssignment)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, principalAssignmentName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsInner.java new file mode 100644 index 000000000000..28fa39995b18 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClusterPrincipalAssignmentsInner.java @@ -0,0 +1,725 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignmentCheckNameRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ClusterPrincipalAssignments. + */ +public class ClusterPrincipalAssignmentsInner { + /** The Retrofit service to perform REST calls. */ + private ClusterPrincipalAssignmentsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of ClusterPrincipalAssignmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClusterPrincipalAssignmentsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(ClusterPrincipalAssignmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ClusterPrincipalAssignments to be + * used by Retrofit to perform actually REST calls. + */ + interface ClusterPrincipalAssignmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body ClusterPrincipalAssignmentInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body ClusterPrincipalAssignmentInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name).toBlocking().single().body(); + } + + /** + * 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 name Principal Assignment resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name), serviceCallback); + } + + /** + * 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName = new ClusterPrincipalAssignmentCheckNameRequest(); + principalAssignmentName.withName(name); + return service.checkNameAvailability(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), principalAssignmentName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterPrincipalAssignmentInner object if successful. + */ + public ClusterPrincipalAssignmentInner get(String resourceGroupName, String clusterName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).map(new Func1, ClusterPrincipalAssignmentInner>() { + @Override + public ClusterPrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterPrincipalAssignmentInner object if successful. + */ + public ClusterPrincipalAssignmentInner createOrUpdate(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).map(new Func1, ClusterPrincipalAssignmentInner>() { + @Override + public ClusterPrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, principalAssignmentName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterPrincipalAssignmentInner object if successful. + */ + public ClusterPrincipalAssignmentInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).map(new Func1, ClusterPrincipalAssignmentInner>() { + @Override + public ClusterPrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, principalAssignmentName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String principalAssignmentName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String principalAssignmentName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ClusterPrincipalAssignmentInner> object if successful. + */ + public List list(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<ClusterPrincipalAssignmentInner> object + */ + public Observable> listAsync(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<ClusterPrincipalAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java new file mode 100644 index 000000000000..2f3481ee1775 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.Clusters; +import com.microsoft.azure.management.kusto.v2020_02_15.Cluster; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.FollowerDatabaseDefinition; +import com.microsoft.azure.management.kusto.v2020_02_15.DiagnoseVirtualNetworkResult; +import com.microsoft.azure.management.kusto.v2020_02_15.LanguageExtension; +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameResult; +import com.microsoft.azure.management.kusto.v2020_02_15.AzureResourceSku; +import com.microsoft.azure.management.kusto.v2020_02_15.SkuDescription; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(KustoManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ClustersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ClustersInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable stopAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.stopAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.startAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Observable listFollowerDatabasesAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.listFollowerDatabasesAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public FollowerDatabaseDefinition call(FollowerDatabaseDefinitionInner inner) { + return new FollowerDatabaseDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Completable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + ClustersInner client = this.inner(); + return client.detachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove).toCompletable(); + } + + @Override + public Observable diagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.diagnoseVirtualNetworkAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public DiagnoseVirtualNetworkResult call(DiagnoseVirtualNetworkResultInner inner) { + return new DiagnoseVirtualNetworkResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.listLanguageExtensionsAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public LanguageExtension call(LanguageExtensionInner inner) { + return new LanguageExtensionImpl(inner, manager()); + } + }); + } + + @Override + public Completable addLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.addLanguageExtensionsAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Completable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.removeLanguageExtensionsAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + protected ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, new ClusterInner(), this.manager()); + } + + private AzureResourceSkuImpl wrapAzureResourceSkuModel(AzureResourceSkuInner inner) { + return new AzureResourceSkuImpl(inner, manager()); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, String name) { + ClustersInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listSkusByResourceAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.listSkusByResourceAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public AzureResourceSku call(AzureResourceSkuInner inner) { + return wrapAzureResourceSkuModel(inner); + } + }); + } + + @Override + public Observable listSkusAsync() { + ClustersInner client = this.inner(); + return client.listSkusAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SkuDescription call(SkuDescriptionInner inner) { + return new SkuDescriptionImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java new file mode 100644 index 000000000000..739a3ce6287e --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java @@ -0,0 +1,2638 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterCheckNameRequest; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterUpdate; +import com.microsoft.azure.management.kusto.v2020_02_15.LanguageExtensionsList; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in Clusters. + */ +public class ClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters listFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases") + Observable> listFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters detachFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases") + Observable> detachFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body FollowerDatabaseDefinitionInner followerDatabaseToRemove, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginDetachFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases") + Observable> beginDetachFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body FollowerDatabaseDefinitionInner followerDatabaseToRemove, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters diagnoseVirtualNetwork" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork") + Observable> diagnoseVirtualNetwork(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginDiagnoseVirtualNetwork" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork") + Observable> beginDiagnoseVirtualNetwork(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters listSkus" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus") + Observable> listSkus(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterCheckNameRequest clusterName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters listSkusByResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus") + Observable> listSkusByResource(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters listLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions") + Observable> listLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters addLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions") + Observable> addLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToAdd, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginAddLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions") + Observable> beginAddLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToAdd, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters removeLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions") + Observable> removeLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToRemove, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Clusters beginRemoveLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions") + Observable> beginRemoveLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToRemove, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, clusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ClusterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, clusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, clusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginUpdate(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the ClusterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the ClusterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, clusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String clusterName) { + stopWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String clusterName) { + return stopWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String clusterName) { + beginStopWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String clusterName) { + return beginStopWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String clusterName) { + startWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String clusterName) { + return startWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String clusterName) { + beginStartWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String clusterName) { + return beginStartWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FollowerDatabaseDefinitionInner> object if successful. + */ + public List listFollowerDatabases(String resourceGroupName, String clusterName) { + return listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listFollowerDatabasesAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<FollowerDatabaseDefinitionInner> object + */ + public Observable> listFollowerDatabasesAsync(String resourceGroupName, String clusterName) { + return listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<FollowerDatabaseDefinitionInner> object + */ + public Observable>> listFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listFollowerDatabases(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listFollowerDatabasesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listFollowerDatabasesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void detachFollowerDatabases(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> detachFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (followerDatabaseToRemove == null) { + throw new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null."); + } + Validator.validate(followerDatabaseToRemove); + Observable> observable = service.detachFollowerDatabases(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), followerDatabaseToRemove, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDetachFollowerDatabases(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + beginDetachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDetachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDetachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDetachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return beginDetachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDetachFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (followerDatabaseToRemove == null) { + throw new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null."); + } + Validator.validate(followerDatabaseToRemove); + return service.beginDetachFollowerDatabases(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), followerDatabaseToRemove, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDetachFollowerDatabasesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDetachFollowerDatabasesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnoseVirtualNetworkResultInner object if successful. + */ + public DiagnoseVirtualNetworkResultInner diagnoseVirtualNetwork(String resourceGroupName, String clusterName) { + return diagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture diagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(diagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable diagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName) { + return diagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, DiagnoseVirtualNetworkResultInner>() { + @Override + public DiagnoseVirtualNetworkResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> diagnoseVirtualNetworkWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.diagnoseVirtualNetwork(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnoseVirtualNetworkResultInner object if successful. + */ + public DiagnoseVirtualNetworkResultInner beginDiagnoseVirtualNetwork(String resourceGroupName, String clusterName) { + return beginDiagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDiagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDiagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the DiagnoseVirtualNetworkResultInner object + */ + public Observable beginDiagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName) { + return beginDiagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, DiagnoseVirtualNetworkResultInner>() { + @Override + public DiagnoseVirtualNetworkResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DiagnoseVirtualNetworkResultInner object + */ + public Observable> beginDiagnoseVirtualNetworkWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDiagnoseVirtualNetwork(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDiagnoseVirtualNetworkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDiagnoseVirtualNetworkDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @return the observable to the List<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @return the observable to the List<ClusterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all Kusto clusters within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ClusterInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all Kusto clusters within a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all Kusto clusters within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Kusto clusters within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<SkuDescriptionInner> object if successful. + */ + public List listSkus() { + return listSkusWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSkusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SkuDescriptionInner> object + */ + public Observable> listSkusAsync() { + return listSkusWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SkuDescriptionInner> object + */ + public Observable>> listSkusWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSkus(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String location, String name) { + return checkNameAvailabilityWithServiceResponseAsync(location, name).toBlocking().single().body(); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, name), serviceCallback); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String location, String name) { + return checkNameAvailabilityWithServiceResponseAsync(location, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + ClusterCheckNameRequest clusterName = new ClusterCheckNameRequest(); + clusterName.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), clusterName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<AzureResourceSkuInner> object if successful. + */ + public List listSkusByResource(String resourceGroupName, String clusterName) { + return listSkusByResourceWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSkusByResourceAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSkusByResourceWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<AzureResourceSkuInner> object + */ + public Observable> listSkusByResourceAsync(String resourceGroupName, String clusterName) { + return listSkusByResourceWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<AzureResourceSkuInner> object + */ + public Observable>> listSkusByResourceWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSkusByResource(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSkusByResourceDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSkusByResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<LanguageExtensionInner> object if successful. + */ + public List listLanguageExtensions(String resourceGroupName, String clusterName) { + return listLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<LanguageExtensionInner> object + */ + public Observable> listLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return listLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<LanguageExtensionInner> object + */ + public Observable>> listLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listLanguageExtensionsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listLanguageExtensionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void addLanguageExtensions(String resourceGroupName, String clusterName) { + addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable addLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> addLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String valueConverted = null; + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(null); + Observable> observable = service.addLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void addLanguageExtensions(String resourceGroupName, String clusterName, List value) { + addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().last().body(); + } + + /** + * 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 value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable addLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> addLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(value); + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(value); + Observable> observable = service.addLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginAddLanguageExtensions(String resourceGroupName, String clusterName) { + beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAddLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final List value = null; + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(null); + return service.beginAddLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAddLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginAddLanguageExtensions(String resourceGroupName, String clusterName, List value) { + beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().single().body(); + } + + /** + * 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 value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAddLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(value); + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(value); + return service.beginAddLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAddLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginAddLanguageExtensionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeLanguageExtensions(String resourceGroupName, String clusterName) { + removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> removeLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String valueConverted = null; + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(null); + Observable> observable = service.removeLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeLanguageExtensions(String resourceGroupName, String clusterName, List value) { + removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().last().body(); + } + + /** + * 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 value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> removeLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(value); + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(value); + Observable> observable = service.removeLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRemoveLanguageExtensions(String resourceGroupName, String clusterName) { + beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRemoveLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final List value = null; + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(null); + return service.beginRemoveLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRemoveLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRemoveLanguageExtensions(String resourceGroupName, String clusterName, List value) { + beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().single().body(); + } + + /** + * 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 value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRemoveLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(value); + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(value); + return service.beginRemoveLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRemoveLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRemoveLanguageExtensionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionImpl.java new file mode 100644 index 000000000000..c406980582b3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class DataConnectionImpl extends CreatableUpdatableImpl implements DataConnection, DataConnection.Definition, DataConnection.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + private String dataConnectionName; + + DataConnectionImpl(String name, KustoManager manager) { + super(name, new DataConnectionInner()); + this.manager = manager; + // Set resource name + this.dataConnectionName = name; + // + } + + DataConnectionImpl(DataConnectionInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dataConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.dataConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataConnections"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DataConnectionImpl withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.databaseName = databaseName; + return this; + } + + @Override + public DataConnectionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java new file mode 100644 index 000000000000..cc01d8f21ba3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.ProxyResource; + +/** + * 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) +}) +public class DataConnectionInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the DataConnectionInner object itself. + */ + public DataConnectionInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultImpl.java new file mode 100644 index 000000000000..38d7753651c3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnectionValidationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnectionValidationResult; + +class DataConnectionValidationListResultImpl extends WrapperImpl implements DataConnectionValidationListResult { + private final KustoManager manager; + DataConnectionValidationListResultImpl(DataConnectionValidationListResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultInner.java new file mode 100644 index 000000000000..dfa57c88ce48 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionValidationListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnectionValidationResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto data connection validation result. + */ +public class DataConnectionValidationListResultInner { + /** + * The list of Kusto data connection validation errors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto data connection validation errors. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsImpl.java new file mode 100644 index 000000000000..a913584cca47 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnection; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnectionValidationListResult; +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameResult; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnectionValidation; + +class DataConnectionsImpl extends WrapperImpl implements DataConnections { + private final KustoManager manager; + + DataConnectionsImpl(KustoManager manager) { + super(manager.inner().dataConnections()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public DataConnectionImpl define(String name) { + return wrapModel(name); + } + + private DataConnectionImpl wrapModel(DataConnectionInner inner) { + return new DataConnectionImpl(inner, manager()); + } + + private DataConnectionImpl wrapModel(String name) { + return new DataConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) { + DataConnectionsInner client = this.inner(); + return client.listByDatabaseAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DataConnection call(DataConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + DataConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName, dataConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(DataConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + DataConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toCompletable(); + } + + @Override + public Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + DataConnectionsInner client = this.inner(); + return client.dataConnectionValidationMethodAsync(resourceGroupName, clusterName, databaseName, parameters) + .map(new Func1() { + @Override + public DataConnectionValidationListResult call(DataConnectionValidationListResultInner inner) { + return new DataConnectionValidationListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + DataConnectionsInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, databaseName, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsInner.java new file mode 100644 index 000000000000..4ad5e0dc1b55 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionsInner.java @@ -0,0 +1,1091 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnectionCheckNameRequest; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnectionValidation; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DataConnections. + */ +public class DataConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private DataConnectionsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of DataConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataConnectionsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(DataConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface DataConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections listByDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections") + Observable> listByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections dataConnectionValidationMethod" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation") + Observable> dataConnectionValidationMethod(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DataConnectionValidation parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DataConnectionCheckNameRequest dataConnectionName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DataConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DataConnectionInner> object if successful. + */ + public List listByDatabase(String resourceGroupName, String clusterName, String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<DataConnectionInner> object + */ + public Observable> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<DataConnectionInner> object + */ + public Observable>> listByDatabaseWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDatabase(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDatabaseDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDatabaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionValidationListResultInner object if successful. + */ + public DataConnectionValidationListResultInner dataConnectionValidationMethod(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DataConnectionValidationListResultInner object + */ + public Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DataConnectionValidationListResultInner>() { + @Override + public DataConnectionValidationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DataConnectionValidationListResultInner object + */ + public Observable> dataConnectionValidationMethodWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dataConnectionValidationMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dataConnectionValidationMethodDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 name Data Connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).toBlocking().single().body(); + } + + /** + * 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 name Data Connection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name), serviceCallback); + } + + /** + * 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 name Data Connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 name Data Connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + DataConnectionCheckNameRequest dataConnectionName = new DataConnectionCheckNameRequest(); + dataConnectionName.withName(name); + return service.checkNameAvailability(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), dataConnectionName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner get(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the DataConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DataConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DataConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DataConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner update(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DataConnectionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DataConnectionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseImpl.java new file mode 100644 index 000000000000..f3f3122db489 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseImpl.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.Database; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class DatabaseImpl extends CreatableUpdatableImpl implements Database, Database.Definition, Database.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + + DatabaseImpl(String name, KustoManager manager) { + super(name, new DatabaseInner()); + this.manager = manager; + // Set resource name + this.databaseName = name; + // + } + + DatabaseImpl(DatabaseInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.databaseName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DatabaseImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public DatabaseImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java new file mode 100644 index 000000000000..6a88cc4a600a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.ProxyResource; + +/** + * 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) +}) +public class DatabaseInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentImpl.java new file mode 100644 index 000000000000..68ae0cfef865 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentImpl.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignment; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_02_15.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; + +class DatabasePrincipalAssignmentImpl extends CreatableUpdatableImpl implements DatabasePrincipalAssignment, DatabasePrincipalAssignment.Definition, DatabasePrincipalAssignment.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + private String principalAssignmentName; + + DatabasePrincipalAssignmentImpl(String name, KustoManager manager) { + super(name, new DatabasePrincipalAssignmentInner()); + this.manager = manager; + // Set resource name + this.principalAssignmentName = name; + // + } + + DatabasePrincipalAssignmentImpl(DatabasePrincipalAssignmentInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.principalAssignmentName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.principalAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "principalAssignments"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabasePrincipalAssignmentsInner client = this.manager().inner().databasePrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabasePrincipalAssignmentsInner client = this.manager().inner().databasePrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabasePrincipalAssignmentsInner client = this.manager().inner().databasePrincipalAssignments(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.principalAssignmentName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String principalId() { + return this.inner().principalId(); + } + + @Override + public String principalName() { + return this.inner().principalName(); + } + + @Override + public PrincipalType principalType() { + return this.inner().principalType(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DatabasePrincipalRole role() { + return this.inner().role(); + } + + @Override + public String tenantId() { + return this.inner().tenantId(); + } + + @Override + public String tenantName() { + return this.inner().tenantName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DatabasePrincipalAssignmentImpl withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.databaseName = databaseName; + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withPrincipalId(String principalId) { + this.inner().withPrincipalId(principalId); + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.inner().withPrincipalType(principalType); + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withRole(DatabasePrincipalRole role) { + this.inner().withRole(role); + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withTenantId(String tenantId) { + this.inner().withTenantId(tenantId); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentInner.java new file mode 100644 index 000000000000..73624b1c22f7 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentInner.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_02_15.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_02_15.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a database principal assignment. + */ +@JsonFlatten +public class DatabasePrincipalAssignmentInner extends ProxyResource { + /** + * The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId", required = true) + private String principalId; + + /** + * Database principal role. Possible values include: 'Admin', 'Ingestor', + * 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + */ + @JsonProperty(value = "properties.role", required = true) + private DatabasePrincipalRole role; + + /** + * The tenant id of the principal. + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /** + * Principal type. Possible values include: 'App', 'Group', 'User'. + */ + @JsonProperty(value = "properties.principalType", required = true) + 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. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get 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 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 database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @return the role value + */ + public DatabasePrincipalRole role() { + return this.role; + } + + /** + * Set database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @param role the role value to set + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withRole(DatabasePrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenant id of the principal. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set 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 principal type. Possible values include: 'App', 'Group', 'User'. + * + * @return the principalType value + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set principal type. Possible values include: 'App', 'Group', 'User'. + * + * @param principalType the principalType value to set + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenant name of the principal. + * + * @return the tenantName value + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principal name. + * + * @return the principalName value + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsImpl.java new file mode 100644 index 000000000000..66394eae4142 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignment; +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameResult; + +class DatabasePrincipalAssignmentsImpl extends WrapperImpl implements DatabasePrincipalAssignments { + private final KustoManager manager; + + DatabasePrincipalAssignmentsImpl(KustoManager manager) { + super(manager.inner().databasePrincipalAssignments()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public DatabasePrincipalAssignmentImpl define(String name) { + return wrapModel(name); + } + + private DatabasePrincipalAssignmentImpl wrapModel(DatabasePrincipalAssignmentInner inner) { + return new DatabasePrincipalAssignmentImpl(inner, manager()); + } + + private DatabasePrincipalAssignmentImpl wrapModel(String name) { + return new DatabasePrincipalAssignmentImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabasePrincipalAssignment call(DatabasePrincipalAssignmentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName) + .flatMap(new Func1>() { + @Override + public Observable call(DatabasePrincipalAssignmentInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DatabasePrincipalAssignment)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, databaseName, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsInner.java new file mode 100644 index 000000000000..af1e4abf203d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalAssignmentsInner.java @@ -0,0 +1,774 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignmentCheckNameRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DatabasePrincipalAssignments. + */ +public class DatabasePrincipalAssignmentsInner { + /** The Retrofit service to perform REST calls. */ + private DatabasePrincipalAssignmentsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of DatabasePrincipalAssignmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabasePrincipalAssignmentsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(DatabasePrincipalAssignmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DatabasePrincipalAssignments to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabasePrincipalAssignmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body DatabasePrincipalAssignmentInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body DatabasePrincipalAssignmentInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).toBlocking().single().body(); + } + + /** + * 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 name Principal Assignment resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name), serviceCallback); + } + + /** + * 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName = new DatabasePrincipalAssignmentCheckNameRequest(); + principalAssignmentName.withName(name); + return service.checkNameAvailability(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), principalAssignmentName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalAssignmentInner object if successful. + */ + public DatabasePrincipalAssignmentInner get(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName), serviceCallback); + } + + /** + * 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 + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).map(new Func1, DatabasePrincipalAssignmentInner>() { + @Override + public DatabasePrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalAssignmentInner object if successful. + */ + public DatabasePrincipalAssignmentInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).map(new Func1, DatabasePrincipalAssignmentInner>() { + @Override + public DatabasePrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, principalAssignmentName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalAssignmentInner object if successful. + */ + public DatabasePrincipalAssignmentInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).map(new Func1, DatabasePrincipalAssignmentInner>() { + @Override + public DatabasePrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, principalAssignmentName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DatabasePrincipalAssignmentInner> object if successful. + */ + public List list(String resourceGroupName, String clusterName, String databaseName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<DatabasePrincipalAssignmentInner> object + */ + public Observable> listAsync(String resourceGroupName, String clusterName, String databaseName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<DatabasePrincipalAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalImpl.java new file mode 100644 index 000000000000..6e35f0db55fe --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipal; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalType; + +class DatabasePrincipalImpl extends WrapperImpl implements DatabasePrincipal { + private final KustoManager manager; + DatabasePrincipalImpl(DatabasePrincipalInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public String appId() { + return this.inner().appId(); + } + + @Override + public String email() { + return this.inner().email(); + } + + @Override + public String fqn() { + return this.inner().fqn(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DatabasePrincipalRole role() { + return this.inner().role(); + } + + @Override + public String tenantName() { + return this.inner().tenantName(); + } + + @Override + public DatabasePrincipalType type() { + return this.inner().type(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalInner.java new file mode 100644 index 000000000000..43145e0d2072 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalInner.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class representing database principal entity. + */ +public class DatabasePrincipalInner { + /** + * Database principal role. Possible values include: 'Admin', 'Ingestor', + * 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + */ + @JsonProperty(value = "role", required = true) + private DatabasePrincipalRole role; + + /** + * Database principal name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Database principal type. Possible values include: 'App', 'Group', + * 'User'. + */ + @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 database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @return the role value + */ + public DatabasePrincipalRole role() { + return this.role; + } + + /** + * Set database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @param role the role value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withRole(DatabasePrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get database principal name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 database principal type. Possible values include: 'App', 'Group', 'User'. + * + * @return the type value + */ + public DatabasePrincipalType type() { + return this.type; + } + + /** + * Set database principal type. Possible values include: 'App', 'Group', 'User'. + * + * @param type the type value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withType(DatabasePrincipalType type) { + this.type = type; + return this; + } + + /** + * Get database principal fully qualified name. + * + * @return the fqn value + */ + public String fqn() { + return this.fqn; + } + + /** + * Set 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 database principal email if exists. + * + * @return the email value + */ + public String email() { + return this.email; + } + + /** + * Set 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 application id - relevant only for application principal type. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set 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 tenant name of the principal. + * + * @return the tenantName value + */ + public String tenantName() { + return this.tenantName; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultImpl.java new file mode 100644 index 000000000000..0f5249299dfe --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DatabasePrincipalListResultImpl extends WrapperImpl implements DatabasePrincipalListResult { + private final KustoManager manager; + DatabasePrincipalListResultImpl(DatabasePrincipalListResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultInner.java new file mode 100644 index 000000000000..630039b65571 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasePrincipalListResultInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto database principals operation response. + */ +public class DatabasePrincipalListResultInner { + /** + * The list of Kusto database principals. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto database principals. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesImpl.java new file mode 100644 index 000000000000..38ae3583ad50 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesImpl.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.Databases; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipal; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalListResult; +import com.microsoft.azure.management.kusto.v2020_02_15.Database; +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameResult; +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameRequest; + +class DatabasesImpl extends WrapperImpl implements Databases { + private final KustoManager manager; + + DatabasesImpl(KustoManager manager) { + super(manager.inner().databases()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public DatabaseImpl define(String name) { + return wrapModel(name); + } + + private DatabaseImpl wrapModel(DatabaseInner inner) { + return new DatabaseImpl(inner, manager()); + } + + private DatabaseImpl wrapModel(String name) { + return new DatabaseImpl(name, this.manager()); + } + + @Override + public Observable listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.listPrincipalsAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabasePrincipal call(DatabasePrincipalInner inner) { + return new DatabasePrincipalImpl(inner, manager()); + } + }); + } + + @Override + public Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.addPrincipalsAsync(resourceGroupName, clusterName, databaseName) + .map(new Func1() { + @Override + public DatabasePrincipalListResult call(DatabasePrincipalListResultInner inner) { + return new DatabasePrincipalListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.removePrincipalsAsync(resourceGroupName, clusterName, databaseName) + .map(new Func1() { + @Override + public DatabasePrincipalListResult call(DatabasePrincipalListResultInner inner) { + return new DatabasePrincipalListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByClusterAsync(String resourceGroupName, String clusterName) { + DatabasesInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Database call(DatabaseInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1>() { + @Override + public Observable call(DatabaseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Database)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + DatabasesInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, resourceName) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesInner.java new file mode 100644 index 000000000000..312bcbee399a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabasesInner.java @@ -0,0 +1,1410 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_02_15.CheckNameRequest; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalListRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Databases. + */ +public class DatabasesInner { + /** The Retrofit service to perform REST calls. */ + private DatabasesService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of DatabasesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabasesInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(DatabasesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Databases to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabasesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body CheckNameRequest resourceName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases") + Observable> listByCluster(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases listPrincipals" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals") + Observable> listPrincipals(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases addPrincipals" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals") + Observable> addPrincipals(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabasePrincipalListRequest databasePrincipalsToAdd, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Databases removePrincipals" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals") + Observable> removePrincipals(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabasePrincipalListRequest databasePrincipalsToRemove, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName), serviceCallback); + } + + /** + * 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 + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + Validator.validate(resourceName); + return service.checkNameAvailability(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), resourceName, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DatabaseInner> object if successful. + */ + public List listByCluster(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByClusterAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByClusterWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<DatabaseInner> object + */ + public Observable> listByClusterAsync(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<DatabaseInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByCluster(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByClusterDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByClusterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner get(String resourceGroupName, String clusterName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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 + * @return the observable to the DatabaseInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DatabaseInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DatabaseInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DatabaseInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner update(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the DatabaseInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the DatabaseInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String databaseName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String databaseName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String databaseName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DatabasePrincipalInner> object if successful. + */ + public List listPrincipals(String resourceGroupName, String clusterName, String databaseName) { + return listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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 + * @return the observable to the List<DatabasePrincipalInner> object + */ + public Observable> listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + return listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the List<DatabasePrincipalInner> object + */ + public Observable>> listPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listPrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPrincipalsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPrincipalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> addPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final List value = null; + DatabasePrincipalListRequest databasePrincipalsToAdd = new DatabasePrincipalListRequest(); + databasePrincipalsToAdd.withValue(null); + return service.addPrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addPrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName, List value) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).toBlocking().single().body(); + } + + /** + * 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 value The list of Kusto database principals. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value), serviceCallback); + } + + /** + * 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 value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> addPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(value); + DatabasePrincipalListRequest databasePrincipalsToAdd = new DatabasePrincipalListRequest(); + databasePrincipalsToAdd.withValue(value); + return service.addPrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addPrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addPrincipalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner removePrincipals(String resourceGroupName, String clusterName, String databaseName) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> removePrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final List value = null; + DatabasePrincipalListRequest databasePrincipalsToRemove = new DatabasePrincipalListRequest(); + databasePrincipalsToRemove.withValue(null); + return service.removePrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removePrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner removePrincipals(String resourceGroupName, String clusterName, String databaseName, List value) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).toBlocking().single().body(); + } + + /** + * 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 value The list of Kusto database principals. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value), serviceCallback); + } + + /** + * 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 value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> removePrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(value); + DatabasePrincipalListRequest databasePrincipalsToRemove = new DatabasePrincipalListRequest(); + databasePrincipalsToRemove.withValue(value); + return service.removePrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removePrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse removePrincipalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultImpl.java new file mode 100644 index 000000000000..34aa205ccef2 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.DiagnoseVirtualNetworkResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DiagnoseVirtualNetworkResultImpl extends WrapperImpl implements DiagnoseVirtualNetworkResult { + private final KustoManager manager; + DiagnoseVirtualNetworkResultImpl(DiagnoseVirtualNetworkResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List findings() { + return this.inner().findings(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultInner.java new file mode 100644 index 000000000000..105a9a7b389c --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DiagnoseVirtualNetworkResultInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DiagnoseVirtualNetworkResultInner model. + */ +public class DiagnoseVirtualNetworkResultInner { + /** + * The list of network connectivity diagnostic finding. + */ + @JsonProperty(value = "findings") + private List findings; + + /** + * Get the list of network connectivity diagnostic finding. + * + * @return the findings value + */ + public List findings() { + return this.findings; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionImpl.java new file mode 100644 index 000000000000..baa7e813b686 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.FollowerDatabaseDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class FollowerDatabaseDefinitionImpl extends WrapperImpl implements FollowerDatabaseDefinition { + private final KustoManager manager; + FollowerDatabaseDefinitionImpl(FollowerDatabaseDefinitionInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public String attachedDatabaseConfigurationName() { + return this.inner().attachedDatabaseConfigurationName(); + } + + @Override + public String clusterResourceId() { + return this.inner().clusterResourceId(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionInner.java new file mode 100644 index 000000000000..8d3d3d1017ae --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/FollowerDatabaseDefinitionInner.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class representing follower database request. + */ +public class FollowerDatabaseDefinitionInner { + /** + * 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 resource id of the cluster that follows a database owned by this cluster. + * + * @return the clusterResourceId value + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set 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 resource name of the attached database configuration in the follower cluster. + * + * @return the attachedDatabaseConfigurationName value + */ + public String attachedDatabaseConfigurationName() { + return this.attachedDatabaseConfigurationName; + } + + /** + * Set 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 database name owned by this cluster that was followed. * in case following all databases. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/IdParsingUtils.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..3aed7c28793f --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManagementClientImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManagementClientImpl.java new file mode 100644 index 000000000000..8f430f7703a1 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManagementClientImpl.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the KustoManagementClientImpl class. + */ +public class KustoManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public KustoManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API Version. */ + private String apiVersion; + + /** + * Gets Client API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public KustoManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public KustoManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public KustoManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The ClusterPrincipalAssignmentsInner object to access its operations. + */ + private ClusterPrincipalAssignmentsInner clusterPrincipalAssignments; + + /** + * Gets the ClusterPrincipalAssignmentsInner object to access its operations. + * @return the ClusterPrincipalAssignmentsInner object. + */ + public ClusterPrincipalAssignmentsInner clusterPrincipalAssignments() { + return this.clusterPrincipalAssignments; + } + + /** + * The DatabasesInner object to access its operations. + */ + private DatabasesInner databases; + + /** + * Gets the DatabasesInner object to access its operations. + * @return the DatabasesInner object. + */ + public DatabasesInner databases() { + return this.databases; + } + + /** + * The DatabasePrincipalAssignmentsInner object to access its operations. + */ + private DatabasePrincipalAssignmentsInner databasePrincipalAssignments; + + /** + * Gets the DatabasePrincipalAssignmentsInner object to access its operations. + * @return the DatabasePrincipalAssignmentsInner object. + */ + public DatabasePrincipalAssignmentsInner databasePrincipalAssignments() { + return this.databasePrincipalAssignments; + } + + /** + * The AttachedDatabaseConfigurationsInner object to access its operations. + */ + private AttachedDatabaseConfigurationsInner attachedDatabaseConfigurations; + + /** + * Gets the AttachedDatabaseConfigurationsInner object to access its operations. + * @return the AttachedDatabaseConfigurationsInner object. + */ + public AttachedDatabaseConfigurationsInner attachedDatabaseConfigurations() { + return this.attachedDatabaseConfigurations; + } + + /** + * The DataConnectionsInner object to access its operations. + */ + private DataConnectionsInner dataConnections; + + /** + * Gets the DataConnectionsInner object to access its operations. + * @return the DataConnectionsInner object. + */ + public DataConnectionsInner dataConnections() { + return this.dataConnections; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public KustoManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public KustoManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public KustoManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-02-15"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.clusterPrincipalAssignments = new ClusterPrincipalAssignmentsInner(restClient().retrofit(), this); + this.databases = new DatabasesInner(restClient().retrofit(), this); + this.databasePrincipalAssignments = new DatabasePrincipalAssignmentsInner(restClient().retrofit(), this); + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsInner(restClient().retrofit(), this); + this.dataConnections = new DataConnectionsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "KustoManagementClient", "2020-02-15"); + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManager.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManager.java new file mode 100644 index 000000000000..1237587cdde3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/KustoManager.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.kusto.v2020_02_15.Clusters; +import com.microsoft.azure.management.kusto.v2020_02_15.ClusterPrincipalAssignments; +import com.microsoft.azure.management.kusto.v2020_02_15.Databases; +import com.microsoft.azure.management.kusto.v2020_02_15.DatabasePrincipalAssignments; +import com.microsoft.azure.management.kusto.v2020_02_15.AttachedDatabaseConfigurations; +import com.microsoft.azure.management.kusto.v2020_02_15.DataConnections; +import com.microsoft.azure.management.kusto.v2020_02_15.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Kusto resource management. + */ +public final class KustoManager extends ManagerCore { + private Clusters clusters; + private ClusterPrincipalAssignments clusterPrincipalAssignments; + private Databases databases; + private DatabasePrincipalAssignments databasePrincipalAssignments; + private AttachedDatabaseConfigurations attachedDatabaseConfigurations; + private DataConnections dataConnections; + private Operations operations; + /** + * Get a Configurable instance that can be used to create KustoManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new KustoManager.ConfigurableImpl(); + } + /** + * Creates an instance of KustoManager that exposes Kusto resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the KustoManager + */ + public static KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new KustoManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of KustoManager that exposes Kusto resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the KustoManager + */ + public static KustoManager authenticate(RestClient restClient, String subscriptionId) { + return new KustoManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of KustoManager that exposes Kusto management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Kusto management API entry points that work across subscriptions + */ + KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage ClusterPrincipalAssignments. + */ + public ClusterPrincipalAssignments clusterPrincipalAssignments() { + if (this.clusterPrincipalAssignments == null) { + this.clusterPrincipalAssignments = new ClusterPrincipalAssignmentsImpl(this); + } + return this.clusterPrincipalAssignments; + } + + /** + * @return Entry point to manage Databases. + */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(this); + } + return this.databases; + } + + /** + * @return Entry point to manage DatabasePrincipalAssignments. + */ + public DatabasePrincipalAssignments databasePrincipalAssignments() { + if (this.databasePrincipalAssignments == null) { + this.databasePrincipalAssignments = new DatabasePrincipalAssignmentsImpl(this); + } + return this.databasePrincipalAssignments; + } + + /** + * @return Entry point to manage AttachedDatabaseConfigurations. + */ + public AttachedDatabaseConfigurations attachedDatabaseConfigurations() { + if (this.attachedDatabaseConfigurations == null) { + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsImpl(this); + } + return this.attachedDatabaseConfigurations; + } + + /** + * @return Entry point to manage DataConnections. + */ + public DataConnections dataConnections() { + if (this.dataConnections == null) { + this.dataConnections = new DataConnectionsImpl(this); + } + return this.dataConnections; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return KustoManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private KustoManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new KustoManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionImpl.java new file mode 100644 index 000000000000..50b36dbb6283 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.LanguageExtension; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.LanguageExtensionName; + +class LanguageExtensionImpl extends WrapperImpl implements LanguageExtension { + private final KustoManager manager; + LanguageExtensionImpl(LanguageExtensionInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public LanguageExtensionName languageExtensionName() { + return this.inner().languageExtensionName(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionInner.java new file mode 100644 index 000000000000..f99d4a4a0e86 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/LanguageExtensionInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.LanguageExtensionName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The language extension object. + */ +public class LanguageExtensionInner { + /** + * The language extension name. Possible values include: 'PYTHON', 'R'. + */ + @JsonProperty(value = "languageExtensionName") + private LanguageExtensionName languageExtensionName; + + /** + * Get the language extension name. Possible values include: 'PYTHON', 'R'. + * + * @return the languageExtensionName value + */ + public LanguageExtensionName languageExtensionName() { + return this.languageExtensionName; + } + + /** + * Set the language extension name. Possible values include: 'PYTHON', 'R'. + * + * @param languageExtensionName the languageExtensionName value to set + * @return the LanguageExtensionInner object itself. + */ + public LanguageExtensionInner withLanguageExtensionName(LanguageExtensionName languageExtensionName) { + this.languageExtensionName = languageExtensionName; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationImpl.java new file mode 100644 index 000000000000..276cfa2007be --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final KustoManager manager; + OperationImpl(OperationInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationInner.java new file mode 100644 index 000000000000..520a71b4d9ea --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A REST API operation. + */ +public class OperationInner { + /** + * The operation name. + * 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; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get this is of the format {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 value. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @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 value. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin value. + * + * @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 value. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsImpl.java new file mode 100644 index 000000000000..5cea82f583c9 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_02_15.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.kusto.v2020_02_15.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final KustoManager manager; + + OperationsImpl(KustoManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsInner.java new file mode 100644 index 000000000000..4575366e03ce --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Operations list" }) + @GET("providers/Microsoft.Kusto/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_02_15.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl.java new file mode 100644 index 000000000000..52f3d1158ce5 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl1.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl1.java new file mode 100644 index 000000000000..05adbe3ec66b --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionImpl.java new file mode 100644 index 000000000000..bcf9ce9957bd --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import com.microsoft.azure.management.kusto.v2020_02_15.SkuDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.SkuLocationInfoItem; + +class SkuDescriptionImpl extends WrapperImpl implements SkuDescription { + private final KustoManager manager; + SkuDescriptionImpl(SkuDescriptionInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List locationInfo() { + return this.inner().locationInfo(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionInner.java new file mode 100644 index 000000000000..6066a0ddc357 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/SkuDescriptionInner.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_02_15.implementation; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_02_15.SkuLocationInfoItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Kusto SKU description of given resource type. + */ +public class SkuDescriptionInner { + /** + * 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 resource type. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the tier of the SKU. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get locations and zones. + * + * @return the locationInfo value + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the restrictions because of which SKU cannot be used. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + +} diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/package-info.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/package-info.java new file mode 100644 index 000000000000..d1c99c2d16d4 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation 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.microsoft.azure.management.kusto.v2020_02_15.implementation; diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/package-info.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/package-info.java new file mode 100644 index 000000000000..00f881d7f707 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains 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.microsoft.azure.management.kusto.v2020_02_15; From 1ddc2add13903bd3966f3635b89d9246baae0e5e Mon Sep 17 00:00:00 2001 From: xccc-msft Date: Tue, 26 May 2020 10:46:28 +0800 Subject: [PATCH 2/3] update pom --- sdk/kusto/mgmt-v2020_02_15/pom.xml | 2 +- sdk/kusto/pom.mgmt.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/kusto/mgmt-v2020_02_15/pom.xml b/sdk/kusto/mgmt-v2020_02_15/pom.xml index f9c05a99ac67..3c0a218a0978 100644 --- a/sdk/kusto/mgmt-v2020_02_15/pom.xml +++ b/sdk/kusto/mgmt-v2020_02_15/pom.xml @@ -15,7 +15,7 @@ ../../parents/azure-arm-parent/pom.xml azure-mgmt-kusto - 1.0.0-beta + 1.0.0-beta-1 jar Microsoft Azure SDK for Kusto Management This package contains Microsoft Kusto Management SDK. diff --git a/sdk/kusto/pom.mgmt.xml b/sdk/kusto/pom.mgmt.xml index a9ce15b33e65..6036052b5861 100644 --- a/sdk/kusto/pom.mgmt.xml +++ b/sdk/kusto/pom.mgmt.xml @@ -13,5 +13,6 @@ mgmt-v2019_05_15 mgmt-v2019_09_07 mgmt-v2019_11_09 + mgmt-v2020_02_15 From b5315b32071c7f05c92ce1433459a108d7dbc38e Mon Sep 17 00:00:00 2001 From: xccc-msft Date: Tue, 26 May 2020 11:01:06 +0800 Subject: [PATCH 3/3] fix compile errors --- .../implementation/ClustersImpl.java | 6 ++--- .../implementation/ClustersInner.java | 23 +++++++++++++------ .../implementation/DataConnectionInner.java | 3 +++ .../implementation/DatabaseInner.java | 2 ++ 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java index 2f3481ee1775..8af592f12191 100644 --- a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersImpl.java @@ -113,10 +113,10 @@ public PagedList list() { public Observable listAsync() { ClustersInner client = this.inner(); return client.listAsync() - .flatMap(new Func1, Observable>() { + .flatMap(new Func1, Observable>() { @Override - public Observable call(List innerList) { - return Observable.from(innerList); + public Observable call(Page innerList) { + return Observable.from(innerList.items()); } }) .map(new Func1() { diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java index 739a3ce6287e..2ea491b5b4f6 100644 --- a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java @@ -1581,8 +1581,16 @@ private ServiceResponse> listByResourceGroupDelegate(Resp * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List<ClusterInner> object if successful. */ - public List list() { - return listWithServiceResponseAsync().toBlocking().single().body(); + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; } /** @@ -1602,11 +1610,12 @@ public ServiceFuture> listAsync(final ServiceCallback> listAsync() { - return listWithServiceResponseAsync().map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; } }); } diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java index cc01d8f21ba3..26e963e1a8e8 100644 --- a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DataConnectionInner.java @@ -13,6 +13,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.microsoft.azure.ProxyResource; +import com.microsoft.azure.management.kusto.v2020_02_15.EventGridDataConnection; +import com.microsoft.azure.management.kusto.v2020_02_15.EventHubDataConnection; +import com.microsoft.azure.management.kusto.v2020_02_15.IotHubDataConnection; /** * Class representing an data connection. diff --git a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java index 6a88cc4a600a..d222779e2736 100644 --- a/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java +++ b/sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/DatabaseInner.java @@ -13,6 +13,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.microsoft.azure.ProxyResource; +import com.microsoft.azure.management.kusto.v2020_02_15.ReadOnlyFollowingDatabase; +import com.microsoft.azure.management.kusto.v2020_02_15.ReadWriteDatabase; /** * Class representing a Kusto database.