From f0936667d6f3a92e05b7c7fdc8881079dd6ae0b4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 1 Feb 2019 22:53:46 +0000 Subject: [PATCH 1/2] Generated from 61421619d578fb87f234391e1d33e6fdcf8b7087 Add missing Java code gen info to Kusto --- .../v2018_09_07_preview/pom.xml | 133 ++ .../v2018_09_07_preview/AzureCapacity.java | 121 ++ .../AzureEntityResource.java | 34 + .../v2018_09_07_preview/AzureResourceSku.java | 35 + .../v2018_09_07_preview/AzureScaleType.java | 44 + .../kusto/v2018_09_07_preview/AzureSku.java | 35 + .../v2018_09_07_preview/AzureSkuName.java | 59 + .../v2018_09_07_preview/CheckNameResult.java | 35 + .../kusto/v2018_09_07_preview/Cluster.java | 153 ++ .../ClusterCheckNameRequest.java | 77 + .../v2018_09_07_preview/ClusterUpdate.java | 205 +++ .../kusto/v2018_09_07_preview/Clusters.java | 75 + .../kusto/v2018_09_07_preview/DataFormat.java | 44 + .../kusto/v2018_09_07_preview/Database.java | 220 +++ .../DatabaseCheckNameRequest.java | 77 + .../DatabasePrincipal.java | 50 + .../DatabasePrincipalListRequest.java | 45 + .../DatabasePrincipalListResult.java | 27 + .../DatabasePrincipalRole.java | 53 + .../DatabasePrincipalType.java | 44 + .../DatabaseStatistics.java | 44 + .../v2018_09_07_preview/DatabaseUpdate.java | 157 ++ .../kusto/v2018_09_07_preview/Databases.java | 97 ++ .../EventHubConnection.java | 239 +++ .../EventHubConnectionUpdate.java | 179 ++ .../EventHubConnectionValidation.java | 178 ++ ...ventHubConnectionValidationListResult.java | 26 + .../EventHubConnectionValidationResult.java | 43 + .../EventHubConnections.java | 68 + .../kusto/v2018_09_07_preview/Operation.java | 40 + .../v2018_09_07_preview/OperationDisplay.java | 122 ++ .../kusto/v2018_09_07_preview/Operations.java | 27 + .../ProvisioningState.java | 50 + .../kusto/v2018_09_07_preview/State.java | 59 + .../TrustedExternalTenant.java | 43 + .../implementation/AzureResourceSkuImpl.java | 52 + .../implementation/AzureResourceSkuInner.java | 96 ++ .../implementation/AzureSkuImpl.java | 42 + .../implementation/AzureSkuInner.java | 105 ++ .../implementation/CheckNameResultImpl.java | 41 + .../implementation/CheckNameResultInner.java | 96 ++ .../implementation/ClusterImpl.java | 132 ++ .../implementation/ClusterInner.java | 154 ++ .../implementation/ClustersImpl.java | 206 +++ .../implementation/ClustersInner.java | 1448 +++++++++++++++++ .../implementation/DatabaseImpl.java | 196 +++ .../implementation/DatabaseInner.java | 133 ++ .../implementation/DatabasePrincipalImpl.java | 58 + .../DatabasePrincipalInner.java | 177 ++ .../DatabasePrincipalListResultImpl.java | 32 + .../DatabasePrincipalListResultInner.java | 44 + .../implementation/DatabasesImpl.java | 138 ++ .../implementation/DatabasesInner.java | 1412 ++++++++++++++++ .../EventHubConnectionImpl.java | 202 +++ .../EventHubConnectionInner.java | 180 ++ ...HubConnectionValidationListResultImpl.java | 33 + ...ubConnectionValidationListResultInner.java | 45 + .../EventHubConnectionsImpl.java | 95 ++ .../EventHubConnectionsInner.java | 985 +++++++++++ .../implementation/IdParsingUtils.java | 57 + .../KustoManagementClientImpl.java | 238 +++ .../implementation/KustoManager.java | 135 ++ .../implementation/OperationImpl.java | 47 + .../implementation/OperationInner.java | 123 ++ .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 ++++ .../implementation/PageImpl.java | 75 + .../implementation/PageImpl1.java | 75 + .../implementation/package-info.java | 11 + .../v2018_09_07_preview/package-info.java | 11 + 70 files changed, 10144 insertions(+) create mode 100644 kusto/resource-manager/v2018_09_07_preview/pom.xml create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureCapacity.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureEntityResource.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureResourceSku.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureScaleType.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSku.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSkuName.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/CheckNameResult.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Cluster.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ClusterCheckNameRequest.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ClusterUpdate.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Clusters.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DataFormat.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Database.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseCheckNameRequest.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipal.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalListRequest.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalListResult.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalRole.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalType.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseStatistics.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseUpdate.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Databases.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnection.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionUpdate.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidation.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationListResult.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationResult.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnections.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Operation.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/OperationDisplay.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Operations.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ProvisioningState.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/State.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/TrustedExternalTenant.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalListResultImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalListResultInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/IdParsingUtils.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManagementClientImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManager.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationsImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationsInner.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/PageImpl.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/PageImpl1.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/package-info.java create mode 100644 kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/package-info.java diff --git a/kusto/resource-manager/v2018_09_07_preview/pom.xml b/kusto/resource-manager/v2018_09_07_preview/pom.xml new file mode 100644 index 000000000000..cd3671b9b349 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.kusto.v2018_09_07_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../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 + + + + + + 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureCapacity.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureCapacity.java new file mode 100644 index 000000000000..3de7c3da2d03 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AzureCapacity model. + */ +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureEntityResource.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureEntityResource.java new file mode 100644 index 000000000000..4ede9a1642a6 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureResourceSku.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureResourceSku.java new file mode 100644 index 000000000000..3bfd8038c81c --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.AzureResourceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureScaleType.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureScaleType.java new file mode 100644 index 000000000000..ea201bea5e3b --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSku.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSku.java new file mode 100644 index 000000000000..871ea0cc1cad --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSku.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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.AzureSkuInner; + +/** + * Type representing AzureSku. + */ +public interface AzureSku extends HasInner, HasManager { + /** + * @return the capacity value. + */ + Integer capacity(); + + /** + * @return the name value. + */ + AzureSkuName name(); + + /** + * @return the tier value. + */ + String tier(); + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSkuName.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSkuName.java new file mode 100644 index 000000000000..0b4df8166ded --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/AzureSkuName.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview; + +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 KC8 for AzureSkuName. */ + public static final AzureSkuName KC8 = fromString("KC8"); + + /** Static value KC16 for AzureSkuName. */ + public static final AzureSkuName KC16 = fromString("KC16"); + + /** Static value KS8 for AzureSkuName. */ + public static final AzureSkuName KS8 = fromString("KS8"); + + /** Static value KS16 for AzureSkuName. */ + public static final AzureSkuName KS16 = fromString("KS16"); + + /** Static value D13_v2 for AzureSkuName. */ + public static final AzureSkuName D13_V2 = fromString("D13_v2"); + + /** Static value D14_v2 for AzureSkuName. */ + public static final AzureSkuName D14_V2 = fromString("D14_v2"); + + /** Static value L8 for AzureSkuName. */ + public static final AzureSkuName L8 = fromString("L8"); + + /** Static value L16 for AzureSkuName. */ + public static final AzureSkuName L16 = fromString("L16"); + + /** + * 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/CheckNameResult.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/CheckNameResult.java new file mode 100644 index 000000000000..df3b7726c776 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/CheckNameResult.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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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(); + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Cluster.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Cluster.java new file mode 100644 index 000000000000..f3940346eb85 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Cluster.java @@ -0,0 +1,153 @@ +/** + * 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.v2018_09_07_preview; + +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.v2018_09_07_preview.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.AzureSkuInner; +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dataIngestionUri value. + */ + String dataIngestionUri(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + AzureSku sku(); + + /** + * @return the state value. + */ + State state(); + + /** + * @return the trustedExternalTenants value. + */ + List trustedExternalTenants(); + + /** + * @return the uri value. + */ + String uri(); + + /** + * 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(AzureSkuInner sku); + } + + /** + * 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 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.WithTrustedExternalTenants { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku, UpdateStages.WithTrustedExternalTenants { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * 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(AzureSkuInner 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); + } + + } +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ClusterCheckNameRequest.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ClusterCheckNameRequest.java new file mode 100644 index 000000000000..a9e57ecb39ea --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ClusterCheckNameRequest model. + */ +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ClusterUpdate.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ClusterUpdate.java new file mode 100644 index 000000000000..bb56b4655994 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ClusterUpdate.java @@ -0,0 +1,205 @@ +/** + * 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.v2018_09_07_preview; + +import java.util.Map; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.AzureSkuInner; +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; + + /** + * An ETag of the resource updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The SKU of the cluster. + */ + @JsonProperty(value = "sku") + private AzureSkuInner sku; + + /** + * The state of the resource. Possible values include: 'Creating', + * 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', + * 'Starting'. + */ + @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'. + */ + @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 cluster's external tenants. + */ + @JsonProperty(value = "properties.trustedExternalTenants") + private List trustedExternalTenants; + + /** + * 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 an ETag of the resource updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the SKU of the cluster. + * + * @return the sku value + */ + public AzureSkuInner 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(AzureSkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get the state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting'. + * + * @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'. + * + * @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 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; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Clusters.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Clusters.java new file mode 100644 index 000000000000..13bcaa059675 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Clusters.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.v2018_09_07_preview; + +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.v2018_09_07_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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); + + /** + * 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DataFormat.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DataFormat.java new file mode 100644 index 000000000000..20123d792042 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DataFormat.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.v2018_09_07_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataFormat. + */ +public final class DataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for DataFormat. */ + public static final DataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for DataFormat. */ + public static final DataFormat JSON = fromString("JSON"); + + /** Static value CSV for DataFormat. */ + public static final DataFormat CSV = fromString("CSV"); + + /** + * Creates or finds a DataFormat from its string representation. + * @param name a name to look for + * @return the corresponding DataFormat + */ + @JsonCreator + public static DataFormat fromString(String name) { + return fromString(name, DataFormat.class); + } + + /** + * @return known DataFormat values + */ + public static Collection values() { + return values(DataFormat.class); + } +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Database.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Database.java new file mode 100644 index 000000000000..17b7a8fa8fec --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Database.java @@ -0,0 +1,220 @@ +/** + * 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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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.v2018_09_07_preview.implementation.KustoManager; +import java.util.Map; + +/** + * Type representing Database. + */ +public interface Database extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hotCachePeriodInDays value. + */ + Integer hotCachePeriodInDays(); + + /** + * @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 softDeletePeriodInDays value. + */ + int softDeletePeriodInDays(); + + /** + * @return the statistics value. + */ + DatabaseStatistics statistics(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Database definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithLocation, DefinitionStages.WithSoftDeletePeriodInDays, 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 + */ + WithLocation withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the database definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The geo-location where the resource lives + * @return the next definition stage + */ + WithSoftDeletePeriodInDays withLocation(String location); + } + + /** + * The stage of the database definition allowing to specify SoftDeletePeriodInDays. + */ + interface WithSoftDeletePeriodInDays { + /** + * Specifies softDeletePeriodInDays. + * @param softDeletePeriodInDays The number of days data should be kept before it stops being accessible to queries + * @return the next definition stage + */ + WithCreate withSoftDeletePeriodInDays(int softDeletePeriodInDays); + } + + /** + * The stage of the database definition allowing to specify HotCachePeriodInDays. + */ + interface WithHotCachePeriodInDays { + /** + * Specifies hotCachePeriodInDays. + * @param hotCachePeriodInDays The number of days of data that should be kept in cache for fast queries + * @return the next definition stage + */ + WithCreate withHotCachePeriodInDays(Integer hotCachePeriodInDays); + } + + /** + * The stage of the database definition allowing to specify Statistics. + */ + interface WithStatistics { + /** + * Specifies statistics. + * @param statistics The statistics of the database + * @return the next definition stage + */ + WithCreate withStatistics(DatabaseStatistics statistics); + } + + /** + * The stage of the database definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * 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.WithHotCachePeriodInDays, DefinitionStages.WithStatistics, DefinitionStages.WithTags { + } + } + /** + * The template for a Database update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithHotCachePeriodInDays, UpdateStages.WithLocation, UpdateStages.WithStatistics { + } + + /** + * Grouping of Database update stages. + */ + interface UpdateStages { + /** + * The stage of the database update allowing to specify HotCachePeriodInDays. + */ + interface WithHotCachePeriodInDays { + /** + * Specifies hotCachePeriodInDays. + * @param hotCachePeriodInDays The number of days of data that should be kept in cache for fast queries + * @return the next update stage + */ + Update withHotCachePeriodInDays(Integer hotCachePeriodInDays); + } + + /** + * 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); + } + + /** + * The stage of the database update allowing to specify Statistics. + */ + interface WithStatistics { + /** + * Specifies statistics. + * @param statistics The statistics of the database + * @return the next update stage + */ + Update withStatistics(DatabaseStatistics statistics); + } + + } +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseCheckNameRequest.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseCheckNameRequest.java new file mode 100644 index 000000000000..a95c9af2381f --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseCheckNameRequest.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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatabaseCheckNameRequest model. + */ +public class DatabaseCheckNameRequest { + /** + * Database name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.Kusto/clusters/databases. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of DatabaseCheckNameRequest class. + * @param name database name. + */ + public DatabaseCheckNameRequest() { + type = "Microsoft.Kusto/clusters/databases"; + } + + /** + * Get database name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set database name. + * + * @param name the name value to set + * @return the DatabaseCheckNameRequest object itself. + */ + public DatabaseCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Kusto/clusters/databases. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Kusto/clusters/databases. + * + * @param type the type value to set + * @return the DatabaseCheckNameRequest object itself. + */ + public DatabaseCheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipal.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipal.java new file mode 100644 index 000000000000..6fc6d75a90eb --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipal.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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 type value. + */ + DatabasePrincipalType type(); + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalListRequest.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalListRequest.java new file mode 100644 index 000000000000..692035c9f795 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalListResult.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalListResult.java new file mode 100644 index 000000000000..de21d0473024 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.DatabasePrincipalListResultInner; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.DatabasePrincipalInner; +import java.util.List; + +/** + * Type representing DatabasePrincipalListResult. + */ +public interface DatabasePrincipalListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalRole.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalRole.java new file mode 100644 index 000000000000..4349065d2332 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalType.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalType.java new file mode 100644 index 000000000000..2477ecb6acd9 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseStatistics.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseStatistics.java new file mode 100644 index 000000000000..0e358f61a2e2 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatabaseStatistics model. + */ +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseUpdate.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseUpdate.java new file mode 100644 index 000000000000..b7e2dc81ac20 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabaseUpdate.java @@ -0,0 +1,157 @@ +/** + * 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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an update to a Kusto database. + */ +@JsonFlatten +public class DatabaseUpdate extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * An ETag of the resource updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The number of days data should be kept before it stops being accessible + * to queries. + */ + @JsonProperty(value = "properties.softDeletePeriodInDays", required = true) + private int softDeletePeriodInDays; + + /** + * The number of days of data that should be kept in cache for fast + * queries. + */ + @JsonProperty(value = "properties.hotCachePeriodInDays") + private Integer hotCachePeriodInDays; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + private DatabaseStatistics statistics; + + /** + * 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 DatabaseUpdate object itself. + */ + public DatabaseUpdate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get an ETag of the resource updated. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the number of days data should be kept before it stops being accessible to queries. + * + * @return the softDeletePeriodInDays value + */ + public int softDeletePeriodInDays() { + return this.softDeletePeriodInDays; + } + + /** + * Set the number of days data should be kept before it stops being accessible to queries. + * + * @param softDeletePeriodInDays the softDeletePeriodInDays value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withSoftDeletePeriodInDays(int softDeletePeriodInDays) { + this.softDeletePeriodInDays = softDeletePeriodInDays; + return this; + } + + /** + * Get the number of days of data that should be kept in cache for fast queries. + * + * @return the hotCachePeriodInDays value + */ + public Integer hotCachePeriodInDays() { + return this.hotCachePeriodInDays; + } + + /** + * Set the number of days of data that should be kept in cache for fast queries. + * + * @param hotCachePeriodInDays the hotCachePeriodInDays value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withHotCachePeriodInDays(Integer hotCachePeriodInDays) { + this.hotCachePeriodInDays = hotCachePeriodInDays; + 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 DatabaseUpdate object itself. + */ + public DatabaseUpdate withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Databases.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Databases.java new file mode 100644 index 000000000000..0eab10feea00 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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 name Database 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnection.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnection.java new file mode 100644 index 000000000000..bcd3a3a577ba --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnection.java @@ -0,0 +1,239 @@ +/** + * 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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.EventHubConnectionInner; +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.v2018_09_07_preview.implementation.KustoManager; + +/** + * Type representing EventHubConnection. + */ +public interface EventHubConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the consumerGroup value. + */ + String consumerGroup(); + + /** + * @return the dataFormat value. + */ + DataFormat dataFormat(); + + /** + * @return the eventHubResourceId value. + */ + String eventHubResourceId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mappingRuleName value. + */ + String mappingRuleName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tableName value. + */ + String tableName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the EventHubConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithConsumerGroup, DefinitionStages.WithEventHubResourceId, DefinitionStages.WithCreate { + } + + /** + * Grouping of EventHubConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a EventHubConnection definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the eventhubconnection 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 + */ + WithConsumerGroup withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName); + } + + /** + * The stage of the eventhubconnection definition allowing to specify ConsumerGroup. + */ + interface WithConsumerGroup { + /** + * Specifies consumerGroup. + * @param consumerGroup The event hub consumer group + * @return the next definition stage + */ + WithEventHubResourceId withConsumerGroup(String consumerGroup); + } + + /** + * The stage of the eventhubconnection definition allowing to specify EventHubResourceId. + */ + interface WithEventHubResourceId { + /** + * Specifies eventHubResourceId. + * @param eventHubResourceId The resource ID of the event hub to be used to create a data connection + * @return the next definition stage + */ + WithCreate withEventHubResourceId(String eventHubResourceId); + } + + /** + * The stage of the eventhubconnection definition allowing to specify DataFormat. + */ + interface WithDataFormat { + /** + * Specifies dataFormat. + * @param dataFormat The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV' + * @return the next definition stage + */ + WithCreate withDataFormat(DataFormat dataFormat); + } + + /** + * The stage of the eventhubconnection 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 eventhubconnection definition allowing to specify MappingRuleName. + */ + interface WithMappingRuleName { + /** + * Specifies mappingRuleName. + * @param mappingRuleName The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message + * @return the next definition stage + */ + WithCreate withMappingRuleName(String mappingRuleName); + } + + /** + * The stage of the eventhubconnection definition allowing to specify TableName. + */ + interface WithTableName { + /** + * Specifies tableName. + * @param tableName The table where the data should be ingested. Optionally the table information can be added to each message + * @return the next definition stage + */ + WithCreate withTableName(String tableName); + } + + /** + * 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.WithDataFormat, DefinitionStages.WithLocation, DefinitionStages.WithMappingRuleName, DefinitionStages.WithTableName { + } + } + /** + * The template for a EventHubConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDataFormat, UpdateStages.WithLocation, UpdateStages.WithMappingRuleName, UpdateStages.WithTableName { + } + + /** + * Grouping of EventHubConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the eventhubconnection update allowing to specify DataFormat. + */ + interface WithDataFormat { + /** + * Specifies dataFormat. + * @param dataFormat The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV' + * @return the next update stage + */ + Update withDataFormat(DataFormat dataFormat); + } + + /** + * The stage of the eventhubconnection update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the eventhubconnection update allowing to specify MappingRuleName. + */ + interface WithMappingRuleName { + /** + * Specifies mappingRuleName. + * @param mappingRuleName The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message + * @return the next update stage + */ + Update withMappingRuleName(String mappingRuleName); + } + + /** + * The stage of the eventhubconnection update allowing to specify TableName. + */ + interface WithTableName { + /** + * Specifies tableName. + * @param tableName The table where the data should be ingested. Optionally the table information can be added to each message + * @return the next update stage + */ + Update withTableName(String tableName); + } + + } +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionUpdate.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionUpdate.java new file mode 100644 index 000000000000..f985bcb45152 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionUpdate.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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an update to event hub connection. + */ +@JsonFlatten +public class EventHubConnectionUpdate extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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'. + */ + @JsonProperty(value = "properties.dataFormat") + private DataFormat dataFormat; + + /** + * 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 EventHubConnectionUpdate object itself. + */ + public EventHubConnectionUpdate withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 EventHubConnectionUpdate object itself. + */ + public EventHubConnectionUpdate 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 EventHubConnectionUpdate object itself. + */ + public EventHubConnectionUpdate 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 EventHubConnectionUpdate object itself. + */ + public EventHubConnectionUpdate 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 EventHubConnectionUpdate object itself. + */ + public EventHubConnectionUpdate 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'. + * + * @return the dataFormat value + */ + public DataFormat 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'. + * + * @param dataFormat the dataFormat value to set + * @return the EventHubConnectionUpdate object itself. + */ + public EventHubConnectionUpdate withDataFormat(DataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidation.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidation.java new file mode 100644 index 000000000000..225cfea2ffe1 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidation.java @@ -0,0 +1,178 @@ +/** + * 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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Class representing an event hub connection validation. + */ +@JsonFlatten +public class EventHubConnectionValidation { + /** + * The name of the event hub connection. + */ + @JsonProperty(value = "eventhubConnectionName") + private String eventhubConnectionName; + + /** + * 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'. + */ + @JsonProperty(value = "properties.dataFormat") + private DataFormat dataFormat; + + /** + * Get the name of the event hub connection. + * + * @return the eventhubConnectionName value + */ + public String eventhubConnectionName() { + return this.eventhubConnectionName; + } + + /** + * Set the name of the event hub connection. + * + * @param eventhubConnectionName the eventhubConnectionName value to set + * @return the EventHubConnectionValidation object itself. + */ + public EventHubConnectionValidation withEventhubConnectionName(String eventhubConnectionName) { + this.eventhubConnectionName = eventhubConnectionName; + return this; + } + + /** + * 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 EventHubConnectionValidation object itself. + */ + public EventHubConnectionValidation 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 EventHubConnectionValidation object itself. + */ + public EventHubConnectionValidation 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 EventHubConnectionValidation object itself. + */ + public EventHubConnectionValidation 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 EventHubConnectionValidation object itself. + */ + public EventHubConnectionValidation 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'. + * + * @return the dataFormat value + */ + public DataFormat 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'. + * + * @param dataFormat the dataFormat value to set + * @return the EventHubConnectionValidation object itself. + */ + public EventHubConnectionValidation withDataFormat(DataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationListResult.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationListResult.java new file mode 100644 index 000000000000..862744d23731 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationListResult.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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.EventHubConnectionValidationListResultInner; +import java.util.List; + +/** + * Type representing EventHubConnectionValidationListResult. + */ +public interface EventHubConnectionValidationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationResult.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationResult.java new file mode 100644 index 000000000000..ece509b3bc48 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnectionValidationResult.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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EventHubConnectionValidationResult model. + */ +public class EventHubConnectionValidationResult { + /** + * A message which indicates a problem in event hub connection validation. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get a message which indicates a problem in event hub connection validation. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set a message which indicates a problem in event hub connection validation. + * + * @param errorMessage the errorMessage value to set + * @return the EventHubConnectionValidationResult object itself. + */ + public EventHubConnectionValidationResult withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnections.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnections.java new file mode 100644 index 000000000000..3433854fc26a --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/EventHubConnections.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.v2018_09_07_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.EventHubConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing EventHubConnections. + */ +public interface EventHubConnections extends SupportsCreating, HasInner { + /** + * Returns an Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName); + + /** + * Returns the list of Event Hub 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 Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName); + + /** + * Checks that the Event Hub 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 Event Hub connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable eventhubConnectionValidationAsync(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation parameters); + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Operation.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Operation.java new file mode 100644 index 000000000000..6a0ff9a8fef8 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/OperationDisplay.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/OperationDisplay.java new file mode 100644 index 000000000000..f7994eae7c66 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Operations.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/Operations.java new file mode 100644 index 000000000000..8391fb308194 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import rx.Observable; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ProvisioningState.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ProvisioningState.java new file mode 100644 index 000000000000..2c12a1c9f542 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/ProvisioningState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview; + +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"); + + /** + * 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/State.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/State.java new file mode 100644 index 000000000000..24b99ed733ec --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/State.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview; + +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"); + + /** + * 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/TrustedExternalTenant.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/TrustedExternalTenant.java new file mode 100644 index 000000000000..1d4fbb8cb705 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TrustedExternalTenant model. + */ +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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuImpl.java new file mode 100644 index 000000000000..8eab6240be82 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureCapacity; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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() { + AzureSkuInner inner = this.inner().sku(); + if (inner != null) { + return new AzureSkuImpl(inner, manager()); + } else { + return null; + } + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuInner.java new file mode 100644 index 000000000000..816ef40d457e --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureResourceSkuInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AzureResourceSkuInner model. + */ +public class AzureResourceSkuInner { + /** + * Resource Namespace and Type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * The SKU details. + */ + @JsonProperty(value = "sku") + private AzureSkuInner sku; + + /** + * The SKU capacity. + */ + @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 AzureSkuInner sku() { + return this.sku; + } + + /** + * Set the SKU details. + * + * @param sku the sku value to set + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withSku(AzureSkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get the SKU capacity. + * + * @return the capacity value + */ + public AzureCapacity capacity() { + return this.capacity; + } + + /** + * Set the SKU capacity. + * + * @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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuImpl.java new file mode 100644 index 000000000000..1b07be575f9c --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureSkuName; + +class AzureSkuImpl extends WrapperImpl implements AzureSku { + private final KustoManager manager; + AzureSkuImpl(AzureSkuInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Integer capacity() { + return this.inner().capacity(); + } + + @Override + public AzureSkuName name() { + return this.inner().name(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuInner.java new file mode 100644 index 000000000000..9ac6ba92c2b5 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/AzureSkuInner.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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureSkuName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AzureSkuInner model. + */ +public class AzureSkuInner { + /** + * SKU name. Possible values include: 'KC8', 'KC16', 'KS8', 'KS16', + * 'D13_v2', 'D14_v2', 'L8', 'L16'. + */ + @JsonProperty(value = "name", required = true) + private AzureSkuName name; + + /** + * SKU capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * SKU tier. + */ + @JsonProperty(value = "tier", required = true) + private String tier; + + /** + * Creates an instance of AzureSkuInner class. + * @param name sKU name. Possible values include: 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16'. + */ + public AzureSkuInner() { + tier = "Standard"; + } + + /** + * Get sKU name. Possible values include: 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16'. + * + * @return the name value + */ + public AzureSkuName name() { + return this.name; + } + + /** + * Set sKU name. Possible values include: 'KC8', 'KC16', 'KS8', 'KS16', 'D13_v2', 'D14_v2', 'L8', 'L16'. + * + * @param name the name value to set + * @return the AzureSkuInner object itself. + */ + public AzureSkuInner withName(AzureSkuName name) { + this.name = name; + return this; + } + + /** + * Get sKU capacity. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set sKU capacity. + * + * @param capacity the capacity value to set + * @return the AzureSkuInner object itself. + */ + public AzureSkuInner withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get sKU tier. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set sKU tier. + * + * @param tier the tier value to set + * @return the AzureSkuInner object itself. + */ + public AzureSkuInner withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultImpl.java new file mode 100644 index 000000000000..173637fd73cb --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultImpl.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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.CheckNameResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +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(); + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultInner.java new file mode 100644 index 000000000000..788d04487ffe --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/CheckNameResultInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameResultInner model. + */ +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; + + /** + * 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; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterImpl.java new file mode 100644 index 000000000000..6b6734cf9062 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterImpl.java @@ -0,0 +1,132 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.ClusterUpdate; +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.State; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.ProvisioningState; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.TrustedExternalTenant; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureSku; +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 String etag() { + return this.inner().etag(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AzureSku sku() { + AzureSkuInner inner = this.inner().sku(); + if (inner != null) { + return new AzureSkuImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public State state() { + return this.inner().state(); + } + + @Override + public List trustedExternalTenants() { + return this.inner().trustedExternalTenants(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + + @Override + public ClusterImpl withSku(AzureSkuInner sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public ClusterImpl withTrustedExternalTenants(List trustedExternalTenants) { + if (isInCreateMode()) { + this.inner().withTrustedExternalTenants(trustedExternalTenants); + } else { + this.updateParameter.withTrustedExternalTenants(trustedExternalTenants); + } + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterInner.java new file mode 100644 index 000000000000..474f3034393c --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClusterInner.java @@ -0,0 +1,154 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.State; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.ProvisioningState; +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.TrustedExternalTenant; +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 { + /** + * An ETag of the resource created. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The SKU of the cluster. + */ + @JsonProperty(value = "sku", required = true) + private AzureSkuInner sku; + + /** + * The state of the resource. Possible values include: 'Creating', + * 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', + * 'Starting'. + */ + @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'. + */ + @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 cluster's external tenants. + */ + @JsonProperty(value = "properties.trustedExternalTenants") + private List trustedExternalTenants; + + /** + * Get an ETag of the resource created. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the SKU of the cluster. + * + * @return the sku value + */ + public AzureSkuInner 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(AzureSkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get the state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting'. + * + * @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'. + * + * @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 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; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java new file mode 100644 index 000000000000..e90a150e6d76 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java @@ -0,0 +1,206 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Clusters; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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.v2018_09_07_preview.CheckNameResult; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureResourceSku; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.AzureSku; + +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 + 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 AzureSku call(AzureSkuInner inner) { + return new AzureSkuImpl(inner, manager()); + } + }); + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java new file mode 100644 index 000000000000..699b6f5f40b6 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java @@ -0,0 +1,1448 @@ +/** + * 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.v2018_09_07_preview.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.v2018_09_07_preview.ClusterCheckNameRequest; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.ClusterUpdate; +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; + +/** + * 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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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); + + } + + /** + * 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()) + .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); + } + + /** + * 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<AzureSkuInner> 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<AzureSkuInner> 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<AzureSkuInner> 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); + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseImpl.java new file mode 100644 index 000000000000..eeb3ae4568ab --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseImpl.java @@ -0,0 +1,196 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Database; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabaseUpdate; +import java.util.Map; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.ProvisioningState; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabaseStatistics; +import rx.functions.Func1; + +class DatabaseImpl extends CreatableUpdatableImpl implements Database, Database.Definition, Database.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + private DatabaseUpdate updateParameter; + + DatabaseImpl(String name, KustoManager manager) { + super(name, new DatabaseInner()); + this.manager = manager; + // Set resource name + this.databaseName = name; + // + this.updateParameter = new DatabaseUpdate(); + } + + 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"); + // + this.updateParameter = new DatabaseUpdate(); + } + + @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(new Func1() { + @Override + public DatabaseInner call(DatabaseInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.updateParameter) + .map(new Func1() { + @Override + public DatabaseInner call(DatabaseInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .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; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new DatabaseUpdate(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Integer hotCachePeriodInDays() { + return this.inner().hotCachePeriodInDays(); + } + + @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 int softDeletePeriodInDays() { + return this.inner().softDeletePeriodInDays(); + } + + @Override + public DatabaseStatistics statistics() { + return this.inner().statistics(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @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 withSoftDeletePeriodInDays(int softDeletePeriodInDays) { + this.inner().withSoftDeletePeriodInDays(softDeletePeriodInDays); + return this; + } + + @Override + public DatabaseImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public DatabaseImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public DatabaseImpl withHotCachePeriodInDays(Integer hotCachePeriodInDays) { + if (isInCreateMode()) { + this.inner().withHotCachePeriodInDays(hotCachePeriodInDays); + } else { + this.updateParameter.withHotCachePeriodInDays(hotCachePeriodInDays); + } + return this; + } + + @Override + public DatabaseImpl withStatistics(DatabaseStatistics statistics) { + if (isInCreateMode()) { + this.inner().withStatistics(statistics); + } else { + this.updateParameter.withStatistics(statistics); + } + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseInner.java new file mode 100644 index 000000000000..38cfbffc7a38 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabaseInner.java @@ -0,0 +1,133 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.ProvisioningState; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabaseStatistics; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Class representing a Kusto database. + */ +@JsonFlatten +public class DatabaseInner extends Resource { + /** + * An ETag of the resource created. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The number of days data should be kept before it stops being accessible + * to queries. + */ + @JsonProperty(value = "properties.softDeletePeriodInDays", required = true) + private int softDeletePeriodInDays; + + /** + * The number of days of data that should be kept in cache for fast + * queries. + */ + @JsonProperty(value = "properties.hotCachePeriodInDays") + private Integer hotCachePeriodInDays; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + private DatabaseStatistics statistics; + + /** + * Get an ETag of the resource created. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the number of days data should be kept before it stops being accessible to queries. + * + * @return the softDeletePeriodInDays value + */ + public int softDeletePeriodInDays() { + return this.softDeletePeriodInDays; + } + + /** + * Set the number of days data should be kept before it stops being accessible to queries. + * + * @param softDeletePeriodInDays the softDeletePeriodInDays value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withSoftDeletePeriodInDays(int softDeletePeriodInDays) { + this.softDeletePeriodInDays = softDeletePeriodInDays; + return this; + } + + /** + * Get the number of days of data that should be kept in cache for fast queries. + * + * @return the hotCachePeriodInDays value + */ + public Integer hotCachePeriodInDays() { + return this.hotCachePeriodInDays; + } + + /** + * Set the number of days of data that should be kept in cache for fast queries. + * + * @param hotCachePeriodInDays the hotCachePeriodInDays value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withHotCachePeriodInDays(Integer hotCachePeriodInDays) { + this.hotCachePeriodInDays = hotCachePeriodInDays; + 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 DatabaseInner object itself. + */ + public DatabaseInner withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalImpl.java new file mode 100644 index 000000000000..f3360aa32558 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalImpl.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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabasePrincipal; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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 DatabasePrincipalType type() { + return this.inner().type(); + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalInner.java new file mode 100644 index 000000000000..5fbf901598c6 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalInner.java @@ -0,0 +1,177 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabasePrincipalType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatabasePrincipalInner model. + */ +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; + + /** + * 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; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalListResultImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalListResultImpl.java new file mode 100644 index 000000000000..613458ef646e --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalListResultInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasePrincipalListResultInner.java new file mode 100644 index 000000000000..3494f52380ef --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesImpl.java new file mode 100644 index 000000000000..376f9ef4128f --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Databases; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabasePrincipal; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabasePrincipalListResult; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Database; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.CheckNameResult; + +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) + .map(new Func1() { + @Override + public Database call(DatabaseInner inner) { + return 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, String name) { + DatabasesInner 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java new file mode 100644 index 000000000000..54f7c8547e87 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java @@ -0,0 +1,1412 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabaseCheckNameRequest; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabasePrincipalListRequest; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DatabaseUpdate; +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.v2018_09_07_preview.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, @Header("accept-language") String acceptLanguage, @Body DatabaseCheckNameRequest databaseName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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 DatabaseUpdate 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.v2018_09_07_preview.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 DatabaseUpdate 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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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.v2018_09_07_preview.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 name Database 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 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 name Database 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 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 name Database 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 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 name Database 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."); + } + DatabaseCheckNameRequest databaseName = new DatabaseCheckNameRequest(); + databaseName.withName(name); + return service.checkNameAvailability(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databaseName, 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, DatabaseUpdate 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, DatabaseUpdate 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, DatabaseUpdate 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, DatabaseUpdate 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, DatabaseUpdate 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, DatabaseUpdate 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, DatabaseUpdate 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, DatabaseUpdate 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionImpl.java new file mode 100644 index 000000000000..f0aa9a0295bc --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionImpl.java @@ -0,0 +1,202 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionUpdate; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DataFormat; +import rx.functions.Func1; + +class EventHubConnectionImpl extends CreatableUpdatableImpl implements EventHubConnection, EventHubConnection.Definition, EventHubConnection.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + private String eventHubConnectionName; + private EventHubConnectionUpdate updateParameter; + + EventHubConnectionImpl(String name, KustoManager manager) { + super(name, new EventHubConnectionInner()); + this.manager = manager; + // Set resource name + this.eventHubConnectionName = name; + // + this.updateParameter = new EventHubConnectionUpdate(); + } + + EventHubConnectionImpl(EventHubConnectionInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.eventHubConnectionName = 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.eventHubConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "eventhubconnections"); + // + this.updateParameter = new EventHubConnectionUpdate(); + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EventHubConnectionsInner client = this.manager().inner().eventHubConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.eventHubConnectionName, this.inner()) + .map(new Func1() { + @Override + public EventHubConnectionInner call(EventHubConnectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EventHubConnectionsInner client = this.manager().inner().eventHubConnections(); + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.eventHubConnectionName, this.updateParameter) + .map(new Func1() { + @Override + public EventHubConnectionInner call(EventHubConnectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EventHubConnectionsInner client = this.manager().inner().eventHubConnections(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.eventHubConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new EventHubConnectionUpdate(); + } + + @Override + public String consumerGroup() { + return this.inner().consumerGroup(); + } + + @Override + public DataFormat dataFormat() { + return this.inner().dataFormat(); + } + + @Override + public String eventHubResourceId() { + return this.inner().eventHubResourceId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String mappingRuleName() { + return this.inner().mappingRuleName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String tableName() { + return this.inner().tableName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public EventHubConnectionImpl withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.databaseName = databaseName; + return this; + } + + @Override + public EventHubConnectionImpl withConsumerGroup(String consumerGroup) { + this.inner().withConsumerGroup(consumerGroup); + return this; + } + + @Override + public EventHubConnectionImpl withEventHubResourceId(String eventHubResourceId) { + this.inner().withEventHubResourceId(eventHubResourceId); + return this; + } + + @Override + public EventHubConnectionImpl withDataFormat(DataFormat dataFormat) { + if (isInCreateMode()) { + this.inner().withDataFormat(dataFormat); + } else { + this.updateParameter.withDataFormat(dataFormat); + } + return this; + } + + @Override + public EventHubConnectionImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public EventHubConnectionImpl withMappingRuleName(String mappingRuleName) { + if (isInCreateMode()) { + this.inner().withMappingRuleName(mappingRuleName); + } else { + this.updateParameter.withMappingRuleName(mappingRuleName); + } + return this; + } + + @Override + public EventHubConnectionImpl withTableName(String tableName) { + if (isInCreateMode()) { + this.inner().withTableName(tableName); + } else { + this.updateParameter.withTableName(tableName); + } + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionInner.java new file mode 100644 index 000000000000..a9898142725c --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionInner.java @@ -0,0 +1,180 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.DataFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an event hub connection. + */ +@JsonFlatten +public class EventHubConnectionInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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'. + */ + @JsonProperty(value = "properties.dataFormat") + private DataFormat dataFormat; + + /** + * 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 EventHubConnectionInner object itself. + */ + public EventHubConnectionInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 EventHubConnectionInner object itself. + */ + public EventHubConnectionInner 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 EventHubConnectionInner object itself. + */ + public EventHubConnectionInner 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 EventHubConnectionInner object itself. + */ + public EventHubConnectionInner 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 EventHubConnectionInner object itself. + */ + public EventHubConnectionInner 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'. + * + * @return the dataFormat value + */ + public DataFormat 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'. + * + * @param dataFormat the dataFormat value to set + * @return the EventHubConnectionInner object itself. + */ + public EventHubConnectionInner withDataFormat(DataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultImpl.java new file mode 100644 index 000000000000..54135b3e97c5 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultImpl.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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionValidationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionValidationResult; + +class EventHubConnectionValidationListResultImpl extends WrapperImpl implements EventHubConnectionValidationListResult { + private final KustoManager manager; + EventHubConnectionValidationListResultImpl(EventHubConnectionValidationListResultInner 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultInner.java new file mode 100644 index 000000000000..f88372fd797f --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionValidationListResultInner.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.v2018_09_07_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionValidationResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto event hub connection validation result. + */ +public class EventHubConnectionValidationListResultInner { + /** + * The list of Kusto event hub connection validation errors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto event hub connection validation errors. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Kusto event hub connection validation errors. + * + * @param value the value value to set + * @return the EventHubConnectionValidationListResultInner object itself. + */ + public EventHubConnectionValidationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsImpl.java new file mode 100644 index 000000000000..05459c9b0e35 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsImpl.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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnection; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionValidationListResult; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionValidation; + +class EventHubConnectionsImpl extends WrapperImpl implements EventHubConnections { + private final KustoManager manager; + + EventHubConnectionsImpl(KustoManager manager) { + super(manager.inner().eventHubConnections()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public EventHubConnectionImpl define(String name) { + return wrapModel(name); + } + + private EventHubConnectionImpl wrapModel(EventHubConnectionInner inner) { + return new EventHubConnectionImpl(inner, manager()); + } + + private EventHubConnectionImpl wrapModel(String name) { + return new EventHubConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) { + EventHubConnectionsInner 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 EventHubConnection call(EventHubConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName) { + EventHubConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName) + .map(new Func1() { + @Override + public EventHubConnection call(EventHubConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName) { + EventHubConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName).toCompletable(); + } + + @Override + public Observable eventhubConnectionValidationAsync(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation parameters) { + EventHubConnectionsInner client = this.inner(); + return client.eventhubConnectionValidationAsync(resourceGroupName, clusterName, databaseName, parameters) + .map(new Func1() { + @Override + public EventHubConnectionValidationListResult call(EventHubConnectionValidationListResultInner inner) { + return new EventHubConnectionValidationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java new file mode 100644 index 000000000000..936f619a8a3b --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java @@ -0,0 +1,985 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionUpdate; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnectionValidation; +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 EventHubConnections. + */ +public class EventHubConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private EventHubConnectionsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of EventHubConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EventHubConnectionsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(EventHubConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for EventHubConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface EventHubConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnections listByDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections") + 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.v2018_09_07_preview.EventHubConnections eventhubConnectionValidation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubConnectionValidation") + Observable> eventhubConnectionValidation(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body EventHubConnectionValidation 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.v2018_09_07_preview.EventHubConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("eventHubConnectionName") String eventHubConnectionName, @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.v2018_09_07_preview.EventHubConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("eventHubConnectionName") String eventHubConnectionName, @Path("subscriptionId") String subscriptionId, @Body EventHubConnectionInner 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.v2018_09_07_preview.EventHubConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("eventHubConnectionName") String eventHubConnectionName, @Path("subscriptionId") String subscriptionId, @Body EventHubConnectionInner 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.v2018_09_07_preview.EventHubConnections update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("eventHubConnectionName") String eventHubConnectionName, @Path("subscriptionId") String subscriptionId, @Body EventHubConnectionUpdate 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.v2018_09_07_preview.EventHubConnections beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("eventHubConnectionName") String eventHubConnectionName, @Path("subscriptionId") String subscriptionId, @Body EventHubConnectionUpdate 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.v2018_09_07_preview.EventHubConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("eventHubConnectionName") String eventHubConnectionName, @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.v2018_09_07_preview.EventHubConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("eventHubConnectionName") String eventHubConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns the list of Event Hub 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<EventHubConnectionInner> object if successful. + */ + public List listByDatabase(String resourceGroupName, String clusterName, String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Returns the list of Event Hub 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 Event Hub 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<EventHubConnectionInner> 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 Event Hub 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<EventHubConnectionInner> 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 Event Hub 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 Event Hub 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 EventHubConnectionValidationListResultInner object if successful. + */ + public EventHubConnectionValidationListResultInner eventhubConnectionValidation(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation parameters) { + return eventhubConnectionValidationWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * Checks that the Event Hub 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 Event Hub 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 eventhubConnectionValidationAsync(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(eventhubConnectionValidationWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Checks that the Event Hub 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 Event Hub connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionValidationListResultInner object + */ + public Observable eventhubConnectionValidationAsync(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation parameters) { + return eventhubConnectionValidationWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, EventHubConnectionValidationListResultInner>() { + @Override + public EventHubConnectionValidationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the Event Hub 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 Event Hub connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionValidationListResultInner object + */ + public Observable> eventhubConnectionValidationWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation 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.eventhubConnectionValidation(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 = eventhubConnectionValidationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse eventhubConnectionValidationDelegate(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 an Event Hub 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 eventHubConnectionName The name of the event hub 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 EventHubConnectionInner object if successful. + */ + public EventHubConnectionInner get(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName).toBlocking().single().body(); + } + + /** + * Returns an Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName), serviceCallback); + } + + /** + * Returns an Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName).map(new Func1, EventHubConnectionInner>() { + @Override + public EventHubConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns an Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName) { + 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 (eventHubConnectionName == null) { + throw new IllegalArgumentException("Parameter eventHubConnectionName 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, eventHubConnectionName, 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 Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 EventHubConnectionInner object if successful. + */ + public EventHubConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).map(new Func1, EventHubConnectionInner>() { + @Override + public EventHubConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionInner 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 (eventHubConnectionName == null) { + throw new IllegalArgumentException("Parameter eventHubConnectionName 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, eventHubConnectionName, 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 Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 EventHubConnectionInner object if successful. + */ + public EventHubConnectionInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).map(new Func1, EventHubConnectionInner>() { + @Override + public EventHubConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner 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 (eventHubConnectionName == null) { + throw new IllegalArgumentException("Parameter eventHubConnectionName 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, eventHubConnectionName, 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 Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 EventHubConnectionInner object if successful. + */ + public EventHubConnectionInner update(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters), serviceCallback); + } + + /** + * Updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).map(new Func1, EventHubConnectionInner>() { + @Override + public EventHubConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionUpdate 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 (eventHubConnectionName == null) { + throw new IllegalArgumentException("Parameter eventHubConnectionName 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, eventHubConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 EventHubConnectionInner object if successful. + */ + public EventHubConnectionInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub 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 eventHubConnectionName, EventHubConnectionUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters), serviceCallback); + } + + /** + * Updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).map(new Func1, EventHubConnectionInner>() { + @Override + public EventHubConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Event Hub 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 eventHubConnectionName The name of the event hub connection. + * @param parameters The Event Hub connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventHubConnectionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionUpdate 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 (eventHubConnectionName == null) { + throw new IllegalArgumentException("Parameter eventHubConnectionName 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, eventHubConnectionName, 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 Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName), serviceCallback); + } + + /** + * Deletes the Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName) { + 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 (eventHubConnectionName == null) { + throw new IllegalArgumentException("Parameter eventHubConnectionName 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, eventHubConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName), serviceCallback); + } + + /** + * Deletes the Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Event Hub 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 eventHubConnectionName The name of the event hub 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 eventHubConnectionName) { + 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 (eventHubConnectionName == null) { + throw new IllegalArgumentException("Parameter eventHubConnectionName 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, eventHubConnectionName, 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/IdParsingUtils.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..f2a0542955a8 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManagementClientImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManagementClientImpl.java new file mode 100644 index 000000000000..0dc57c4dc593 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManagementClientImpl.java @@ -0,0 +1,238 @@ +/** + * 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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +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 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 EventHubConnectionsInner object to access its operations. + */ + private EventHubConnectionsInner eventHubConnections; + + /** + * Gets the EventHubConnectionsInner object to access its operations. + * @return the EventHubConnectionsInner object. + */ + public EventHubConnectionsInner eventHubConnections() { + return this.eventHubConnections; + } + + /** + * 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 = "2018-09-07-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.databases = new DatabasesInner(restClient().retrofit(), this); + this.eventHubConnections = new EventHubConnectionsInner(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", "2018-09-07-preview"); + } +} diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManager.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManager.java new file mode 100644 index 000000000000..c5dddcc6b07f --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/KustoManager.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.v2018_09_07_preview.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.v2018_09_07_preview.Clusters; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Databases; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.EventHubConnections; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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 Databases databases; + private EventHubConnections eventHubConnections; + 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 Databases. + */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(this); + } + return this.databases; + } + + /** + * @return Entry point to manage EventHubConnections. + */ + public EventHubConnections eventHubConnections() { + if (this.eventHubConnections == null) { + this.eventHubConnections = new EventHubConnectionsImpl(this); + } + return this.eventHubConnections; + } + + /** + * @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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..17ce77aec910 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationInner.java new file mode 100644 index 000000000000..d22b8e5cab48 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationsImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..124a42170a5f --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.kusto.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationsInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..73b76b6594f7 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.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.v2018_09_07_preview.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.v2018_09_07_preview.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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/PageImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..098eee00d425 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class 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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/PageImpl1.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/PageImpl1.java new file mode 100644 index 000000000000..10f7d3aa6058 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2018_09_07_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/package-info.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/package-info.java new file mode 100644 index 000000000000..f734d39e63cd --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview.implementation; diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/package-info.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/package-info.java new file mode 100644 index 000000000000..5e6a9ec889c9 --- /dev/null +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/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.v2018_09_07_preview; From e9b3414c0deecc03de86193cb54028bffe962a35 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Fri, 1 Feb 2019 17:52:33 -0800 Subject: [PATCH 2/2] Manual fixes --- .../implementation/ClustersImpl.java | 6 ++--- .../implementation/ClustersInner.java | 22 ++++++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java index e90a150e6d76..4a6acad789c0 100644 --- a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersImpl.java @@ -110,10 +110,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/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java index 699b6f5f40b6..361e56974615 100644 --- a/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java +++ b/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java @@ -1120,8 +1120,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; + } + }; } /** @@ -1141,11 +1149,13 @@ public ServiceFuture> listAsync(final ServiceCallback> listAsync() { - return listWithServiceResponseAsync().map(new Func1>, List>() { + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { @Override - public List call(ServiceResponse> response) { - return response.body(); + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; } }); }