From 61d1aed3e4a194ca97072de2bf4fe0968635ea57 Mon Sep 17 00:00:00 2001 From: Isabella Cai Date: Wed, 26 Jun 2019 09:37:47 -0700 Subject: [PATCH] generated v2015_03_20 of loganalytics --- api-specs.json | 4 + .../resource-manager/v2015_03_20/pom.xml | 133 +++ .../loganalytics/v2015_03_20/CoreSummary.java | 69 ++ .../loganalytics/v2015_03_20/LinkTarget.java | 40 + .../v2015_03_20/OperationDisplay.java | 95 ++ .../v2015_03_20/OperationListResult.java | 27 + .../loganalytics/v2015_03_20/Operations.java | 27 + .../loganalytics/v2015_03_20/PurgeState.java | 41 + .../loganalytics/v2015_03_20/SavedSearch.java | 227 ++++ .../v2015_03_20/SavedSearches.java | 64 ++ .../v2015_03_20/SavedSearchesListResult.java | 32 + .../loganalytics/v2015_03_20/SearchError.java | 69 ++ .../v2015_03_20/SearchGetSchemaResponse.java | 31 + .../v2015_03_20/SearchHighlight.java | 69 ++ .../v2015_03_20/SearchMetadata.java | 461 ++++++++ .../v2015_03_20/SearchMetadataSchema.java | 69 ++ .../v2015_03_20/SearchParameters.java | 150 +++ .../v2015_03_20/SearchResultsResponse.java | 41 + .../v2015_03_20/SearchSchemaValue.java | 200 ++++ .../loganalytics/v2015_03_20/SearchSort.java | 69 ++ .../v2015_03_20/SearchSortEnum.java | 41 + .../loganalytics/v2015_03_20/SharedKeys.java | 30 + .../v2015_03_20/StorageAccount.java | 69 ++ .../v2015_03_20/StorageInsight.java | 228 ++++ .../v2015_03_20/StorageInsightState.java | 41 + .../v2015_03_20/StorageInsightStatus.java | 70 ++ .../v2015_03_20/StorageInsights.java | 53 + .../loganalytics/v2015_03_20/Tag.java | 69 ++ .../v2015_03_20/WorkspacePurgeBody.java | 71 ++ .../WorkspacePurgeBodyFilters.java | 125 +++ .../v2015_03_20/WorkspacePurgeResponse.java | 25 + .../WorkspacePurgeStatusResponse.java | 25 + .../loganalytics/v2015_03_20/Workspaces.java | 110 ++ .../v2015_03_20/WorkspacesPurgeHeaders.java | 43 + .../implementation/IdParsingUtils.java | 57 + .../implementation/LinkTargetImpl.java | 46 + .../implementation/LinkTargetInner.java | 121 +++ .../implementation/LogAnalyticsManager.java | 135 +++ .../implementation/OperationInner.java | 70 ++ .../OperationListResultImpl.java | 32 + .../OperationListResultInner.java | 45 + ...erationalInsightsManagementClientImpl.java | 261 +++++ .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 +++ .../v2015_03_20/implementation/PageImpl.java | 75 ++ .../v2015_03_20/implementation/PageImpl1.java | 75 ++ .../implementation/SavedSearchImpl.java | 162 +++ .../implementation/SavedSearchInner.java | 182 ++++ .../implementation/SavedSearchesImpl.java | 88 ++ .../implementation/SavedSearchesInner.java | 545 ++++++++++ .../SavedSearchesListResultImpl.java | 38 + .../SavedSearchesListResultInner.java | 71 ++ .../SearchGetSchemaResponseImpl.java | 39 + .../SearchGetSchemaResponseInner.java | 72 ++ .../SearchResultsResponseImpl.java | 49 + .../SearchResultsResponseInner.java | 113 ++ .../implementation/SharedKeysImpl.java | 36 + .../implementation/SharedKeysInner.java | 69 ++ .../implementation/StorageInsightImpl.java | 158 +++ .../implementation/StorageInsightInner.java | 169 +++ .../implementation/StorageInsightsImpl.java | 81 ++ .../implementation/StorageInsightsInner.java | 608 +++++++++++ .../WorkspacePurgeResponseImpl.java | 31 + .../WorkspacePurgeResponseInner.java | 43 + .../WorkspacePurgeStatusResponseImpl.java | 38 + .../WorkspacePurgeStatusResponseInner.java | 45 + .../implementation/WorkspacesImpl.java | 158 +++ .../implementation/WorkspacesInner.java | 986 ++++++++++++++++++ .../implementation/package-info.java | 11 + .../v2015_03_20/package-info.java | 11 + 70 files changed, 7808 insertions(+) create mode 100644 loganalytics/resource-manager/v2015_03_20/pom.xml create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/CoreSummary.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/LinkTarget.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationDisplay.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationListResult.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Operations.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/PurgeState.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearch.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearchesListResult.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchError.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchGetSchemaResponse.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchHighlight.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadata.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadataSchema.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchParameters.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchResultsResponse.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSchemaValue.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSort.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSortEnum.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SharedKeys.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageAccount.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsight.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightState.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightStatus.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsights.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Tag.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBody.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBodyFilters.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeResponse.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeStatusResponse.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacesPurgeHeaders.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/IdParsingUtils.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LogAnalyticsManager.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationalInsightsManagementClientImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/PageImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/PageImpl1.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/package-info.java create mode 100644 loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/package-info.java diff --git a/api-specs.json b/api-specs.json index 7a1e46720f030..60c4b36a88d76 100644 --- a/api-specs.json +++ b/api-specs.json @@ -128,6 +128,10 @@ "source": "specification/operationalinsights/data-plane/readme.md", "args": "--payload-flattening-threshold=1 --override-client-name=LogAnalyticsDataClient" }, + "loganalytics/resource-manager": { + "source": "specification/operationalinsights/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "logic/resource-manager": { "source": "specification/logic/resource-manager/readme.md", "args": "--multiapi --fluent" diff --git a/loganalytics/resource-manager/v2015_03_20/pom.xml b/loganalytics/resource-manager/v2015_03_20/pom.xml new file mode 100644 index 0000000000000..6bd1b1cf6b595 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.loganalytics.v2015_03_20 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-loganalytics + 1.0.0-beta + jar + Microsoft Azure SDK for LogAnalytics Management + This package contains Microsoft LogAnalytics 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/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/CoreSummary.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/CoreSummary.java new file mode 100644 index 0000000000000..df260636ffc0f --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/CoreSummary.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The core summary of a search. + */ +public class CoreSummary { + /** + * The status of a core summary. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The number of documents of a core summary. + */ + @JsonProperty(value = "numberOfDocuments", required = true) + private long numberOfDocuments; + + /** + * Get the status of a core summary. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of a core summary. + * + * @param status the status value to set + * @return the CoreSummary object itself. + */ + public CoreSummary withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the number of documents of a core summary. + * + * @return the numberOfDocuments value + */ + public long numberOfDocuments() { + return this.numberOfDocuments; + } + + /** + * Set the number of documents of a core summary. + * + * @param numberOfDocuments the numberOfDocuments value to set + * @return the CoreSummary object itself. + */ + public CoreSummary withNumberOfDocuments(long numberOfDocuments) { + this.numberOfDocuments = numberOfDocuments; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/LinkTarget.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/LinkTarget.java new file mode 100644 index 0000000000000..b49f922cbed2b --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/LinkTarget.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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LinkTargetInner; + +/** + * Type representing LinkTarget. + */ +public interface LinkTarget extends HasInner, HasManager { + /** + * @return the customerId value. + */ + String customerId(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the workspaceName value. + */ + String workspaceName(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationDisplay.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationDisplay.java new file mode 100644 index 0000000000000..ba5c7f034b5a4 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationDisplay.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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: OperationalInsights. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get service provider: OperationalInsights. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: OperationalInsights. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationListResult.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationListResult.java new file mode 100644 index 0000000000000..73a079b942a22 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/OperationListResult.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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.OperationListResultInner; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Operations.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Operations.java new file mode 100644 index 0000000000000..3cbecc49e102b --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/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.loganalytics.v2015_03_20; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/PurgeState.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/PurgeState.java new file mode 100644 index 0000000000000..ecdae7a8c9f44 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/PurgeState.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.loganalytics.v2015_03_20; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PurgeState. + */ +public final class PurgeState extends ExpandableStringEnum { + /** Static value pending for PurgeState. */ + public static final PurgeState PENDING = fromString("pending"); + + /** Static value completed for PurgeState. */ + public static final PurgeState COMPLETED = fromString("completed"); + + /** + * Creates or finds a PurgeState from its string representation. + * @param name a name to look for + * @return the corresponding PurgeState + */ + @JsonCreator + public static PurgeState fromString(String name) { + return fromString(name, PurgeState.class); + } + + /** + * @return known PurgeState values + */ + public static Collection values() { + return values(PurgeState.class); + } +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearch.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearch.java new file mode 100644 index 0000000000000..6d4c6dc1f4492 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearch.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.SavedSearchInner; +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.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import java.util.List; + +/** + * Type representing SavedSearch. + */ +public interface SavedSearch extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the category value. + */ + String category(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the query value. + */ + String query(); + + /** + * @return the tags value. + */ + List tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + Long version(); + + /** + * The entirety of the SavedSearch definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithCategory, DefinitionStages.WithDisplayName, DefinitionStages.WithQuery, DefinitionStages.WithCreate { + } + + /** + * Grouping of SavedSearch definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SavedSearch definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the savedsearch definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The Resource Group name + * @param workspaceName The Log Analytics Workspace name + * @return the next definition stage + */ + WithCategory withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the savedsearch definition allowing to specify Category. + */ + interface WithCategory { + /** + * Specifies category. + * @param category The category of the saved search. This helps the user to find a saved search faster + * @return the next definition stage + */ + WithDisplayName withCategory(String category); + } + + /** + * The stage of the savedsearch definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Saved search display name + * @return the next definition stage + */ + WithQuery withDisplayName(String displayName); + } + + /** + * The stage of the savedsearch definition allowing to specify Query. + */ + interface WithQuery { + /** + * Specifies query. + * @param query The query expression for the saved search. Please see https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference + * @return the next definition stage + */ + WithCreate withQuery(String query); + } + + /** + * The stage of the savedsearch definition allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag The ETag of the saved search + * @return the next definition stage + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the savedsearch definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags attached to the saved search + * @return the next definition stage + */ + WithCreate withTags(List tags); + } + + /** + * The stage of the savedsearch definition allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + * @param version The version number of the query language. The current version is 2 and is the default + * @return the next definition stage + */ + WithCreate withVersion(Long version); + } + + /** + * 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.WithETag, DefinitionStages.WithTags, DefinitionStages.WithVersion { + } + } + /** + * The template for a SavedSearch update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithETag, UpdateStages.WithTags, UpdateStages.WithVersion { + } + + /** + * Grouping of SavedSearch update stages. + */ + interface UpdateStages { + /** + * The stage of the savedsearch update allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag The ETag of the saved search + * @return the next update stage + */ + Update withETag(String eTag); + } + + /** + * The stage of the savedsearch update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags attached to the saved search + * @return the next update stage + */ + Update withTags(List tags); + } + + /** + * The stage of the savedsearch update allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + * @param version The version number of the query language. The current version is 2 and is the default + * @return the next update stage + */ + Update withVersion(Long version); + } + + } +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java new file mode 100644 index 0000000000000..65c490f4b94d6 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearches.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.SavedSearchesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SavedSearches. + */ +public interface SavedSearches extends SupportsCreating, HasInner { + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName); + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String savedSearchId); + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String savedSearchId); + + /** + * Gets the results from a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearchesListResult.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearchesListResult.java new file mode 100644 index 0000000000000..65de5e6ad3d9d --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SavedSearchesListResult.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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.SavedSearchesListResultInner; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.SavedSearchInner; +import java.util.List; + +/** + * Type representing SavedSearchesListResult. + */ +public interface SavedSearchesListResult extends HasInner, HasManager { + /** + * @return the metadata value. + */ + SearchMetadata metadata(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchError.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchError.java new file mode 100644 index 0000000000000..20bdfd7b555ae --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchError.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details for a search error. + */ +public class SearchError { + /** + * The error type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the error type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the error type. + * + * @param type the type value to set + * @return the SearchError object itself. + */ + public SearchError withType(String type) { + this.type = type; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the SearchError object itself. + */ + public SearchError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchGetSchemaResponse.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchGetSchemaResponse.java new file mode 100644 index 0000000000000..729650f919ab3 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchGetSchemaResponse.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.SearchGetSchemaResponseInner; +import java.util.List; + +/** + * Type representing SearchGetSchemaResponse. + */ +public interface SearchGetSchemaResponse extends HasInner, HasManager { + /** + * @return the metadata value. + */ + SearchMetadata metadata(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchHighlight.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchHighlight.java new file mode 100644 index 0000000000000..8459484a40b05 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchHighlight.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Highlight details. + */ +public class SearchHighlight { + /** + * The string that is put before a matched result. + */ + @JsonProperty(value = "pre") + private String pre; + + /** + * The string that is put after a matched result. + */ + @JsonProperty(value = "post") + private String post; + + /** + * Get the string that is put before a matched result. + * + * @return the pre value + */ + public String pre() { + return this.pre; + } + + /** + * Set the string that is put before a matched result. + * + * @param pre the pre value to set + * @return the SearchHighlight object itself. + */ + public SearchHighlight withPre(String pre) { + this.pre = pre; + return this; + } + + /** + * Get the string that is put after a matched result. + * + * @return the post value + */ + public String post() { + return this.post; + } + + /** + * Set the string that is put after a matched result. + * + * @param post the post value to set + * @return the SearchHighlight object itself. + */ + public SearchHighlight withPost(String post) { + this.post = post; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadata.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadata.java new file mode 100644 index 0000000000000..59a3b5b31394f --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadata.java @@ -0,0 +1,461 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata for search results. + */ +public class SearchMetadata { + /** + * The request id of the search. + */ + @JsonProperty(value = "requestId") + private String searchId; + + /** + * The search result type. + */ + @JsonProperty(value = "resultType") + private String resultType; + + /** + * The total number of search results. + */ + @JsonProperty(value = "total") + private Long total; + + /** + * The number of top search results. + */ + @JsonProperty(value = "top") + private Long top; + + /** + * The id of the search results request. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The core summaries. + */ + @JsonProperty(value = "coreSummaries") + private List coreSummaries; + + /** + * The status of the search results. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The start time for the search. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The time of last update. + */ + @JsonProperty(value = "lastUpdated") + private DateTime lastUpdated; + + /** + * The ETag of the search results. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * How the results are sorted. + */ + @JsonProperty(value = "sort") + private List sort; + + /** + * The request time. + */ + @JsonProperty(value = "requestTime") + private Long requestTime; + + /** + * The aggregated value field. + */ + @JsonProperty(value = "aggregatedValueField") + private String aggregatedValueField; + + /** + * The aggregated grouping fields. + */ + @JsonProperty(value = "aggregatedGroupingFields") + private String aggregatedGroupingFields; + + /** + * The sum of all aggregates returned in the result set. + */ + @JsonProperty(value = "sum") + private Long sum; + + /** + * The max of all aggregates returned in the result set. + */ + @JsonProperty(value = "max") + private Long max; + + /** + * The schema. + */ + @JsonProperty(value = "schema") + private SearchMetadataSchema schema; + + /** + * Get the request id of the search. + * + * @return the searchId value + */ + public String searchId() { + return this.searchId; + } + + /** + * Set the request id of the search. + * + * @param searchId the searchId value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSearchId(String searchId) { + this.searchId = searchId; + return this; + } + + /** + * Get the search result type. + * + * @return the resultType value + */ + public String resultType() { + return this.resultType; + } + + /** + * Set the search result type. + * + * @param resultType the resultType value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withResultType(String resultType) { + this.resultType = resultType; + return this; + } + + /** + * Get the total number of search results. + * + * @return the total value + */ + public Long total() { + return this.total; + } + + /** + * Set the total number of search results. + * + * @param total the total value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withTotal(Long total) { + this.total = total; + return this; + } + + /** + * Get the number of top search results. + * + * @return the top value + */ + public Long top() { + return this.top; + } + + /** + * Set the number of top search results. + * + * @param top the top value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withTop(Long top) { + this.top = top; + return this; + } + + /** + * Get the id of the search results request. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id of the search results request. + * + * @param id the id value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withId(String id) { + this.id = id; + return this; + } + + /** + * Get the core summaries. + * + * @return the coreSummaries value + */ + public List coreSummaries() { + return this.coreSummaries; + } + + /** + * Set the core summaries. + * + * @param coreSummaries the coreSummaries value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withCoreSummaries(List coreSummaries) { + this.coreSummaries = coreSummaries; + return this; + } + + /** + * Get the status of the search results. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of the search results. + * + * @param status the status value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the start time for the search. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time for the search. + * + * @param startTime the startTime value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the time of last update. + * + * @return the lastUpdated value + */ + public DateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the time of last update. + * + * @param lastUpdated the lastUpdated value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withLastUpdated(DateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the ETag of the search results. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag of the search results. + * + * @param eTag the eTag value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get how the results are sorted. + * + * @return the sort value + */ + public List sort() { + return this.sort; + } + + /** + * Set how the results are sorted. + * + * @param sort the sort value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSort(List sort) { + this.sort = sort; + return this; + } + + /** + * Get the request time. + * + * @return the requestTime value + */ + public Long requestTime() { + return this.requestTime; + } + + /** + * Set the request time. + * + * @param requestTime the requestTime value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withRequestTime(Long requestTime) { + this.requestTime = requestTime; + return this; + } + + /** + * Get the aggregated value field. + * + * @return the aggregatedValueField value + */ + public String aggregatedValueField() { + return this.aggregatedValueField; + } + + /** + * Set the aggregated value field. + * + * @param aggregatedValueField the aggregatedValueField value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withAggregatedValueField(String aggregatedValueField) { + this.aggregatedValueField = aggregatedValueField; + return this; + } + + /** + * Get the aggregated grouping fields. + * + * @return the aggregatedGroupingFields value + */ + public String aggregatedGroupingFields() { + return this.aggregatedGroupingFields; + } + + /** + * Set the aggregated grouping fields. + * + * @param aggregatedGroupingFields the aggregatedGroupingFields value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withAggregatedGroupingFields(String aggregatedGroupingFields) { + this.aggregatedGroupingFields = aggregatedGroupingFields; + return this; + } + + /** + * Get the sum of all aggregates returned in the result set. + * + * @return the sum value + */ + public Long sum() { + return this.sum; + } + + /** + * Set the sum of all aggregates returned in the result set. + * + * @param sum the sum value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSum(Long sum) { + this.sum = sum; + return this; + } + + /** + * Get the max of all aggregates returned in the result set. + * + * @return the max value + */ + public Long max() { + return this.max; + } + + /** + * Set the max of all aggregates returned in the result set. + * + * @param max the max value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withMax(Long max) { + this.max = max; + return this; + } + + /** + * Get the schema. + * + * @return the schema value + */ + public SearchMetadataSchema schema() { + return this.schema; + } + + /** + * Set the schema. + * + * @param schema the schema value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSchema(SearchMetadataSchema schema) { + this.schema = schema; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadataSchema.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadataSchema.java new file mode 100644 index 0000000000000..fd02b99c9f959 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchMetadataSchema.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema metadata for search. + */ +public class SearchMetadataSchema { + /** + * The name of the metadata schema. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The version of the metadata schema. + */ + @JsonProperty(value = "version") + private Integer version; + + /** + * Get the name of the metadata schema. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metadata schema. + * + * @param name the name value to set + * @return the SearchMetadataSchema object itself. + */ + public SearchMetadataSchema withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version of the metadata schema. + * + * @return the version value + */ + public Integer version() { + return this.version; + } + + /** + * Set the version of the metadata schema. + * + * @param version the version value to set + * @return the SearchMetadataSchema object itself. + */ + public SearchMetadataSchema withVersion(Integer version) { + this.version = version; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchParameters.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchParameters.java new file mode 100644 index 0000000000000..1b718c7c56b75 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchParameters.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters specifying the search query and range. + */ +public class SearchParameters { + /** + * The number to get from the top. + */ + @JsonProperty(value = "top") + private Long top; + + /** + * The highlight that looks for all occurrences of a string. + */ + @JsonProperty(value = "highlight") + private SearchHighlight highlight; + + /** + * The query to search. + */ + @JsonProperty(value = "query", required = true) + private String query; + + /** + * The start date filter, so the only query results returned are after this + * date. + */ + @JsonProperty(value = "start") + private DateTime start; + + /** + * The end date filter, so the only query results returned are before this + * date. + */ + @JsonProperty(value = "end") + private DateTime end; + + /** + * Get the number to get from the top. + * + * @return the top value + */ + public Long top() { + return this.top; + } + + /** + * Set the number to get from the top. + * + * @param top the top value to set + * @return the SearchParameters object itself. + */ + public SearchParameters withTop(Long top) { + this.top = top; + return this; + } + + /** + * Get the highlight that looks for all occurrences of a string. + * + * @return the highlight value + */ + public SearchHighlight highlight() { + return this.highlight; + } + + /** + * Set the highlight that looks for all occurrences of a string. + * + * @param highlight the highlight value to set + * @return the SearchParameters object itself. + */ + public SearchParameters withHighlight(SearchHighlight highlight) { + this.highlight = highlight; + return this; + } + + /** + * Get the query to search. + * + * @return the query value + */ + public String query() { + return this.query; + } + + /** + * Set the query to search. + * + * @param query the query value to set + * @return the SearchParameters object itself. + */ + public SearchParameters withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the start date filter, so the only query results returned are after this date. + * + * @return the start value + */ + public DateTime start() { + return this.start; + } + + /** + * Set the start date filter, so the only query results returned are after this date. + * + * @param start the start value to set + * @return the SearchParameters object itself. + */ + public SearchParameters withStart(DateTime start) { + this.start = start; + return this; + } + + /** + * Get the end date filter, so the only query results returned are before this date. + * + * @return the end value + */ + public DateTime end() { + return this.end; + } + + /** + * Set the end date filter, so the only query results returned are before this date. + * + * @param end the end value to set + * @return the SearchParameters object itself. + */ + public SearchParameters withEnd(DateTime end) { + this.end = end; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchResultsResponse.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchResultsResponse.java new file mode 100644 index 0000000000000..615f4e51e4e9d --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchResultsResponse.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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.SearchResultsResponseInner; +import java.util.List; + +/** + * Type representing SearchResultsResponse. + */ +public interface SearchResultsResponse extends HasInner, HasManager { + /** + * @return the error value. + */ + SearchError error(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the metadata value. + */ + SearchMetadata metadata(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSchemaValue.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSchemaValue.java new file mode 100644 index 0000000000000..33fd9fc8b1900 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSchemaValue.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Value object for schema results. + */ +public class SearchSchemaValue { + /** + * The name of the schema. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the schema. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The boolean that indicates the field is searchable as free text. + */ + @JsonProperty(value = "indexed", required = true) + private boolean indexed; + + /** + * The boolean that indicates whether or not the field is stored. + */ + @JsonProperty(value = "stored", required = true) + private boolean stored; + + /** + * The boolean that indicates whether or not the field is a facet. + */ + @JsonProperty(value = "facet", required = true) + private boolean facet; + + /** + * The array of workflows containing the field. + */ + @JsonProperty(value = "ownerType") + private List ownerType; + + /** + * Get the name of the schema. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the schema. + * + * @param name the name value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the schema. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the schema. + * + * @param displayName the displayName value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type. + * + * @param type the type value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withType(String type) { + this.type = type; + return this; + } + + /** + * Get the boolean that indicates the field is searchable as free text. + * + * @return the indexed value + */ + public boolean indexed() { + return this.indexed; + } + + /** + * Set the boolean that indicates the field is searchable as free text. + * + * @param indexed the indexed value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withIndexed(boolean indexed) { + this.indexed = indexed; + return this; + } + + /** + * Get the boolean that indicates whether or not the field is stored. + * + * @return the stored value + */ + public boolean stored() { + return this.stored; + } + + /** + * Set the boolean that indicates whether or not the field is stored. + * + * @param stored the stored value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withStored(boolean stored) { + this.stored = stored; + return this; + } + + /** + * Get the boolean that indicates whether or not the field is a facet. + * + * @return the facet value + */ + public boolean facet() { + return this.facet; + } + + /** + * Set the boolean that indicates whether or not the field is a facet. + * + * @param facet the facet value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withFacet(boolean facet) { + this.facet = facet; + return this; + } + + /** + * Get the array of workflows containing the field. + * + * @return the ownerType value + */ + public List ownerType() { + return this.ownerType; + } + + /** + * Set the array of workflows containing the field. + * + * @param ownerType the ownerType value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withOwnerType(List ownerType) { + this.ownerType = ownerType; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSort.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSort.java new file mode 100644 index 0000000000000..77a6bf5d576c8 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSort.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The sort parameters for search. + */ +public class SearchSort { + /** + * The name of the field the search query is sorted on. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The sort order of the search. Possible values include: 'asc', 'desc'. + */ + @JsonProperty(value = "order") + private SearchSortEnum order; + + /** + * Get the name of the field the search query is sorted on. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the field the search query is sorted on. + * + * @param name the name value to set + * @return the SearchSort object itself. + */ + public SearchSort withName(String name) { + this.name = name; + return this; + } + + /** + * Get the sort order of the search. Possible values include: 'asc', 'desc'. + * + * @return the order value + */ + public SearchSortEnum order() { + return this.order; + } + + /** + * Set the sort order of the search. Possible values include: 'asc', 'desc'. + * + * @param order the order value to set + * @return the SearchSort object itself. + */ + public SearchSort withOrder(SearchSortEnum order) { + this.order = order; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSortEnum.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSortEnum.java new file mode 100644 index 0000000000000..d665ac47c7147 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SearchSortEnum.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.loganalytics.v2015_03_20; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SearchSortEnum. + */ +public final class SearchSortEnum extends ExpandableStringEnum { + /** Static value asc for SearchSortEnum. */ + public static final SearchSortEnum ASC = fromString("asc"); + + /** Static value desc for SearchSortEnum. */ + public static final SearchSortEnum DESC = fromString("desc"); + + /** + * Creates or finds a SearchSortEnum from its string representation. + * @param name a name to look for + * @return the corresponding SearchSortEnum + */ + @JsonCreator + public static SearchSortEnum fromString(String name) { + return fromString(name, SearchSortEnum.class); + } + + /** + * @return known SearchSortEnum values + */ + public static Collection values() { + return values(SearchSortEnum.class); + } +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SharedKeys.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SharedKeys.java new file mode 100644 index 0000000000000..7c4dc8776dea3 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/SharedKeys.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.SharedKeysInner; + +/** + * Type representing SharedKeys. + */ +public interface SharedKeys extends HasInner, HasManager { + /** + * @return the primarySharedKey value. + */ + String primarySharedKey(); + + /** + * @return the secondarySharedKey value. + */ + String secondarySharedKey(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageAccount.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageAccount.java new file mode 100644 index 0000000000000..41275560bade2 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageAccount.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a storage account connection. + */ +public class StorageAccount { + /** + * The Azure Resource Manager ID of the storage account resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The storage account key. + */ + @JsonProperty(value = "key", required = true) + private String key; + + /** + * Get the Azure Resource Manager ID of the storage account resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the Azure Resource Manager ID of the storage account resource. + * + * @param id the id value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withId(String id) { + this.id = id; + return this; + } + + /** + * Get the storage account key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the storage account key. + * + * @param key the key value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsight.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsight.java new file mode 100644 index 0000000000000..8eafcad8ec686 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsight.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.StorageInsightInner; +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.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing StorageInsight. + */ +public interface StorageInsight extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the status value. + */ + StorageInsightStatus status(); + + /** + * @return the storageAccount value. + */ + StorageAccount storageAccount(); + + /** + * @return the tables value. + */ + List tables(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StorageInsight definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageInsight definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageInsight definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the storageinsight definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The Resource Group name + * @param workspaceName The Log Analytics Workspace name + * @return the next definition stage + */ + WithStorageAccount withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the storageinsight definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + * @param storageAccount The storage account connection details + * @return the next definition stage + */ + WithCreate withStorageAccount(StorageAccount storageAccount); + } + + /** + * The stage of the storageinsight definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + * @param containers The names of the blob containers that the workspace should read + * @return the next definition stage + */ + WithCreate withContainers(List containers); + } + + /** + * The stage of the storageinsight definition allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag The ETag of the storage insight + * @return the next definition stage + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the storageinsight definition allowing to specify Tables. + */ + interface WithTables { + /** + * Specifies tables. + * @param tables The names of the Azure tables that the workspace should read + * @return the next definition stage + */ + WithCreate withTables(List tables); + } + + /** + * The stage of the storageinsight definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithContainers, DefinitionStages.WithETag, DefinitionStages.WithTables, DefinitionStages.WithTags { + } + } + /** + * The template for a StorageInsight update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithContainers, UpdateStages.WithETag, UpdateStages.WithTables, UpdateStages.WithTags { + } + + /** + * Grouping of StorageInsight update stages. + */ + interface UpdateStages { + /** + * The stage of the storageinsight update allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + * @param containers The names of the blob containers that the workspace should read + * @return the next update stage + */ + Update withContainers(List containers); + } + + /** + * The stage of the storageinsight update allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag The ETag of the storage insight + * @return the next update stage + */ + Update withETag(String eTag); + } + + /** + * The stage of the storageinsight update allowing to specify Tables. + */ + interface WithTables { + /** + * Specifies tables. + * @param tables The names of the Azure tables that the workspace should read + * @return the next update stage + */ + Update withTables(List tables); + } + + /** + * The stage of the storageinsight update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightState.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightState.java new file mode 100644 index 0000000000000..6468e7361fafe --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightState.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.loganalytics.v2015_03_20; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StorageInsightState. + */ +public final class StorageInsightState extends ExpandableStringEnum { + /** Static value OK for StorageInsightState. */ + public static final StorageInsightState OK = fromString("OK"); + + /** Static value ERROR for StorageInsightState. */ + public static final StorageInsightState ERROR = fromString("ERROR"); + + /** + * Creates or finds a StorageInsightState from its string representation. + * @param name a name to look for + * @return the corresponding StorageInsightState + */ + @JsonCreator + public static StorageInsightState fromString(String name) { + return fromString(name, StorageInsightState.class); + } + + /** + * @return known StorageInsightState values + */ + public static Collection values() { + return values(StorageInsightState.class); + } +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightStatus.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightStatus.java new file mode 100644 index 0000000000000..faa7f28f1e772 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsightStatus.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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of the storage insight. + */ +public class StorageInsightStatus { + /** + * The state of the storage insight connection to the workspace. Possible + * values include: 'OK', 'ERROR'. + */ + @JsonProperty(value = "state", required = true) + private StorageInsightState state; + + /** + * Description of the state of the storage insight. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the state of the storage insight connection to the workspace. Possible values include: 'OK', 'ERROR'. + * + * @return the state value + */ + public StorageInsightState state() { + return this.state; + } + + /** + * Set the state of the storage insight connection to the workspace. Possible values include: 'OK', 'ERROR'. + * + * @param state the state value to set + * @return the StorageInsightStatus object itself. + */ + public StorageInsightStatus withState(StorageInsightState state) { + this.state = state; + return this; + } + + /** + * Get description of the state of the storage insight. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the state of the storage insight. + * + * @param description the description value to set + * @return the StorageInsightStatus object itself. + */ + public StorageInsightStatus withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsights.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsights.java new file mode 100644 index 0000000000000..e470057926e1b --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/StorageInsights.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.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.StorageInsightsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageInsights. + */ +public interface StorageInsights extends SupportsCreating, HasInner { + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String storageInsightName); + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName); + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String storageInsightName); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Tag.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Tag.java new file mode 100644 index 0000000000000..e9be10e323f3e --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Tag.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A tag of a saved search. + */ +public class Tag { + /** + * The tag name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The tag value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the tag name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the tag name. + * + * @param name the name value to set + * @return the Tag object itself. + */ + public Tag withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tag value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the tag value. + * + * @param value the value value to set + * @return the Tag object itself. + */ + public Tag withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBody.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBody.java new file mode 100644 index 0000000000000..78a29013b1108 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBody.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the body of a purge request for an App Insights Workspace. + */ +public class WorkspacePurgeBody { + /** + * Table from which to purge data. + */ + @JsonProperty(value = "table", required = true) + private String table; + + /** + * The set of columns and filters (queries) to run over them to purge the + * resulting data. + */ + @JsonProperty(value = "filters", required = true) + private List filters; + + /** + * Get table from which to purge data. + * + * @return the table value + */ + public String table() { + return this.table; + } + + /** + * Set table from which to purge data. + * + * @param table the table value to set + * @return the WorkspacePurgeBody object itself. + */ + public WorkspacePurgeBody withTable(String table) { + this.table = table; + return this; + } + + /** + * Get the set of columns and filters (queries) to run over them to purge the resulting data. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the set of columns and filters (queries) to run over them to purge the resulting data. + * + * @param filters the filters value to set + * @return the WorkspacePurgeBody object itself. + */ + public WorkspacePurgeBody withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBodyFilters.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBodyFilters.java new file mode 100644 index 0000000000000..f270aeeb2632a --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeBodyFilters.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User-defined filters to return data which will be purged from the table. + */ +public class WorkspacePurgeBodyFilters { + /** + * The column of the table over which the given query should run. + */ + @JsonProperty(value = "column") + private String column; + + /** + * A query operator to evaluate over the provided column and value(s). + * Supported operators are ==, =~, in, in~, >, >=, <, <=, + * between, and have the same behavior as they would in a KQL query. + */ + @JsonProperty(value = "operator") + private String operator; + + /** + * the value for the operator to function over. This can be a number (e.g., + * > 100), a string (timestamp >= '2017-09-01') or array of values. + */ + @JsonProperty(value = "value") + private Object value; + + /** + * When filtering over custom dimensions, this key will be used as the name + * of the custom dimension. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the column of the table over which the given query should run. + * + * @return the column value + */ + public String column() { + return this.column; + } + + /** + * Set the column of the table over which the given query should run. + * + * @param column the column value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withColumn(String column) { + this.column = column; + return this; + } + + /** + * Get a query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + * + * @return the operator value + */ + public String operator() { + return this.operator; + } + + /** + * Set a query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + * + * @param operator the operator value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withOperator(String operator) { + this.operator = operator; + return this; + } + + /** + * Get the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + * + * @return the value value + */ + public Object value() { + return this.value; + } + + /** + * Set the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + * + * @param value the value value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withValue(Object value) { + this.value = value; + return this; + } + + /** + * Get when filtering over custom dimensions, this key will be used as the name of the custom dimension. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set when filtering over custom dimensions, this key will be used as the name of the custom dimension. + * + * @param key the key value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeResponse.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeResponse.java new file mode 100644 index 0000000000000..faa3cc8149895 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.WorkspacePurgeResponseInner; + +/** + * Type representing WorkspacePurgeResponse. + */ +public interface WorkspacePurgeResponse extends HasInner, HasManager { + /** + * @return the operationId value. + */ + String operationId(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeStatusResponse.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeStatusResponse.java new file mode 100644 index 0000000000000..a11d540073940 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacePurgeStatusResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.WorkspacePurgeStatusResponseInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2015_03_20.implementation.LogAnalyticsManager; + +/** + * Type representing WorkspacePurgeStatusResponse. + */ +public interface WorkspacePurgeStatusResponse extends HasInner, HasManager { + /** + * @return the status value. + */ + PurgeState status(); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java new file mode 100644 index 0000000000000..252665de9318b --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/Workspaces.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20; + +import rx.Observable; +import rx.Completable; + +/** + * Type representing Workspaces. + */ +public interface Workspaces { + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName); + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSchemaAsync(String resourceGroupName, String workspaceName); + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters); + + /** + * Gets updated search results for a given search query. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id); + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body); + + /** + * Gets the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String workspaceName); + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateSharedKeysAsync(String resourceGroupName, String workspaceName); + + /** + * Get a list of workspaces which the current user has administrator privileges and are not associated with an Azure Subscription. The subscriptionId parameter in the Url is ignored. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param gatewayId The Log Analytics gateway Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteGatewaysAsync(String resourceGroupName, String workspaceName, String gatewayId); + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacesPurgeHeaders.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacesPurgeHeaders.java new file mode 100644 index 0000000000000..2c96437327f37 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/WorkspacesPurgeHeaders.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.loganalytics.v2015_03_20; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Purge operation. + */ +public class WorkspacesPurgeHeaders { + /** + * The location from which to request the operation status. + */ + @JsonProperty(value = "x-ms-status-location") + private String xMsStatusLocation; + + /** + * Get the location from which to request the operation status. + * + * @return the xMsStatusLocation value + */ + public String xMsStatusLocation() { + return this.xMsStatusLocation; + } + + /** + * Set the location from which to request the operation status. + * + * @param xMsStatusLocation the xMsStatusLocation value to set + * @return the WorkspacesPurgeHeaders object itself. + */ + public WorkspacesPurgeHeaders withXMsStatusLocation(String xMsStatusLocation) { + this.xMsStatusLocation = xMsStatusLocation; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/IdParsingUtils.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..9e200116f8143 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/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.loganalytics.v2015_03_20.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/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetImpl.java new file mode 100644 index 0000000000000..5fce452f72fe0 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.LinkTarget; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LinkTargetImpl extends WrapperImpl implements LinkTarget { + private final LogAnalyticsManager manager; + LinkTargetImpl(LinkTargetInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public String customerId() { + return this.inner().customerId(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String workspaceName() { + return this.inner().workspaceName(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetInner.java new file mode 100644 index 0000000000000..3648c54760f77 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LinkTargetInner.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.loganalytics.v2015_03_20.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata for a workspace that isn't linked to an Azure subscription. + */ +public class LinkTargetInner { + /** + * The GUID that uniquely identifies the workspace. + */ + @JsonProperty(value = "customerId") + private String customerId; + + /** + * The display name of the workspace. + */ + @JsonProperty(value = "accountName") + private String displayName; + + /** + * The DNS valid workspace name. + */ + @JsonProperty(value = "workspaceName") + private String workspaceName; + + /** + * The location of the workspace. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the GUID that uniquely identifies the workspace. + * + * @return the customerId value + */ + public String customerId() { + return this.customerId; + } + + /** + * Set the GUID that uniquely identifies the workspace. + * + * @param customerId the customerId value to set + * @return the LinkTargetInner object itself. + */ + public LinkTargetInner withCustomerId(String customerId) { + this.customerId = customerId; + return this; + } + + /** + * Get the display name of the workspace. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the workspace. + * + * @param displayName the displayName value to set + * @return the LinkTargetInner object itself. + */ + public LinkTargetInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the DNS valid workspace name. + * + * @return the workspaceName value + */ + public String workspaceName() { + return this.workspaceName; + } + + /** + * Set the DNS valid workspace name. + * + * @param workspaceName the workspaceName value to set + * @return the LinkTargetInner object itself. + */ + public LinkTargetInner withWorkspaceName(String workspaceName) { + this.workspaceName = workspaceName; + return this; + } + + /** + * Get the location of the workspace. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the workspace. + * + * @param location the location value to set + * @return the LinkTargetInner object itself. + */ + public LinkTargetInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LogAnalyticsManager.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LogAnalyticsManager.java new file mode 100644 index 0000000000000..56b6c6dd3b281 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/LogAnalyticsManager.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.loganalytics.v2015_03_20.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.loganalytics.v2015_03_20.StorageInsights; +import com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearches; +import com.microsoft.azure.management.loganalytics.v2015_03_20.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure LogAnalytics resource management. + */ +public final class LogAnalyticsManager extends ManagerCore { + private StorageInsights storageInsights; + private Workspaces workspaces; + private SavedSearches savedSearches; + private Operations operations; + /** + * Get a Configurable instance that can be used to create LogAnalyticsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new LogAnalyticsManager.ConfigurableImpl(); + } + /** + * Creates an instance of LogAnalyticsManager that exposes LogAnalytics resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the LogAnalyticsManager + */ + public static LogAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new LogAnalyticsManager(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 LogAnalyticsManager that exposes LogAnalytics resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the LogAnalyticsManager + */ + public static LogAnalyticsManager authenticate(RestClient restClient, String subscriptionId) { + return new LogAnalyticsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of LogAnalyticsManager that exposes LogAnalytics management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing LogAnalytics management API entry points that work across subscriptions + */ + LogAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage StorageInsights. + */ + public StorageInsights storageInsights() { + if (this.storageInsights == null) { + this.storageInsights = new StorageInsightsImpl(this); + } + return this.storageInsights; + } + + /** + * @return Entry point to manage Workspaces. + */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(this); + } + return this.workspaces; + } + + /** + * @return Entry point to manage SavedSearches. + */ + public SavedSearches savedSearches() { + if (this.savedSearches == null) { + this.savedSearches = new SavedSearchesImpl(this); + } + return this.savedSearches; + } + + /** + * @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 LogAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return LogAnalyticsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private LogAnalyticsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new OperationalInsightsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationInner.java new file mode 100644 index 0000000000000..7d2a70179d107 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationInner.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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Supported operation of OperationalInsights resource provider. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {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 display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..b83255830efb2 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultImpl.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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final LogAnalyticsManager manager; + OperationListResultImpl(OperationListResultInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..9e145454b211e --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationListResultInner.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.loganalytics.v2015_03_20.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the request to list OperationalInsights operations. + */ +public class OperationListResultInner { + /** + * List of operations supported by the OperationalInsights resource + * provider. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of operations supported by the OperationalInsights resource provider. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of operations supported by the OperationalInsights resource provider. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationalInsightsManagementClientImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationalInsightsManagementClientImpl.java new file mode 100644 index 0000000000000..5beffb0c15a2c --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationalInsightsManagementClientImpl.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.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 OperationalInsightsManagementClientImpl class. + */ +public class OperationalInsightsManagementClientImpl 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; + } + + /** The Subscription ID. */ + private String subscriptionId; + + /** + * Gets The Subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public OperationalInsightsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The client API version. */ + private String apiVersion; + + /** + * Gets The client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** In a purge status request, this is the Id of the operation the status of which is returned. */ + private String purgeId; + + /** + * Gets In a purge status request, this is the Id of the operation the status of which is returned. + * + * @return the purgeId value. + */ + public String purgeId() { + return this.purgeId; + } + + /** + * Sets In a purge status request, this is the Id of the operation the status of which is returned. + * + * @param purgeId the purgeId value. + * @return the service client itself + */ + public OperationalInsightsManagementClientImpl withPurgeId(String purgeId) { + this.purgeId = purgeId; + return this; + } + + /** 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 OperationalInsightsManagementClientImpl 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 OperationalInsightsManagementClientImpl 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 OperationalInsightsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The StorageInsightsInner object to access its operations. + */ + private StorageInsightsInner storageInsights; + + /** + * Gets the StorageInsightsInner object to access its operations. + * @return the StorageInsightsInner object. + */ + public StorageInsightsInner storageInsights() { + return this.storageInsights; + } + + /** + * The WorkspacesInner object to access its operations. + */ + private WorkspacesInner workspaces; + + /** + * Gets the WorkspacesInner object to access its operations. + * @return the WorkspacesInner object. + */ + public WorkspacesInner workspaces() { + return this.workspaces; + } + + /** + * The SavedSearchesInner object to access its operations. + */ + private SavedSearchesInner savedSearches; + + /** + * Gets the SavedSearchesInner object to access its operations. + * @return the SavedSearchesInner object. + */ + public SavedSearchesInner savedSearches() { + return this.savedSearches; + } + + /** + * 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 OperationalInsightsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public OperationalInsightsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of OperationalInsightsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public OperationalInsightsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of OperationalInsightsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public OperationalInsightsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-03-20"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.storageInsights = new StorageInsightsInner(restClient().retrofit(), this); + this.workspaces = new WorkspacesInner(restClient().retrofit(), this); + this.savedSearches = new SavedSearchesInner(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(), "OperationalInsightsManagementClient", "2015-03-20"); + } +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..c12842d5b2100 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsImpl.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. + * abc + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2015_03_20.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2015_03_20.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final LogAnalyticsManager manager; + + OperationsImpl(LogAnalyticsManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsInner.java new file mode 100644 index 0000000000000..1f29d838ccb12 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl 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, OperationalInsightsManagementClientImpl 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.loganalytics.v2015_03_20.Operations list" }) + @GET("providers/Microsoft.OperationalInsights/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @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 OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @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 of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + 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 clientResponse = listDelegate(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().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/PageImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/PageImpl.java new file mode 100644 index 0000000000000..69345e9c94845 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/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.loganalytics.v2015_03_20.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("@odata.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 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/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/PageImpl1.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/PageImpl1.java new file mode 100644 index 0000000000000..a839013b08518 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/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.loganalytics.v2015_03_20.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("") + 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/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchImpl.java new file mode 100644 index 0000000000000..0eb0438ecc8e0 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearch; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.Tag; + +class SavedSearchImpl extends CreatableUpdatableImpl implements SavedSearch, SavedSearch.Definition, SavedSearch.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String savedSearchId; + + SavedSearchImpl(String name, LogAnalyticsManager manager) { + super(name, new SavedSearchInner()); + this.manager = manager; + // Set resource name + this.savedSearchId = name; + // + } + + SavedSearchImpl(SavedSearchInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.savedSearchId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.savedSearchId = IdParsingUtils.getValueFromIdByName(inner.id(), "savedSearches"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SavedSearchesInner client = this.manager().inner().savedSearches(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.savedSearchId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SavedSearchesInner client = this.manager().inner().savedSearches(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.savedSearchId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SavedSearchesInner client = this.manager().inner().savedSearches(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.savedSearchId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String category() { + return this.inner().category(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String query() { + return this.inner().query(); + } + + @Override + public List tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Long version() { + return this.inner().version(); + } + + @Override + public SavedSearchImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public SavedSearchImpl withCategory(String category) { + this.inner().withCategory(category); + return this; + } + + @Override + public SavedSearchImpl withDisplayName(String displayName) { + this.inner().withDisplayName(displayName); + return this; + } + + @Override + public SavedSearchImpl withQuery(String query) { + this.inner().withQuery(query); + return this; + } + + @Override + public SavedSearchImpl withETag(String eTag) { + this.inner().withETag(eTag); + return this; + } + + @Override + public SavedSearchImpl withTags(List tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public SavedSearchImpl withVersion(Long version) { + this.inner().withVersion(version); + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchInner.java new file mode 100644 index 0000000000000..ab44c86976ae5 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchInner.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.Tag; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Value object for saved search results. + */ +@JsonFlatten +public class SavedSearchInner extends ProxyResource { + /** + * The ETag of the saved search. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * The category of the saved search. This helps the user to find a saved + * search faster. + */ + @JsonProperty(value = "properties.category", required = true) + private String category; + + /** + * Saved search display name. + */ + @JsonProperty(value = "properties.displayName", required = true) + private String displayName; + + /** + * The query expression for the saved search. Please see + * https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference + * for reference. + */ + @JsonProperty(value = "properties.query", required = true) + private String query; + + /** + * The version number of the query language. The current version is 2 and + * is the default. + */ + @JsonProperty(value = "properties.version") + private Long version; + + /** + * The tags attached to the saved search. + */ + @JsonProperty(value = "properties.tags") + private List tags; + + /** + * Get the ETag of the saved search. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag of the saved search. + * + * @param eTag the eTag value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the category of the saved search. This helps the user to find a saved search faster. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category of the saved search. This helps the user to find a saved search faster. + * + * @param category the category value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get saved search display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set saved search display name. + * + * @param displayName the displayName value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the query expression for the saved search. Please see https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference. + * + * @return the query value + */ + public String query() { + return this.query; + } + + /** + * Set the query expression for the saved search. Please see https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference. + * + * @param query the query value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the version number of the query language. The current version is 2 and is the default. + * + * @return the version value + */ + public Long version() { + return this.version; + } + + /** + * Set the version number of the query language. The current version is 2 and is the default. + * + * @param version the version value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withVersion(Long version) { + this.version = version; + return this; + } + + /** + * Get the tags attached to the saved search. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags attached to the saved search. + * + * @param tags the tags value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withTags(List tags) { + this.tags = tags; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java new file mode 100644 index 0000000000000..9238b4e9b60ff --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearches; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearchesListResult; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearch; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchResultsResponse; + +class SavedSearchesImpl extends WrapperImpl implements SavedSearches { + private final LogAnalyticsManager manager; + + SavedSearchesImpl(LogAnalyticsManager manager) { + super(manager.inner().savedSearches()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public SavedSearchImpl define(String name) { + return wrapModel(name); + } + + private SavedSearchImpl wrapModel(SavedSearchInner inner) { + return new SavedSearchImpl(inner, manager()); + } + + private SavedSearchImpl wrapModel(String name) { + return new SavedSearchImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + SavedSearchesInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SavedSearchesListResult call(SavedSearchesListResultInner inner) { + return new SavedSearchesListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + SavedSearchesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, savedSearchId) + .map(new Func1() { + @Override + public SavedSearch call(SavedSearchInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + SavedSearchesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, savedSearchId).toCompletable(); + } + + @Override + public Observable getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + SavedSearchesInner client = this.inner(); + return client.getResultsAsync(resourceGroupName, workspaceName, savedSearchId) + .map(new Func1() { + @Override + public SearchResultsResponse call(SearchResultsResponseInner inner) { + return new SearchResultsResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java new file mode 100644 index 0000000000000..f43d480451766 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesInner.java @@ -0,0 +1,545 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SavedSearches. + */ +public class SavedSearchesInner { + /** The Retrofit service to perform REST calls. */ + private SavedSearchesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of SavedSearchesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SavedSearchesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(SavedSearchesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SavedSearches to be + * used by Retrofit to perform actually REST calls. + */ + interface SavedSearchesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearches delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @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.loganalytics.v2015_03_20.SavedSearches createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @Query("api-version") String apiVersion, @Body SavedSearchInner 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.loganalytics.v2015_03_20.SavedSearches get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @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.loganalytics.v2015_03_20.SavedSearches listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches") + Observable> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2015_03_20.SavedSearches getResults" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}/results") + Observable> getResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @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 workspaceName, String savedSearchId) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).toBlocking().single().body(); + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @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 workspaceName, String savedSearchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId), serviceCallback); + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (savedSearchId == null) { + throw new IllegalArgumentException("Parameter savedSearchId 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.delete(this.client.subscriptionId(), resourceGroupName, workspaceName, savedSearchId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(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 saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @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 SavedSearchInner object if successful. + */ + public SavedSearchInner createOrUpdate(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @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 workspaceName, String savedSearchId, SavedSearchInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters), serviceCallback); + } + + /** + * Creates or updates a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters).map(new Func1, SavedSearchInner>() { + @Override + public SavedSearchInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (savedSearchId == null) { + throw new IllegalArgumentException("Parameter savedSearchId 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.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, savedSearchId, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @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 SavedSearchInner object if successful. + */ + public SavedSearchInner get(String resourceGroupName, String workspaceName, String savedSearchId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).toBlocking().single().body(); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @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 workspaceName, String savedSearchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId), serviceCallback); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).map(new Func1, SavedSearchInner>() { + @Override + public SavedSearchInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (savedSearchId == null) { + throw new IllegalArgumentException("Parameter savedSearchId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, savedSearchId, 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); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 SavedSearchesListResultInner object if successful. + */ + public SavedSearchesListResultInner listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchesListResultInner object + */ + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SavedSearchesListResultInner>() { + @Override + public SavedSearchesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchesListResultInner object + */ + public Observable> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(resourceGroupName, workspaceName, 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 = listByWorkspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the results from a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @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 SearchResultsResponseInner object if successful. + */ + public SearchResultsResponseInner getResults(String resourceGroupName, String workspaceName, String savedSearchId) { + return getResultsWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).toBlocking().single().body(); + } + + /** + * Gets the results from a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @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 getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getResultsWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId), serviceCallback); + } + + /** + * Gets the results from a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResultsResponseInner object + */ + public Observable getResultsAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + return getResultsWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).map(new Func1, SearchResultsResponseInner>() { + @Override + public SearchResultsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the results from a saved search for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResultsResponseInner object + */ + public Observable> getResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (savedSearchId == null) { + throw new IllegalArgumentException("Parameter savedSearchId 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.getResults(resourceGroupName, workspaceName, savedSearchId, 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 = getResultsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getResultsDelegate(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/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultImpl.java new file mode 100644 index 0000000000000..c6c566fe38a4d --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SavedSearchesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchMetadata; +import java.util.List; + +class SavedSearchesListResultImpl extends WrapperImpl implements SavedSearchesListResult { + private final LogAnalyticsManager manager; + SavedSearchesListResultImpl(SavedSearchesListResultInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public SearchMetadata metadata() { + return this.inner().metadata(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java new file mode 100644 index 0000000000000..f05701c02df36 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SavedSearchesListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchMetadata; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The saved search list operation response. + */ +public class SavedSearchesListResultInner { + /** + * The metadata from search results. + */ + @JsonProperty(value = "__metadata") + private SearchMetadata metadata; + + /** + * The array of result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the metadata from search results. + * + * @return the metadata value + */ + public SearchMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata from search results. + * + * @param metadata the metadata value to set + * @return the SavedSearchesListResultInner object itself. + */ + public SavedSearchesListResultInner withMetadata(SearchMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the array of result values. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the array of result values. + * + * @param value the value value to set + * @return the SavedSearchesListResultInner object itself. + */ + public SavedSearchesListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseImpl.java new file mode 100644 index 0000000000000..7dd3c5584015d --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchGetSchemaResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchMetadata; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchSchemaValue; + +class SearchGetSchemaResponseImpl extends WrapperImpl implements SearchGetSchemaResponse { + private final LogAnalyticsManager manager; + SearchGetSchemaResponseImpl(SearchGetSchemaResponseInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public SearchMetadata metadata() { + return this.inner().metadata(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseInner.java new file mode 100644 index 0000000000000..6d054f3d7e128 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchGetSchemaResponseInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchMetadata; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchSchemaValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The get schema operation response. + */ +public class SearchGetSchemaResponseInner { + /** + * The metadata from search results. + */ + @JsonProperty(value = "metadata") + private SearchMetadata metadata; + + /** + * The array of result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the metadata from search results. + * + * @return the metadata value + */ + public SearchMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata from search results. + * + * @param metadata the metadata value to set + * @return the SearchGetSchemaResponseInner object itself. + */ + public SearchGetSchemaResponseInner withMetadata(SearchMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the array of result values. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the array of result values. + * + * @param value the value value to set + * @return the SearchGetSchemaResponseInner object itself. + */ + public SearchGetSchemaResponseInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseImpl.java new file mode 100644 index 0000000000000..aff22c19f49f4 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseImpl.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. + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchResultsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchError; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchMetadata; +import java.util.List; + +class SearchResultsResponseImpl extends WrapperImpl implements SearchResultsResponse { + private final LogAnalyticsManager manager; + SearchResultsResponseImpl(SearchResultsResponseInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public SearchError error() { + return this.inner().error(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public SearchMetadata metadata() { + return this.inner().metadata(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseInner.java new file mode 100644 index 0000000000000..856de2b48802d --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SearchResultsResponseInner.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchMetadata; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The get search result operation response. + */ +public class SearchResultsResponseInner { + /** + * The id of the search, which includes the full url. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The metadata from search results. + */ + @JsonProperty(value = "metaData") + private SearchMetadata metadata; + + /** + * The array of result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The error. + */ + @JsonProperty(value = "error") + private SearchError error; + + /** + * Get the id of the search, which includes the full url. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the metadata from search results. + * + * @return the metadata value + */ + public SearchMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata from search results. + * + * @param metadata the metadata value to set + * @return the SearchResultsResponseInner object itself. + */ + public SearchResultsResponseInner withMetadata(SearchMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the array of result values. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the array of result values. + * + * @param value the value value to set + * @return the SearchResultsResponseInner object itself. + */ + public SearchResultsResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the error. + * + * @return the error value + */ + public SearchError error() { + return this.error; + } + + /** + * Set the error. + * + * @param error the error value to set + * @return the SearchResultsResponseInner object itself. + */ + public SearchResultsResponseInner withError(SearchError error) { + this.error = error; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysImpl.java new file mode 100644 index 0000000000000..c2a7c7b3fbaa7 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.SharedKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SharedKeysImpl extends WrapperImpl implements SharedKeys { + private final LogAnalyticsManager manager; + SharedKeysImpl(SharedKeysInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public String primarySharedKey() { + return this.inner().primarySharedKey(); + } + + @Override + public String secondarySharedKey() { + return this.inner().secondarySharedKey(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysInner.java new file mode 100644 index 0000000000000..33b3ba9f4dde4 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/SharedKeysInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The shared keys for a workspace. + */ +public class SharedKeysInner { + /** + * The primary shared key of a workspace. + */ + @JsonProperty(value = "primarySharedKey") + private String primarySharedKey; + + /** + * The secondary shared key of a workspace. + */ + @JsonProperty(value = "secondarySharedKey") + private String secondarySharedKey; + + /** + * Get the primary shared key of a workspace. + * + * @return the primarySharedKey value + */ + public String primarySharedKey() { + return this.primarySharedKey; + } + + /** + * Set the primary shared key of a workspace. + * + * @param primarySharedKey the primarySharedKey value to set + * @return the SharedKeysInner object itself. + */ + public SharedKeysInner withPrimarySharedKey(String primarySharedKey) { + this.primarySharedKey = primarySharedKey; + return this; + } + + /** + * Get the secondary shared key of a workspace. + * + * @return the secondarySharedKey value + */ + public String secondarySharedKey() { + return this.secondarySharedKey; + } + + /** + * Set the secondary shared key of a workspace. + * + * @param secondarySharedKey the secondarySharedKey value to set + * @return the SharedKeysInner object itself. + */ + public SharedKeysInner withSecondarySharedKey(String secondarySharedKey) { + this.secondarySharedKey = secondarySharedKey; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightImpl.java new file mode 100644 index 0000000000000..84daaef6004cd --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightImpl.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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.StorageInsight; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.StorageAccount; +import com.microsoft.azure.management.loganalytics.v2015_03_20.StorageInsightStatus; + +class StorageInsightImpl extends CreatableUpdatableImpl implements StorageInsight, StorageInsight.Definition, StorageInsight.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String storageInsightName; + + StorageInsightImpl(String name, LogAnalyticsManager manager) { + super(name, new StorageInsightInner()); + this.manager = manager; + // Set resource name + this.storageInsightName = name; + // + } + + StorageInsightImpl(StorageInsightInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.storageInsightName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.storageInsightName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageInsightConfigs"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StorageInsightsInner client = this.manager().inner().storageInsights(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.storageInsightName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageInsightsInner client = this.manager().inner().storageInsights(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.storageInsightName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageInsightsInner client = this.manager().inner().storageInsights(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.storageInsightName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public StorageInsightStatus status() { + return this.inner().status(); + } + + @Override + public StorageAccount storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public List tables() { + return this.inner().tables(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StorageInsightImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public StorageInsightImpl withStorageAccount(StorageAccount storageAccount) { + this.inner().withStorageAccount(storageAccount); + return this; + } + + @Override + public StorageInsightImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public StorageInsightImpl withETag(String eTag) { + this.inner().withETag(eTag); + return this; + } + + @Override + public StorageInsightImpl withTables(List tables) { + this.inner().withTables(tables); + return this; + } + + @Override + public StorageInsightImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightInner.java new file mode 100644 index 0000000000000..5260f077a4230 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightInner.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2015_03_20.StorageAccount; +import com.microsoft.azure.management.loganalytics.v2015_03_20.StorageInsightStatus; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The top level storage insight resource container. + */ +@JsonFlatten +public class StorageInsightInner extends ProxyResource { + /** + * The names of the blob containers that the workspace should read. + */ + @JsonProperty(value = "properties.containers") + private List containers; + + /** + * The names of the Azure tables that the workspace should read. + */ + @JsonProperty(value = "properties.tables") + private List tables; + + /** + * The storage account connection details. + */ + @JsonProperty(value = "properties.storageAccount", required = true) + private StorageAccount storageAccount; + + /** + * The status of the storage insight. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private StorageInsightStatus status; + + /** + * The ETag of the storage insight. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the names of the blob containers that the workspace should read. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the names of the blob containers that the workspace should read. + * + * @param containers the containers value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the names of the Azure tables that the workspace should read. + * + * @return the tables value + */ + public List tables() { + return this.tables; + } + + /** + * Set the names of the Azure tables that the workspace should read. + * + * @param tables the tables value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withTables(List tables) { + this.tables = tables; + return this; + } + + /** + * Get the storage account connection details. + * + * @return the storageAccount value + */ + public StorageAccount storageAccount() { + return this.storageAccount; + } + + /** + * Set the storage account connection details. + * + * @param storageAccount the storageAccount value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withStorageAccount(StorageAccount storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get the status of the storage insight. + * + * @return the status value + */ + public StorageInsightStatus status() { + return this.status; + } + + /** + * Get the ETag of the storage insight. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag of the storage insight. + * + * @param eTag the eTag value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * 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 StorageInsightInner object itself. + */ + public StorageInsightInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java new file mode 100644 index 0000000000000..e8af7084fa6ad --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2015_03_20.StorageInsights; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.loganalytics.v2015_03_20.StorageInsight; + +class StorageInsightsImpl extends WrapperImpl implements StorageInsights { + private final LogAnalyticsManager manager; + + StorageInsightsImpl(LogAnalyticsManager manager) { + super(manager.inner().storageInsights()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public StorageInsightImpl define(String name) { + return wrapModel(name); + } + + private StorageInsightImpl wrapModel(StorageInsightInner inner) { + return new StorageInsightImpl(inner, manager()); + } + + private StorageInsightImpl wrapModel(String name) { + return new StorageInsightImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) { + StorageInsightsInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageInsight call(StorageInsightInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + StorageInsightsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, storageInsightName) + .map(new Func1() { + @Override + public StorageInsight call(StorageInsightInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + StorageInsightsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, storageInsightName).toCompletable(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsInner.java new file mode 100644 index 0000000000000..e810486444318 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/StorageInsightsInner.java @@ -0,0 +1,608 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.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.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.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 StorageInsights. + */ +public class StorageInsightsInner { + /** The Retrofit service to perform REST calls. */ + private StorageInsightsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of StorageInsightsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageInsightsInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(StorageInsightsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageInsights to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageInsightsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.StorageInsights createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("storageInsightName") String storageInsightName, @Path("subscriptionId") String subscriptionId, @Body StorageInsightInner 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.loganalytics.v2015_03_20.StorageInsights get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("storageInsightName") String storageInsightName, @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.loganalytics.v2015_03_20.StorageInsights delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("storageInsightName") String storageInsightName, @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.loganalytics.v2015_03_20.StorageInsights listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs") + Observable> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2015_03_20.StorageInsights listByWorkspaceNext" }) + @GET + Observable> listByWorkspaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @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 StorageInsightInner object if successful. + */ + public StorageInsightInner createOrUpdate(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @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 workspaceName, String storageInsightName, StorageInsightInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters), serviceCallback); + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters).map(new Func1, StorageInsightInner>() { + @Override + public StorageInsightInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (storageInsightName == null) { + throw new IllegalArgumentException("Parameter storageInsightName 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.createOrUpdate(resourceGroupName, workspaceName, storageInsightName, 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 = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(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); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageInsightInner object if successful. + */ + public StorageInsightInner get(String resourceGroupName, String workspaceName, String storageInsightName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).toBlocking().single().body(); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String storageInsightName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName), serviceCallback); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).map(new Func1, StorageInsightInner>() { + @Override + public StorageInsightInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (storageInsightName == null) { + throw new IllegalArgumentException("Parameter storageInsightName 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, workspaceName, storageInsightName, 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); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String workspaceName, String storageInsightName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).toBlocking().single().body(); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String workspaceName, String storageInsightName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName), serviceCallback); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (storageInsightName == null) { + throw new IllegalArgumentException("Parameter storageInsightName 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.delete(resourceGroupName, workspaceName, storageInsightName, 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 = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 PagedList<StorageInsightInner> object if successful. + */ + public PagedList listByWorkspace(final String resourceGroupName, final String workspaceName) { + ServiceResponse> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageInsightInner> object + */ + public Observable> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageInsightInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName) { + return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName) + .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(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + ServiceResponse> * @param resourceGroupName The Resource Group name. + ServiceResponse> * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageInsightInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(resourceGroupName, workspaceName, 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 = listByWorkspaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceDelegate(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 the storage insight instances within a workspace. + * + * @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<StorageInsightInner> object if successful. + */ + public PagedList listByWorkspaceNext(final String nextPageLink) { + ServiceResponse> response = listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the storage insight instances within a workspace. + * + * @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> listByWorkspaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @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<StorageInsightInner> object + */ + public Observable> listByWorkspaceNextAsync(final String nextPageLink) { + return listByWorkspaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @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<StorageInsightInner> object + */ + public Observable>> listByWorkspaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(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(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageInsightInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceNextSinglePageAsync(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.listByWorkspaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceNextDelegate(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/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseImpl.java new file mode 100644 index 0000000000000..f208daaa11e05 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class WorkspacePurgeResponseImpl extends WrapperImpl implements WorkspacePurgeResponse { + private final LogAnalyticsManager manager; + WorkspacePurgeResponseImpl(WorkspacePurgeResponseInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public String operationId() { + return this.inner().operationId(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseInner.java new file mode 100644 index 0000000000000..c83d9b365b8bc --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeResponseInner.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.loganalytics.v2015_03_20.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response containing operationId for a specific purge action. + */ +public class WorkspacePurgeResponseInner { + /** + * Id to use when querying for status for a particular purge operation. + */ + @JsonProperty(value = "operationId", required = true) + private String operationId; + + /** + * Get id to use when querying for status for a particular purge operation. + * + * @return the operationId value + */ + public String operationId() { + return this.operationId; + } + + /** + * Set id to use when querying for status for a particular purge operation. + * + * @param operationId the operationId value to set + * @return the WorkspacePurgeResponseInner object itself. + */ + public WorkspacePurgeResponseInner withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseImpl.java new file mode 100644 index 0000000000000..6995b3e748da6 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2015_03_20.PurgeState; + +class WorkspacePurgeStatusResponseImpl extends WrapperImpl implements WorkspacePurgeStatusResponse { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + + WorkspacePurgeStatusResponseImpl(WorkspacePurgeStatusResponseInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public PurgeState status() { + return this.inner().status(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseInner.java new file mode 100644 index 0000000000000..7ce3ce79991f8 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacePurgeStatusResponseInner.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.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.management.loganalytics.v2015_03_20.PurgeState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response containing status for a specific purge operation. + */ +public class WorkspacePurgeStatusResponseInner { + /** + * Status of the operation represented by the requested Id. Possible values + * include: 'pending', 'completed'. + */ + @JsonProperty(value = "status", required = true) + private PurgeState status; + + /** + * Get status of the operation represented by the requested Id. Possible values include: 'pending', 'completed'. + * + * @return the status value + */ + public PurgeState status() { + return this.status; + } + + /** + * Set status of the operation represented by the requested Id. Possible values include: 'pending', 'completed'. + * + * @param status the status value to set + * @return the WorkspacePurgeStatusResponseInner object itself. + */ + public WorkspacePurgeStatusResponseInner withStatus(PurgeState status) { + this.status = status; + return this; + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.java new file mode 100644 index 0000000000000..6edd662bb152e --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesImpl.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. + * abc + */ + +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeStatusResponse; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchGetSchemaResponse; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchResultsResponse; +import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeResponse; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SharedKeys; +import com.microsoft.azure.management.loganalytics.v2015_03_20.LinkTarget; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchParameters; +import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeBody; +import rx.Completable; + +class WorkspacesImpl extends WrapperImpl implements Workspaces { + private final LogAnalyticsManager manager; + + WorkspacesImpl(LogAnalyticsManager manager) { + super(manager.inner().workspaces()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private WorkspacePurgeStatusResponseImpl wrapWorkspacePurgeStatusResponseModel(WorkspacePurgeStatusResponseInner inner) { + return new WorkspacePurgeStatusResponseImpl(inner, manager()); + } + + private Observable getWorkspacePurgeStatusResponseInnerUsingWorkspacesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String workspaceName = IdParsingUtils.getValueFromIdByName(id, "workspaces"); + WorkspacesInner client = this.inner(); + return client.getPurgeStatusAsync(resourceGroupName, workspaceName); + } + + @Override + public Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName) { + WorkspacesInner client = this.inner(); + return client.getPurgeStatusAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public WorkspacePurgeStatusResponse call(WorkspacePurgeStatusResponseInner inner) { + return wrapWorkspacePurgeStatusResponseModel(inner); + } + }); + } + + @Override + public Observable getSchemaAsync(String resourceGroupName, String workspaceName) { + WorkspacesInner client = this.inner(); + return client.getSchemaAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SearchGetSchemaResponse call(SearchGetSchemaResponseInner inner) { + return new SearchGetSchemaResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { + WorkspacesInner client = this.inner(); + return client.getSearchResultsAsync(resourceGroupName, workspaceName, parameters) + .map(new Func1() { + @Override + public SearchResultsResponse call(SearchResultsResponseInner inner) { + return new SearchResultsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id) { + WorkspacesInner client = this.inner(); + return client.updateSearchResultsAsync(resourceGroupName, workspaceName, id) + .map(new Func1() { + @Override + public SearchResultsResponse call(SearchResultsResponseInner inner) { + return new SearchResultsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + WorkspacesInner client = this.inner(); + return client.purgeAsync(resourceGroupName, workspaceName, body) + .map(new Func1() { + @Override + public WorkspacePurgeResponse call(WorkspacePurgeResponseInner inner) { + return new WorkspacePurgeResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String workspaceName) { + WorkspacesInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SharedKeys call(SharedKeysInner inner) { + return new SharedKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateSharedKeysAsync(String resourceGroupName, String workspaceName) { + WorkspacesInner client = this.inner(); + return client.regenerateSharedKeysAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SharedKeys call(SharedKeysInner inner) { + return new SharedKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + WorkspacesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public LinkTarget call(LinkTargetInner inner) { + return new LinkTargetImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteGatewaysAsync(String resourceGroupName, String workspaceName, String gatewayId) { + WorkspacesInner client = this.inner(); + return client.deleteGatewaysAsync(resourceGroupName, workspaceName, gatewayId).toCompletable(); + } + +} diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java new file mode 100644 index 0000000000000..d6ad5964f8db8 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/WorkspacesInner.java @@ -0,0 +1,986 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.loganalytics.v2015_03_20.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.loganalytics.v2015_03_20.SearchParameters; +import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacePurgeBody; +import com.microsoft.azure.management.loganalytics.v2015_03_20.WorkspacesPurgeHeaders; +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.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Workspaces. + */ +public class WorkspacesInner { + /** The Retrofit service to perform REST calls. */ + private WorkspacesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkspacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkspacesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(WorkspacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Workspaces to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkspacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2015_03_20.Workspaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/linkTargets") + 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.loganalytics.v2015_03_20.Workspaces getSchema" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema") + Observable> getSchema(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2015_03_20.Workspaces getSearchResults" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search") + Observable> getSearchResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Body SearchParameters 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.loganalytics.v2015_03_20.Workspaces beginGetSearchResults" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search") + Observable> beginGetSearchResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Body SearchParameters 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.loganalytics.v2015_03_20.Workspaces updateSearchResults" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search/{id}") + Observable> updateSearchResults(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("id") String id, @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.loganalytics.v2015_03_20.Workspaces purge" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge") + Observable> purge(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Body WorkspacePurgeBody body, @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.loganalytics.v2015_03_20.Workspaces getPurgeStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}") + Observable> getPurgeStatus(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("workspaceName") String workspaceName, @Path("purgeId") String purgeId, @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.loganalytics.v2015_03_20.Workspaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/listKeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2015_03_20.Workspaces regenerateSharedKeys" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey") + Observable> regenerateSharedKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2015_03_20.Workspaces deleteGateways" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}", method = "DELETE", hasBody = true) + Observable> deleteGateways(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("gatewayId") String gatewayId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of workspaces which the current user has administrator privileges and are not associated with an Azure Subscription. The subscriptionId parameter in the Url is ignored. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Get a list of workspaces which the current user has administrator privileges and are not associated with an Azure Subscription. The subscriptionId parameter in the Url is ignored. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a list of workspaces which the current user has administrator privileges and are not associated with an Azure Subscription. The subscriptionId parameter in the Url is ignored. + * + * @return the observable to the List<LinkTargetInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Get a list of workspaces which the current user has administrator privileges and are not associated with an Azure Subscription. The subscriptionId parameter in the Url is ignored. + * + * @return the observable to the List<LinkTargetInner> 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); + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 SearchGetSchemaResponseInner object if successful. + */ + public SearchGetSchemaResponseInner getSchema(String resourceGroupName, String workspaceName) { + return getSchemaWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 getSchemaAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSchemaWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchGetSchemaResponseInner object + */ + public Observable getSchemaAsync(String resourceGroupName, String workspaceName) { + return getSchemaWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SearchGetSchemaResponseInner>() { + @Override + public SearchGetSchemaResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchGetSchemaResponseInner object + */ + public Observable> getSchemaWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.getSchema(resourceGroupName, workspaceName, 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 = getSchemaDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSchemaDelegate(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); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @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 SearchResultsResponseInner object if successful. + */ + public SearchResultsResponseInner getSearchResults(String resourceGroupName, String workspaceName, SearchParameters parameters) { + return getSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).toBlocking().last().body(); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @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 getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable getSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { + return getSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).map(new Func1, SearchResultsResponseInner>() { + @Override + public SearchResultsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> getSearchResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.getSearchResults(resourceGroupName, workspaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @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 SearchResultsResponseInner object if successful. + */ + public SearchResultsResponseInner beginGetSearchResults(String resourceGroupName, String workspaceName, SearchParameters parameters) { + return beginGetSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).toBlocking().single().body(); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @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 beginGetSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGetSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResultsResponseInner object + */ + public Observable beginGetSearchResultsAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { + return beginGetSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).map(new Func1, SearchResultsResponseInner>() { + @Override + public SearchResultsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submit a search for a given workspace. The response will contain an id to track the search. User can use the id to poll the search status and get the full search result later if the search takes long time to finish. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param parameters The parameters required to execute a search query. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResultsResponseInner object + */ + public Observable> beginGetSearchResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, SearchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.beginGetSearchResults(resourceGroupName, workspaceName, 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 = beginGetSearchResultsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGetSearchResultsDelegate(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); + } + + /** + * Gets updated search results for a given search query. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. + * @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 SearchResultsResponseInner object if successful. + */ + public SearchResultsResponseInner updateSearchResults(String resourceGroupName, String workspaceName, String id) { + return updateSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, id).toBlocking().single().body(); + } + + /** + * Gets updated search results for a given search query. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. + * @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 updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, id), serviceCallback); + } + + /** + * Gets updated search results for a given search query. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResultsResponseInner object + */ + public Observable updateSearchResultsAsync(String resourceGroupName, String workspaceName, String id) { + return updateSearchResultsWithServiceResponseAsync(resourceGroupName, workspaceName, id).map(new Func1, SearchResultsResponseInner>() { + @Override + public SearchResultsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets updated search results for a given search query. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param id The id of the search that will have results updated. You can get the id from the response of the GetResults call. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResultsResponseInner object + */ + public Observable> updateSearchResultsWithServiceResponseAsync(String resourceGroupName, String workspaceName, String id) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (id == null) { + throw new IllegalArgumentException("Parameter id 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.updateSearchResults(resourceGroupName, workspaceName, id, 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 = updateSearchResultsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateSearchResultsDelegate(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); + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @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 WorkspacePurgeResponseInner object if successful. + */ + public WorkspacePurgeResponseInner purge(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + return purgeWithServiceResponseAsync(resourceGroupName, workspaceName, body).toBlocking().single().body(); + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @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 purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(purgeWithServiceResponseAsync(resourceGroupName, workspaceName, body), serviceCallback); + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeResponseInner object + */ + public Observable purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + return purgeWithServiceResponseAsync(resourceGroupName, workspaceName, body).map(new Func1, WorkspacePurgeResponseInner>() { + @Override + public WorkspacePurgeResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeResponseInner object + */ + public Observable> purgeWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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 (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.purge(resourceGroupName, this.client.subscriptionId(), workspaceName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = purgeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders purgeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, WorkspacesPurgeHeaders.class); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 WorkspacePurgeStatusResponseInner object if successful. + */ + public WorkspacePurgeStatusResponseInner getPurgeStatus(String resourceGroupName, String workspaceName) { + return getPurgeStatusWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 getPurgeStatusAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPurgeStatusWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeStatusResponseInner object + */ + public Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName) { + return getPurgeStatusWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, WorkspacePurgeStatusResponseInner>() { + @Override + public WorkspacePurgeStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeStatusResponseInner object + */ + public Observable> getPurgeStatusWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.purgeId() == null) { + throw new IllegalArgumentException("Parameter this.client.purgeId() 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.getPurgeStatus(resourceGroupName, this.client.subscriptionId(), workspaceName, this.client.purgeId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPurgeStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPurgeStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 SharedKeysInner object if successful. + */ + public SharedKeysInner listKeys(String resourceGroupName, String workspaceName) { + return listKeysWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 listKeysAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable listKeysAsync(String resourceGroupName, String workspaceName) { + return listKeysWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SharedKeysInner>() { + @Override + public SharedKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.listKeys(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(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); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 SharedKeysInner object if successful. + */ + public SharedKeysInner regenerateSharedKeys(String resourceGroupName, String workspaceName) { + return regenerateSharedKeysWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace 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 regenerateSharedKeysAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateSharedKeysWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable regenerateSharedKeysAsync(String resourceGroupName, String workspaceName) { + return regenerateSharedKeysWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SharedKeysInner>() { + @Override + public SharedKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable> regenerateSharedKeysWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.regenerateSharedKeys(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateSharedKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateSharedKeysDelegate(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); + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param gatewayId The Log Analytics gateway Id. + * @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 deleteGateways(String resourceGroupName, String workspaceName, String gatewayId) { + deleteGatewaysWithServiceResponseAsync(resourceGroupName, workspaceName, gatewayId).toBlocking().single().body(); + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param gatewayId The Log Analytics gateway Id. + * @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 deleteGatewaysAsync(String resourceGroupName, String workspaceName, String gatewayId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteGatewaysWithServiceResponseAsync(resourceGroupName, workspaceName, gatewayId), serviceCallback); + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param gatewayId The Log Analytics gateway Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteGatewaysAsync(String resourceGroupName, String workspaceName, String gatewayId) { + return deleteGatewaysWithServiceResponseAsync(resourceGroupName, workspaceName, gatewayId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The Resource Group name. + * @param workspaceName The Log Analytics Workspace name. + * @param gatewayId The Log Analytics gateway Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteGatewaysWithServiceResponseAsync(String resourceGroupName, String workspaceName, String gatewayId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (gatewayId == null) { + throw new IllegalArgumentException("Parameter gatewayId 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.deleteGateways(this.client.subscriptionId(), resourceGroupName, workspaceName, gatewayId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteGatewaysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteGatewaysDelegate(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/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/package-info.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/implementation/package-info.java new file mode 100644 index 0000000000000..e3c65bca62331 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/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 OperationalInsightsManagementClient. + * Operational Insights Client. + */ +package com.microsoft.azure.management.loganalytics.v2015_03_20.implementation; diff --git a/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/package-info.java b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/package-info.java new file mode 100644 index 0000000000000..f0cfb2427b5f3 --- /dev/null +++ b/loganalytics/resource-manager/v2015_03_20/src/main/java/com/microsoft/azure/management/loganalytics/v2015_03_20/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 OperationalInsightsManagementClient. + * Operational Insights Client. + */ +package com.microsoft.azure.management.loganalytics.v2015_03_20;