From 6ef064bf8a3134df242c7bd405a160bfc5150634 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 21 Mar 2019 14:05:07 -0700 Subject: [PATCH] Generated from 1d3ad9bf12dd4db592243bb5572a3c094e2d3403 (#3091) Kusto: Suppress R2016 warning --- .../v2018_09_07_preview/pom.xml | 2 +- .../implementation/ClustersImpl.java | 6 +- .../implementation/ClustersInner.java | 22 +- kusto/resource-manager/v2019_01_21/pom.xml | 133 ++ .../kusto/v2019_01_21/AzureCapacity.java | 121 ++ .../v2019_01_21/AzureEntityResource.java | 34 + .../kusto/v2019_01_21/AzureResourceSku.java | 35 + .../kusto/v2019_01_21/AzureScaleType.java | 44 + .../kusto/v2019_01_21/AzureSku.java | 35 + .../kusto/v2019_01_21/AzureSkuName.java | 56 + .../kusto/v2019_01_21/CheckNameResult.java | 35 + .../management/kusto/v2019_01_21/Cluster.java | 148 ++ .../v2019_01_21/ClusterCheckNameRequest.java | 77 + .../kusto/v2019_01_21/ClusterUpdate.java | 190 +++ .../kusto/v2019_01_21/Clusters.java | 75 + .../kusto/v2019_01_21/DataConnection.java | 118 ++ .../v2019_01_21/DataConnectionValidation.java | 70 + .../DataConnectionValidationListResult.java | 26 + .../DataConnectionValidationResult.java | 43 + .../kusto/v2019_01_21/DataConnections.java | 68 + .../kusto/v2019_01_21/DataFormat.java | 68 + .../kusto/v2019_01_21/Database.java | 210 +++ .../v2019_01_21/DatabaseCheckNameRequest.java | 77 + .../kusto/v2019_01_21/DatabasePrincipal.java | 50 + .../DatabasePrincipalListRequest.java | 45 + .../DatabasePrincipalListResult.java | 27 + .../v2019_01_21/DatabasePrincipalRole.java | 53 + .../v2019_01_21/DatabasePrincipalType.java | 44 + .../kusto/v2019_01_21/DatabaseStatistics.java | 44 + .../kusto/v2019_01_21/DatabaseUpdate.java | 143 ++ .../kusto/v2019_01_21/Databases.java | 97 ++ .../v2019_01_21/EventGridDataConnection.java | 184 +++ .../v2019_01_21/EventHubDataConnection.java | 158 ++ .../kusto/v2019_01_21/Operation.java | 40 + .../kusto/v2019_01_21/OperationDisplay.java | 122 ++ .../kusto/v2019_01_21/Operations.java | 27 + .../kusto/v2019_01_21/ProvisioningState.java | 50 + .../management/kusto/v2019_01_21/State.java | 62 + .../v2019_01_21/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 | 127 ++ .../implementation/ClusterInner.java | 139 ++ .../implementation/ClustersImpl.java | 206 +++ .../implementation/ClustersInner.java | 1448 +++++++++++++++++ .../implementation/DataConnectionImpl.java | 108 ++ .../implementation/DataConnectionInner.java | 53 + ...ataConnectionValidationListResultImpl.java | 33 + ...taConnectionValidationListResultInner.java | 45 + .../implementation/DataConnectionsImpl.java | 95 ++ .../implementation/DataConnectionsInner.java | 984 +++++++++++ .../implementation/DatabaseImpl.java | 184 +++ .../implementation/DatabaseInner.java | 145 ++ .../implementation/DatabasePrincipalImpl.java | 58 + .../DatabasePrincipalInner.java | 177 ++ .../DatabasePrincipalListResultImpl.java | 32 + .../DatabasePrincipalListResultInner.java | 44 + .../implementation/DatabasesImpl.java | 138 ++ .../implementation/DatabasesInner.java | 1412 ++++++++++++++++ .../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 ++++ .../v2019_01_21/implementation/PageImpl.java | 75 + .../v2019_01_21/implementation/PageImpl1.java | 75 + .../implementation/package-info.java | 11 + .../kusto/v2019_01_21/package-info.java | 11 + 74 files changed, 9826 insertions(+), 20 deletions(-) create mode 100644 kusto/resource-manager/v2019_01_21/pom.xml create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureCapacity.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureEntityResource.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureResourceSku.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureScaleType.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSku.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/CheckNameResult.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterCheckNameRequest.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Clusters.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnection.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidation.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationListResult.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationResult.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnections.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataFormat.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseCheckNameRequest.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipal.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalListRequest.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalListResult.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalRole.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalType.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseStatistics.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseUpdate.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Databases.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventGridDataConnection.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventHubDataConnection.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Operation.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/OperationDisplay.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Operations.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ProvisioningState.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/State.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/TrustedExternalTenant.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureSkuImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureSkuInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/CheckNameResultImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/CheckNameResultInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalListResultImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalListResultInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/IdParsingUtils.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManagementClientImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManager.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationsImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationsInner.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/PageImpl.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/PageImpl1.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/package-info.java create mode 100644 kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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 index 00f958e2c8744..182c0d8c420cc 100644 --- a/kusto/resource-manager/v2018_09_07_preview/pom.xml +++ b/kusto/resource-manager/v2018_09_07_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-kusto 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 4a6acad789c00..e90a150e6d761 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(Page innerList) { - return Observable.from(innerList.items()); + public Observable call(List innerList) { + return Observable.from(innerList); } }) .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 361e56974615e..699b6f5f40b69 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,16 +1120,8 @@ 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 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; - } - }; + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); } /** @@ -1149,13 +1141,11 @@ public ServiceFuture> listAsync(final ServiceCallback> listAsync() { - return listWithServiceResponseAsync().map(new Func1>, Page>() { + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { @Override - public Page call(ServiceResponse> response) { - PageImpl page = new PageImpl<>(); - page.setItems(response.body()); - return page; + public List call(ServiceResponse> response) { + return response.body(); } }); } diff --git a/kusto/resource-manager/v2019_01_21/pom.xml b/kusto/resource-manager/v2019_01_21/pom.xml new file mode 100644 index 0000000000000..9b32d332b28b0 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.kusto.v2019_01_21 + + 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureCapacity.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureCapacity.java new file mode 100644 index 0000000000000..7203d5bcac8e9 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure capacity definition. + */ +public class AzureCapacity { + /** + * Scale type. Possible values include: 'automatic', 'manual', 'none'. + */ + @JsonProperty(value = "scaleType", required = true) + private AzureScaleType scaleType; + + /** + * Minimum allowed capacity. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /** + * Maximum allowed capacity. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /** + * The default capacity that would be used. + */ + @JsonProperty(value = "default", required = true) + private int defaultProperty; + + /** + * Get scale type. Possible values include: 'automatic', 'manual', 'none'. + * + * @return the scaleType value + */ + public AzureScaleType scaleType() { + return this.scaleType; + } + + /** + * Set scale type. Possible values include: 'automatic', 'manual', 'none'. + * + * @param scaleType the scaleType value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withScaleType(AzureScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Get minimum allowed capacity. + * + * @return the minimum value + */ + public int minimum() { + return this.minimum; + } + + /** + * Set minimum allowed capacity. + * + * @param minimum the minimum value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get maximum allowed capacity. + * + * @return the maximum value + */ + public int maximum() { + return this.maximum; + } + + /** + * Set maximum allowed capacity. + * + * @param maximum the maximum value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the default capacity that would be used. + * + * @return the defaultProperty value + */ + public int defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the default capacity that would be used. + * + * @param defaultProperty the defaultProperty value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withDefaultProperty(int defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureEntityResource.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureEntityResource.java new file mode 100644 index 0000000000000..d1a72760f8dac --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureResourceSku.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureResourceSku.java new file mode 100644 index 0000000000000..5e455a670a1da --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AzureResourceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureScaleType.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureScaleType.java new file mode 100644 index 0000000000000..7f48b65028201 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSku.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSku.java new file mode 100644 index 0000000000000..21d7062d3128c --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java new file mode 100644 index 0000000000000..e70908451a300 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/AzureSkuName.java @@ -0,0 +1,56 @@ +/** + * 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.v2019_01_21; + +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 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"); + + /** Static value D11_v2 for AzureSkuName. */ + public static final AzureSkuName D11_V2 = fromString("D11_v2"); + + /** Static value D12_v2 for AzureSkuName. */ + public static final AzureSkuName D12_V2 = fromString("D12_v2"); + + /** Static value L4 for AzureSkuName. */ + public static final AzureSkuName L4 = fromString("L4"); + + /** + * 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/CheckNameResult.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/CheckNameResult.java new file mode 100644 index 0000000000000..8fb8ab68231e4 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java new file mode 100644 index 0000000000000..e622597d6c711 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Cluster.java @@ -0,0 +1,148 @@ +/** + * 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.v2019_01_21; + +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.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.AzureSkuInner; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dataIngestionUri value. + */ + String dataIngestionUri(); + + /** + * @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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterCheckNameRequest.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterCheckNameRequest.java new file mode 100644 index 0000000000000..f232e2638bc55 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a cluster check name availability request. + */ +public class ClusterCheckNameRequest { + /** + * Cluster name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.Kusto/clusters. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of ClusterCheckNameRequest class. + * @param name cluster name. + */ + public ClusterCheckNameRequest() { + type = "Microsoft.Kusto/clusters"; + } + + /** + * Get cluster name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set cluster name. + * + * @param name the name value to set + * @return the ClusterCheckNameRequest object itself. + */ + public ClusterCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Kusto/clusters. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Kusto/clusters. + * + * @param type the type value to set + * @return the ClusterCheckNameRequest object itself. + */ + public ClusterCheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java new file mode 100644 index 0000000000000..79b7de86ac991 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ClusterUpdate.java @@ -0,0 +1,190 @@ +/** + * 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.v2019_01_21; + +import java.util.Map; +import com.microsoft.azure.management.kusto.v2019_01_21.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; + + /** + * 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', 'Updating'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + */ + @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 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', 'Updating'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * + * @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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Clusters.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Clusters.java new file mode 100644 index 0000000000000..317d1c1362a9b --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +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.v2019_01_21.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnection.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnection.java new file mode 100644 index 0000000000000..7e22b817bba3e --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnection.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.DataConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; + +/** + * Type representing DataConnection. + */ +public interface DataConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DataConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataConnection definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the dataconnection definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, clusterName, databaseName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @param databaseName The name of the database in the Kusto cluster + * @return the next definition stage + */ + WithCreate withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName); + } + + /** + * The stage of the dataconnection definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation { + } + } + /** + * The template for a DataConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of DataConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the dataconnection update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidation.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidation.java new file mode 100644 index 0000000000000..d9c53a2063824 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidation.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing an data connection validation. + */ +public class DataConnectionValidation { + /** + * The name of the data connection. + */ + @JsonProperty(value = "dataConnectionName") + private String dataConnectionName; + + /** + * The data connection properties to validate. + */ + @JsonProperty(value = "properties") + private DataConnectionInner properties; + + /** + * Get the name of the data connection. + * + * @return the dataConnectionName value + */ + public String dataConnectionName() { + return this.dataConnectionName; + } + + /** + * Set the name of the data connection. + * + * @param dataConnectionName the dataConnectionName value to set + * @return the DataConnectionValidation object itself. + */ + public DataConnectionValidation withDataConnectionName(String dataConnectionName) { + this.dataConnectionName = dataConnectionName; + return this; + } + + /** + * Get the data connection properties to validate. + * + * @return the properties value + */ + public DataConnectionInner properties() { + return this.properties; + } + + /** + * Set the data connection properties to validate. + * + * @param properties the properties value to set + * @return the DataConnectionValidation object itself. + */ + public DataConnectionValidation withProperties(DataConnectionInner properties) { + this.properties = properties; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationListResult.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationListResult.java new file mode 100644 index 0000000000000..f20291268c72e --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.DataConnectionValidationListResultInner; +import java.util.List; + +/** + * Type representing DataConnectionValidationListResult. + */ +public interface DataConnectionValidationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationResult.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationResult.java new file mode 100644 index 0000000000000..f9e93960129e3 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnectionValidationResult.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a data connection validation request. + */ +public class DataConnectionValidationResult { + /** + * A message which indicates a problem in data connection validation. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get a message which indicates a problem in data connection validation. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set a message which indicates a problem in data connection validation. + * + * @param errorMessage the errorMessage value to set + * @return the DataConnectionValidationResult object itself. + */ + public DataConnectionValidationResult withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnections.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnections.java new file mode 100644 index 0000000000000..0aa3569286fad --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataConnections.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.v2019_01_21; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.DataConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataConnections. + */ +public interface DataConnections extends SupportsCreating, HasInner { + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters); + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataFormat.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataFormat.java new file mode 100644 index 0000000000000..42b743bb804f3 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DataFormat.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.v2019_01_21; + +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"); + + /** Static value TSV for DataFormat. */ + public static final DataFormat TSV = fromString("TSV"); + + /** Static value SCSV for DataFormat. */ + public static final DataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for DataFormat. */ + public static final DataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for DataFormat. */ + public static final DataFormat PSV = fromString("PSV"); + + /** Static value TXT for DataFormat. */ + public static final DataFormat TXT = fromString("TXT"); + + /** Static value RAW for DataFormat. */ + public static final DataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for DataFormat. */ + public static final DataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for DataFormat. */ + public static final DataFormat AVRO = fromString("AVRO"); + + /** + * 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java new file mode 100644 index 0000000000000..9aa16dfad242e --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Database.java @@ -0,0 +1,210 @@ +/** + * 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.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2019_01_21.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.v2019_01_21.implementation.KustoManager; +import org.joda.time.Period; + +/** + * Type representing Database. + */ +public interface Database extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the hotCachePeriod value. + */ + Period hotCachePeriod(); + + /** + * @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 softDeletePeriod value. + */ + Period softDeletePeriod(); + + /** + * @return the statistics value. + */ + DatabaseStatistics statistics(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Database definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Database definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Database definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the database definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @return the next definition stage + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the database definition allowing to specify HotCachePeriod. + */ + interface WithHotCachePeriod { + /** + * Specifies hotCachePeriod. + * @param hotCachePeriod The time the data that should be kept in cache for fast queries in TimeSpan + * @return the next definition stage + */ + WithCreate withHotCachePeriod(Period hotCachePeriod); + } + + /** + * The stage of the database definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the database definition allowing to specify SoftDeletePeriod. + */ + interface WithSoftDeletePeriod { + /** + * Specifies softDeletePeriod. + * @param softDeletePeriod The time the data should be kept before it stops being accessible to queries in TimeSpan + * @return the next definition stage + */ + WithCreate withSoftDeletePeriod(Period softDeletePeriod); + } + + /** + * 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 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.WithHotCachePeriod, DefinitionStages.WithLocation, DefinitionStages.WithSoftDeletePeriod, DefinitionStages.WithStatistics { + } + } + /** + * The template for a Database update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithHotCachePeriod, UpdateStages.WithLocation, UpdateStages.WithSoftDeletePeriod, UpdateStages.WithStatistics { + } + + /** + * Grouping of Database update stages. + */ + interface UpdateStages { + /** + * The stage of the database update allowing to specify HotCachePeriod. + */ + interface WithHotCachePeriod { + /** + * Specifies hotCachePeriod. + * @param hotCachePeriod The time the data that should be kept in cache for fast queries in TimeSpan + * @return the next update stage + */ + Update withHotCachePeriod(Period hotCachePeriod); + } + + /** + * 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 SoftDeletePeriod. + */ + interface WithSoftDeletePeriod { + /** + * Specifies softDeletePeriod. + * @param softDeletePeriod The time the data should be kept before it stops being accessible to queries in TimeSpan + * @return the next update stage + */ + Update withSoftDeletePeriod(Period softDeletePeriod); + } + + /** + * 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseCheckNameRequest.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseCheckNameRequest.java new file mode 100644 index 0000000000000..3c89f915bcd5f --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a database check name availability request. + */ +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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipal.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipal.java new file mode 100644 index 0000000000000..a2374ffa8eda0 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalListRequest.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalListRequest.java new file mode 100644 index 0000000000000..15b6c0e6a12ab --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalListResult.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalListResult.java new file mode 100644 index 0000000000000..98301849a4548 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.DatabasePrincipalListResultInner; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalRole.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalRole.java new file mode 100644 index 0000000000000..3f6502cbe221f --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalType.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabasePrincipalType.java new file mode 100644 index 0000000000000..0024da0db60b5 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseStatistics.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseStatistics.java new file mode 100644 index 0000000000000..4387c295e73c9 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains database statistics information. + */ +public class DatabaseStatistics { + /** + * The database size - the total size of compressed data and index in + * bytes. + */ + @JsonProperty(value = "size") + private Double size; + + /** + * Get the database size - the total size of compressed data and index in bytes. + * + * @return the size value + */ + public Double size() { + return this.size; + } + + /** + * Set the database size - the total size of compressed data and index in bytes. + * + * @param size the size value to set + * @return the DatabaseStatistics object itself. + */ + public DatabaseStatistics withSize(Double size) { + this.size = size; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseUpdate.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseUpdate.java new file mode 100644 index 0000000000000..9d8f0a889c308 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/DatabaseUpdate.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import org.joda.time.Period; +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; + + /** + * 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 time the data should be kept before it stops being accessible to + * queries in TimeSpan. + */ + @JsonProperty(value = "properties.softDeletePeriod") + private Period softDeletePeriod; + + /** + * The time the data that should be kept in cache for fast queries in + * TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Period hotCachePeriod; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + private DatabaseStatistics statistics; + + /** + * 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 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 time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @return the softDeletePeriod value + */ + public Period softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Set the time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @param softDeletePeriod the softDeletePeriod value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withSoftDeletePeriod(Period softDeletePeriod) { + this.softDeletePeriod = softDeletePeriod; + return this; + } + + /** + * Get the time the data that should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value + */ + public Period hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set the time the data that should be kept in cache for fast queries in TimeSpan. + * + * @param hotCachePeriod the hotCachePeriod value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withHotCachePeriod(Period hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics of the database. + * + * @return the statistics value + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Set the statistics of the database. + * + * @param statistics the statistics value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Databases.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Databases.java new file mode 100644 index 0000000000000..61b6fd53689e0 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventGridDataConnection.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventGridDataConnection.java new file mode 100644 index 0000000000000..061a92fa5b8d5 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventGridDataConnection.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.DataConnectionInner; + +/** + * Class representing an Event Grid data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EventGrid") +@JsonFlatten +public class EventGridDataConnection extends DataConnectionInner { + /** + * The resource ID of the storage account where the data resides. + */ + @JsonProperty(value = "properties.storageAccountResourceId", required = true) + private String storageAccountResourceId; + + /** + * The resource ID where the event grid is configured to send events. + */ + @JsonProperty(value = "properties.eventHubResourceId", required = true) + private String eventHubResourceId; + + /** + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + private String consumerGroup; + + /** + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName", required = true) + private String tableName; + + /** + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /** + * The data format of the message. Optionally the data format can be added + * to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO'. + */ + @JsonProperty(value = "properties.dataFormat", required = true) + private DataFormat dataFormat; + + /** + * Get the resource ID of the storage account where the data resides. + * + * @return the storageAccountResourceId value + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the resource ID of the storage account where the data resides. + * + * @param storageAccountResourceId the storageAccountResourceId value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the resource ID where the event grid is configured to send events. + * + * @return the eventHubResourceId value + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the resource ID where the event grid is configured to send events. + * + * @param eventHubResourceId the eventHubResourceId value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the event hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @param tableName the tableName value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @return the mappingRuleName value + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO'. + * + * @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', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO'. + * + * @param dataFormat the dataFormat value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withDataFormat(DataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventHubDataConnection.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventHubDataConnection.java new file mode 100644 index 0000000000000..b712762b14fd2 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/EventHubDataConnection.java @@ -0,0 +1,158 @@ +/** + * 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.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.DataConnectionInner; + +/** + * Class representing an event hub data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EventHub") +@JsonFlatten +public class EventHubDataConnection extends DataConnectionInner { + /** + * The resource ID of the event hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.eventHubResourceId", required = true) + private String eventHubResourceId; + + /** + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + private String consumerGroup; + + /** + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /** + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /** + * The data format of the message. Optionally the data format can be added + * to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO'. + */ + @JsonProperty(value = "properties.dataFormat") + private DataFormat dataFormat; + + /** + * Get the resource ID of the event hub to be used to create a data connection. + * + * @return the eventHubResourceId value + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the resource ID of the event hub to be used to create a data connection. + * + * @param eventHubResourceId the eventHubResourceId value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the event hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @param tableName the tableName value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @return the mappingRuleName value + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO'. + * + * @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', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO'. + * + * @param dataFormat the dataFormat value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withDataFormat(DataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Operation.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Operation.java new file mode 100644 index 0000000000000..9b1d5bc0235d1 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2019_01_21.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/OperationDisplay.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/OperationDisplay.java new file mode 100644 index 0000000000000..e251d5714e91b --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Operations.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/Operations.java new file mode 100644 index 0000000000000..4c20871d64038 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import rx.Observable; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ProvisioningState.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/ProvisioningState.java new file mode 100644 index 0000000000000..13f118a93fff2 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/State.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/State.java new file mode 100644 index 0000000000000..c3d9f84eadb83 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/State.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for State. + */ +public final class State extends ExpandableStringEnum { + /** Static value Creating for State. */ + public static final State CREATING = fromString("Creating"); + + /** Static value Unavailable for State. */ + public static final State UNAVAILABLE = fromString("Unavailable"); + + /** Static value Running for State. */ + public static final State RUNNING = fromString("Running"); + + /** Static value Deleting for State. */ + public static final State DELETING = fromString("Deleting"); + + /** Static value Deleted for State. */ + public static final State DELETED = fromString("Deleted"); + + /** Static value Stopping for State. */ + public static final State STOPPING = fromString("Stopping"); + + /** Static value Stopped for State. */ + public static final State STOPPED = fromString("Stopped"); + + /** Static value Starting for State. */ + public static final State STARTING = fromString("Starting"); + + /** Static value Updating for State. */ + public static final State UPDATING = fromString("Updating"); + + /** + * Creates or finds a State from its string representation. + * @param name a name to look for + * @return the corresponding State + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * @return known State values + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/TrustedExternalTenant.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/TrustedExternalTenant.java new file mode 100644 index 0000000000000..56d9837b43d9a --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a tenant ID that is trusted by the cluster. + */ +public class TrustedExternalTenant { + /** + * GUID representing an external tenant. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get gUID representing an external tenant. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set gUID representing an external tenant. + * + * @param value the value value to set + * @return the TrustedExternalTenant object itself. + */ + public TrustedExternalTenant withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuImpl.java new file mode 100644 index 0000000000000..5ae0a8f543355 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.AzureResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2019_01_21.AzureCapacity; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureResourceSkuInner.java new file mode 100644 index 0000000000000..de7c757278532 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.AzureCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure resource SKU definition. + */ +public class AzureResourceSkuInner { + /** + * Resource Namespace and Type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * The SKU details. + */ + @JsonProperty(value = "sku") + private 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureSkuImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureSkuImpl.java new file mode 100644 index 0000000000000..2c99cb1ae3f8c --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.AzureSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureSkuInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/AzureSkuInner.java new file mode 100644 index 0000000000000..d821af42ffcad --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.AzureSkuName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure SKU definition. + */ +public class AzureSkuInner { + /** + * SKU name. Possible values include: 'D13_v2', 'D14_v2', 'L8', 'L16', + * 'D11_v2', 'D12_v2', 'L4'. + */ + @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: 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4'. + */ + public AzureSkuInner() { + tier = "Standard"; + } + + /** + * Get sKU name. Possible values include: 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4'. + * + * @return the name value + */ + public AzureSkuName name() { + return this.name; + } + + /** + * Set sKU name. Possible values include: 'D13_v2', 'D14_v2', 'L8', 'L16', 'D11_v2', 'D12_v2', 'L4'. + * + * @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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/CheckNameResultImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/CheckNameResultImpl.java new file mode 100644 index 0000000000000..73d45012b9399 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/CheckNameResultInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/CheckNameResultInner.java new file mode 100644 index 0000000000000..4a9d5360327a8 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a check name availability request. + */ +public class CheckNameResultInner { + /** + * Specifies a Boolean value that indicates if the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The name that was checked. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Message indicating an unavailable name due to a conflict, or a + * description of the naming rules that are violated. + */ + @JsonProperty(value = "message") + private String message; + + /** + * 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..5d324029972d6 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterImpl.java @@ -0,0 +1,127 @@ +/** + * 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.v2019_01_21.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.Cluster; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2019_01_21.ClusterUpdate; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.State; +import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; +import com.microsoft.azure.management.kusto.v2019_01_21.TrustedExternalTenant; +import com.microsoft.azure.management.kusto.v2019_01_21.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 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java new file mode 100644 index 0000000000000..ad0d0b14ad981 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClusterInner.java @@ -0,0 +1,139 @@ +/** + * 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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.State; +import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.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 { + /** + * 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', 'Updating'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + */ + @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 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', 'Updating'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed'. + * + * @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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..bbe052ebaf873 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.Clusters; +import com.microsoft.azure.management.kusto.v2019_01_21.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.v2019_01_21.CheckNameResult; +import com.microsoft.azure.management.kusto.v2019_01_21.AzureResourceSku; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/ClustersInner.java new file mode 100644 index 0000000000000..c9110183d7dc8 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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.v2019_01_21.ClusterCheckNameRequest; +import com.microsoft.azure.management.kusto.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionImpl.java new file mode 100644 index 0000000000000..dd91b72c1ea09 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class DataConnectionImpl extends CreatableUpdatableImpl implements DataConnection, DataConnection.Definition, DataConnection.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + private String dataConnectionName; + + DataConnectionImpl(String name, KustoManager manager) { + super(name, new DataConnectionInner()); + this.manager = manager; + // Set resource name + this.dataConnectionName = name; + // + } + + DataConnectionImpl(DataConnectionInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dataConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.dataConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataConnections"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DataConnectionImpl withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.databaseName = databaseName; + return this; + } + + @Override + public DataConnectionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionInner.java new file mode 100644 index 0000000000000..ce17d48faa941 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionInner.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.v2019_01_21.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("DataConnection") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "EventHub", value = EventHubDataConnection.class), + @JsonSubTypes.Type(name = "EventGrid", value = EventGridDataConnection.class) +}) +public class DataConnectionInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the DataConnectionInner object itself. + */ + public DataConnectionInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultImpl.java new file mode 100644 index 0000000000000..9831abb83eeb1 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnectionValidationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnectionValidationResult; + +class DataConnectionValidationListResultImpl extends WrapperImpl implements DataConnectionValidationListResult { + private final KustoManager manager; + DataConnectionValidationListResultImpl(DataConnectionValidationListResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultInner.java new file mode 100644 index 0000000000000..1814eb71e5455 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionValidationListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnectionValidationResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto data connection validation result. + */ +public class DataConnectionValidationListResultInner { + /** + * The list of Kusto data connection validation errors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto data connection validation errors. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Kusto data connection validation errors. + * + * @param value the value value to set + * @return the DataConnectionValidationListResultInner object itself. + */ + public DataConnectionValidationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsImpl.java new file mode 100644 index 0000000000000..55df1798c6bb4 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsImpl.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.v2019_01_21.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnection; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnectionValidationListResult; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnectionValidation; + +class DataConnectionsImpl extends WrapperImpl implements DataConnections { + private final KustoManager manager; + + DataConnectionsImpl(KustoManager manager) { + super(manager.inner().dataConnections()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public DataConnectionImpl define(String name) { + return wrapModel(name); + } + + private DataConnectionImpl wrapModel(DataConnectionInner inner) { + return new DataConnectionImpl(inner, manager()); + } + + private DataConnectionImpl wrapModel(String name) { + return new DataConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) { + DataConnectionsInner client = this.inner(); + return client.listByDatabaseAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DataConnection call(DataConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + DataConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName, dataConnectionName) + .map(new Func1() { + @Override + public DataConnection call(DataConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + DataConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toCompletable(); + } + + @Override + public Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + DataConnectionsInner client = this.inner(); + return client.dataConnectionValidationMethodAsync(resourceGroupName, clusterName, databaseName, parameters) + .map(new Func1() { + @Override + public DataConnectionValidationListResult call(DataConnectionValidationListResultInner inner) { + return new DataConnectionValidationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsInner.java new file mode 100644 index 0000000000000..06bdfd384951e --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DataConnectionsInner.java @@ -0,0 +1,984 @@ +/** + * 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.v2019_01_21.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnectionValidation; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DataConnections. + */ +public class DataConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private DataConnectionsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of DataConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataConnectionsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(DataConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface DataConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections listByDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections") + Observable> listByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections dataConnectionValidationMethod" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation") + Observable> dataConnectionValidationMethod(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DataConnectionValidation parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2019_01_21.DataConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DataConnectionInner> object if successful. + */ + public List listByDatabase(String resourceGroupName, String clusterName, String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataConnectionInner> object + */ + public Observable> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataConnectionInner> object + */ + public Observable>> listByDatabaseWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDatabase(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDatabaseDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDatabaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionValidationListResultInner object if successful. + */ + public DataConnectionValidationListResultInner dataConnectionValidationMethod(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionValidationListResultInner object + */ + public Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DataConnectionValidationListResultInner>() { + @Override + public DataConnectionValidationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionValidationListResultInner object + */ + public Observable> dataConnectionValidationMethodWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dataConnectionValidationMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dataConnectionValidationMethodDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner get(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().single().body(); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner update(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java new file mode 100644 index 0000000000000..388319df717e8 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseImpl.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.Database; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseUpdate; +import org.joda.time.Period; +import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; +import com.microsoft.azure.management.kusto.v2019_01_21.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 Period hotCachePeriod() { + return this.inner().hotCachePeriod(); + } + + @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 Period softDeletePeriod() { + return this.inner().softDeletePeriod(); + } + + @Override + public DatabaseStatistics statistics() { + return this.inner().statistics(); + } + + @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 withHotCachePeriod(Period hotCachePeriod) { + if (isInCreateMode()) { + this.inner().withHotCachePeriod(hotCachePeriod); + } else { + this.updateParameter.withHotCachePeriod(hotCachePeriod); + } + return this; + } + + @Override + public DatabaseImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public DatabaseImpl withSoftDeletePeriod(Period softDeletePeriod) { + if (isInCreateMode()) { + this.inner().withSoftDeletePeriod(softDeletePeriod); + } else { + this.updateParameter.withSoftDeletePeriod(softDeletePeriod); + } + 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java new file mode 100644 index 0000000000000..35401551b270a --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabaseInner.java @@ -0,0 +1,145 @@ +/** + * 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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.ProvisioningState; +import org.joda.time.Period; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseStatistics; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a Kusto database. + */ +@JsonFlatten +public class DatabaseInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 time the data should be kept before it stops being accessible to + * queries in TimeSpan. + */ + @JsonProperty(value = "properties.softDeletePeriod") + private Period softDeletePeriod; + + /** + * The time the data that should be kept in cache for fast queries in + * TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Period hotCachePeriod; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + private DatabaseStatistics statistics; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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 time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @return the softDeletePeriod value + */ + public Period softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Set the time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @param softDeletePeriod the softDeletePeriod value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withSoftDeletePeriod(Period softDeletePeriod) { + this.softDeletePeriod = softDeletePeriod; + return this; + } + + /** + * Get the time the data that should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value + */ + public Period hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set the time the data that should be kept in cache for fast queries in TimeSpan. + * + * @param hotCachePeriod the hotCachePeriod value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withHotCachePeriod(Period hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics of the database. + * + * @return the statistics value + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Set the statistics of the database. + * + * @param statistics the statistics value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalImpl.java new file mode 100644 index 0000000000000..8dee60336500f --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipal; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalInner.java new file mode 100644 index 0000000000000..8df4d25eb45e1 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipalType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class representing database principal entity. + */ +public class DatabasePrincipalInner { + /** + * Database principal role. Possible values include: 'Admin', 'Ingestor', + * 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + */ + @JsonProperty(value = "role", required = true) + private DatabasePrincipalRole role; + + /** + * Database principal name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Database principal type. Possible values include: 'App', 'Group', + * 'User'. + */ + @JsonProperty(value = "type", required = true) + private DatabasePrincipalType type; + + /** + * Database principal fully qualified name. + */ + @JsonProperty(value = "fqn") + private String fqn; + + /** + * Database principal email if exists. + */ + @JsonProperty(value = "email") + private String email; + + /** + * Application id - relevant only for application principal type. + */ + @JsonProperty(value = "appId") + private String appId; + + /** + * 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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalListResultImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalListResultImpl.java new file mode 100644 index 0000000000000..790825ccc0f3b --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalListResultInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasePrincipalListResultInner.java new file mode 100644 index 0000000000000..1f9382d510ff1 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesImpl.java new file mode 100644 index 0000000000000..cd25417446048 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.Databases; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipal; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipalListResult; +import com.microsoft.azure.management.kusto.v2019_01_21.Database; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/DatabasesInner.java new file mode 100644 index 0000000000000..88ecf9e860d90 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabaseCheckNameRequest; +import com.microsoft.azure.management.kusto.v2019_01_21.DatabasePrincipalListRequest; +import com.microsoft.azure.management.kusto.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/IdParsingUtils.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..173e4eb7a97b9 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManagementClientImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManagementClientImpl.java new file mode 100644 index 0000000000000..0b06b0773d994 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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 DataConnectionsInner object to access its operations. + */ + private DataConnectionsInner dataConnections; + + /** + * Gets the DataConnectionsInner object to access its operations. + * @return the DataConnectionsInner object. + */ + public DataConnectionsInner dataConnections() { + return this.dataConnections; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public KustoManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public KustoManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public KustoManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-01-21"; + 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.dataConnections = new DataConnectionsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "KustoManagementClient", "2019-01-21"); + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManager.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/KustoManager.java new file mode 100644 index 0000000000000..3b738182ef98d --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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.v2019_01_21.Clusters; +import com.microsoft.azure.management.kusto.v2019_01_21.Databases; +import com.microsoft.azure.management.kusto.v2019_01_21.DataConnections; +import com.microsoft.azure.management.kusto.v2019_01_21.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 DataConnections dataConnections; + private Operations operations; + /** + * Get a Configurable instance that can be used to create KustoManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new KustoManager.ConfigurableImpl(); + } + /** + * Creates an instance of KustoManager that exposes Kusto resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the KustoManager + */ + public static KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new KustoManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of KustoManager that exposes Kusto resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the KustoManager + */ + public static KustoManager authenticate(RestClient restClient, String subscriptionId) { + return new KustoManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of KustoManager that exposes Kusto management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Kusto management API entry points that work across subscriptions + */ + KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage Databases. + */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(this); + } + return this.databases; + } + + /** + * @return Entry point to manage DataConnections. + */ + public DataConnections dataConnections() { + if (this.dataConnections == null) { + this.dataConnections = new DataConnectionsImpl(this); + } + return this.dataConnections; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return KustoManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private KustoManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new KustoManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationImpl.java new file mode 100644 index 0000000000000..9d64197e33a55 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationInner.java new file mode 100644 index 0000000000000..f94ad864ec172 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationsImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..c9d22367e97be --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2019_01_21.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.kusto.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationsInner.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/OperationsInner.java new file mode 100644 index 0000000000000..84222af3d4dcf --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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.v2019_01_21.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.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/PageImpl.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/PageImpl.java new file mode 100644 index 0000000000000..768c24ce41c54 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/PageImpl1.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/PageImpl1.java new file mode 100644 index 0000000000000..3d7a268922c40 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.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/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/package-info.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/implementation/package-info.java new file mode 100644 index 0000000000000..dd35bc720e3bb --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21.implementation; diff --git a/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/package-info.java b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/package-info.java new file mode 100644 index 0000000000000..bf9bfd60dbce7 --- /dev/null +++ b/kusto/resource-manager/v2019_01_21/src/main/java/com/microsoft/azure/management/kusto/v2019_01_21/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.v2019_01_21;