diff --git a/applicationinsights/resource-manager/v2015_05_01/pom.xml b/applicationinsights/resource-manager/v2015_05_01/pom.xml new file mode 100644 index 000000000000..8f9418956b9a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.applicationinsights.v2015_05_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-insights + 1.0.0-beta + jar + Microsoft Azure SDK for Insights Management + This package contains Microsoft Insights Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/APIKeyRequest.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/APIKeyRequest.java new file mode 100644 index 000000000000..5ec8d23280e3 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/APIKeyRequest.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component API Key creation request definition. + */ +public class APIKeyRequest { + /** + * The name of the API Key. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The read access rights of this API Key. + */ + @JsonProperty(value = "linkedReadProperties") + private List linkedReadProperties; + + /** + * The write access rights of this API Key. + */ + @JsonProperty(value = "linkedWriteProperties") + private List linkedWriteProperties; + + /** + * Get the name of the API Key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the API Key. + * + * @param name the name value to set + * @return the APIKeyRequest object itself. + */ + public APIKeyRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the read access rights of this API Key. + * + * @return the linkedReadProperties value + */ + public List linkedReadProperties() { + return this.linkedReadProperties; + } + + /** + * Set the read access rights of this API Key. + * + * @param linkedReadProperties the linkedReadProperties value to set + * @return the APIKeyRequest object itself. + */ + public APIKeyRequest withLinkedReadProperties(List linkedReadProperties) { + this.linkedReadProperties = linkedReadProperties; + return this; + } + + /** + * Get the write access rights of this API Key. + * + * @return the linkedWriteProperties value + */ + public List linkedWriteProperties() { + return this.linkedWriteProperties; + } + + /** + * Set the write access rights of this API Key. + * + * @param linkedWriteProperties the linkedWriteProperties value to set + * @return the APIKeyRequest object itself. + */ + public APIKeyRequest withLinkedWriteProperties(List linkedWriteProperties) { + this.linkedWriteProperties = linkedWriteProperties; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/APIKeys.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/APIKeys.java new file mode 100644 index 000000000000..a3a243df6272 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/APIKeys.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.APIKeysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing APIKeys. + */ +public interface APIKeys extends HasInner { + /** + * Get the API Key for this key id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String keyId); + + /** + * Gets a list of API keys of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + + /** + * Delete an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String keyId); + + /** + * Create an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param aPIKeyProperties Properties that need to be specified to create an API key of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String resourceName, APIKeyRequest aPIKeyProperties); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnalyticsItems.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnalyticsItems.java new file mode 100644 index 000000000000..cb3abbf6a6d2 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnalyticsItems.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentAnalyticsItemInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.AnalyticsItemsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AnalyticsItems. + */ +public interface AnalyticsItems extends HasInner { + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath); + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath); + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties); + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Annotation.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Annotation.java new file mode 100644 index 000000000000..db7bf3729f0a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Annotation.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.AnnotationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import org.joda.time.DateTime; + +/** + * Type representing Annotation. + */ +public interface Annotation extends HasInner, HasManager { + /** + * @return the annotationName value. + */ + String annotationName(); + + /** + * @return the category value. + */ + String category(); + + /** + * @return the eventTime value. + */ + DateTime eventTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the properties value. + */ + String properties(); + + /** + * @return the relatedAnnotation value. + */ + String relatedAnnotation(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnnotationError.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnnotationError.java new file mode 100644 index 000000000000..e5e7fcf492f6 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnnotationError.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error associated with trying to create annotation with Id that already + * exist. + */ +public class AnnotationError { + /** + * Error detail code and explanation. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The innererror property. + */ + @JsonProperty(value = "innererror") + private InnerError innererror; + + /** + * Get error detail code and explanation. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error detail code and explanation. + * + * @param code the code value to set + * @return the AnnotationError object itself. + */ + public AnnotationError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the AnnotationError object itself. + */ + public AnnotationError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the innererror value. + * + * @return the innererror value + */ + public InnerError innererror() { + return this.innererror; + } + + /** + * Set the innererror value. + * + * @param innererror the innererror value to set + * @return the AnnotationError object itself. + */ + public AnnotationError withInnererror(InnerError innererror) { + this.innererror = innererror; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnnotationErrorException.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnnotationErrorException.java new file mode 100644 index 000000000000..28260bec2a99 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/AnnotationErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with AnnotationError information. + */ +public class AnnotationErrorException extends RestException { + /** + * Initializes a new instance of the AnnotationErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public AnnotationErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the AnnotationErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public AnnotationErrorException(final String message, final Response response, final AnnotationError body) { + super(message, response, body); + } + + @Override + public AnnotationError body() { + return (AnnotationError) super.body(); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Annotations.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Annotations.java new file mode 100644 index 000000000000..cf545790539d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Annotations.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.AnnotationInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.AnnotationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Annotations. + */ +public interface Annotations extends HasInner { + /** + * Create an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationProperties Properties that need to be specified to create an annotation of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String resourceName, AnnotationInner annotationProperties); + + /** + * Get the annotation for given id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String annotationId); + + /** + * Gets the list of annotations for a component for given time range. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param start The start time to query from for annotations, cannot be older than 90 days from current date. + * @param end The end time to query for annotations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName, String start, String end); + + /** + * Delete an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String annotationId); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponent.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponent.java new file mode 100644 index 000000000000..65f6452d2f7b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponent.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentInner; + +/** + * Type representing ApplicationInsightsComponent. + */ +public interface ApplicationInsightsComponent extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the appId value. + */ + String appId(); + + /** + * @return the applicationId value. + */ + String applicationId(); + + /** + * @return the applicationType value. + */ + ApplicationType applicationType(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the flowType value. + */ + FlowType flowType(); + + /** + * @return the hockeyAppId value. + */ + String hockeyAppId(); + + /** + * @return the hockeyAppToken value. + */ + String hockeyAppToken(); + + /** + * @return the instrumentationKey value. + */ + String instrumentationKey(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the requestSource value. + */ + RequestSource requestSource(); + + /** + * @return the samplingPercentage value. + */ + Double samplingPercentage(); + + /** + * @return the tenantId value. + */ + String tenantId(); + + /** + * The entirety of the ApplicationInsightsComponent definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithApplicationType, DefinitionStages.WithKind, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationInsightsComponent definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationInsightsComponent definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationInsightsComponent definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the applicationinsightscomponent definition allowing to specify ApplicationType. + */ + interface WithApplicationType { + /** + * Specifies applicationType. + */ + WithKind withApplicationType(ApplicationType applicationType); + } + + /** + * The stage of the applicationinsightscomponent definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the applicationinsightscomponent update allowing to specify FlowType. + */ + interface WithFlowType { + /** + * Specifies flowType. + */ + WithCreate withFlowType(FlowType flowType); + } + + /** + * The stage of the applicationinsightscomponent update allowing to specify HockeyAppId. + */ + interface WithHockeyAppId { + /** + * Specifies hockeyAppId. + */ + WithCreate withHockeyAppId(String hockeyAppId); + } + + /** + * The stage of the applicationinsightscomponent update allowing to specify RequestSource. + */ + interface WithRequestSource { + /** + * Specifies requestSource. + */ + WithCreate withRequestSource(RequestSource requestSource); + } + + /** + * The stage of the applicationinsightscomponent update allowing to specify SamplingPercentage. + */ + interface WithSamplingPercentage { + /** + * Specifies samplingPercentage. + */ + WithCreate withSamplingPercentage(Double samplingPercentage); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithFlowType, DefinitionStages.WithHockeyAppId, DefinitionStages.WithRequestSource, DefinitionStages.WithSamplingPercentage { + } + } + /** + * The template for a ApplicationInsightsComponent update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithFlowType, UpdateStages.WithHockeyAppId, UpdateStages.WithRequestSource, UpdateStages.WithSamplingPercentage { + } + + /** + * Grouping of ApplicationInsightsComponent update stages. + */ + interface UpdateStages { + /** + * The stage of the applicationinsightscomponent {0} allowing to specify FlowType. + */ + interface WithFlowType { + /** + * Specifies flowType. + */ + Update withFlowType(FlowType flowType); + } + + /** + * The stage of the applicationinsightscomponent {0} allowing to specify HockeyAppId. + */ + interface WithHockeyAppId { + /** + * Specifies hockeyAppId. + */ + Update withHockeyAppId(String hockeyAppId); + } + + /** + * The stage of the applicationinsightscomponent {0} allowing to specify RequestSource. + */ + interface WithRequestSource { + /** + * Specifies requestSource. + */ + Update withRequestSource(RequestSource requestSource); + } + + /** + * The stage of the applicationinsightscomponent {0} allowing to specify SamplingPercentage. + */ + interface WithSamplingPercentage { + /** + * Specifies samplingPercentage. + */ + Update withSamplingPercentage(Double samplingPercentage); + } + + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAPIKey.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAPIKey.java new file mode 100644 index 000000000000..d6460c808b81 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAPIKey.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentAPIKeyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import java.util.List; + +/** + * Type representing ApplicationInsightsComponentAPIKey. + */ +public interface ApplicationInsightsComponentAPIKey extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the apiKey value. + */ + String apiKey(); + + /** + * @return the createdDate value. + */ + String createdDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the linkedReadProperties value. + */ + List linkedReadProperties(); + + /** + * @return the linkedWriteProperties value. + */ + List linkedWriteProperties(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAnalyticsItem.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAnalyticsItem.java new file mode 100644 index 000000000000..0d8fafb7de17 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAnalyticsItem.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentAnalyticsItemInner; + +/** + * Type representing ApplicationInsightsComponentAnalyticsItem. + */ +public interface ApplicationInsightsComponentAnalyticsItem extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ApplicationInsightsComponentAnalyticsItemProperties properties(); + + /** + * @return the scope value. + */ + ItemScope scope(); + + /** + * @return the timeCreated value. + */ + String timeCreated(); + + /** + * @return the timeModified value. + */ + String timeModified(); + + /** + * @return the type value. + */ + ItemType type(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAnalyticsItemProperties.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAnalyticsItemProperties.java new file mode 100644 index 000000000000..e9debb271317 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAnalyticsItemProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A set of properties that can be defined in the context of a specific item + * type. Each type may have its own properties. + */ +public class ApplicationInsightsComponentAnalyticsItemProperties { + /** + * A function alias, used when the type of the item is Function. + */ + @JsonProperty(value = "functionAlias") + private String functionAlias; + + /** + * Get a function alias, used when the type of the item is Function. + * + * @return the functionAlias value + */ + public String functionAlias() { + return this.functionAlias; + } + + /** + * Set a function alias, used when the type of the item is Function. + * + * @param functionAlias the functionAlias value to set + * @return the ApplicationInsightsComponentAnalyticsItemProperties object itself. + */ + public ApplicationInsightsComponentAnalyticsItemProperties withFunctionAlias(String functionAlias) { + this.functionAlias = functionAlias; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAvailableFeatures.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAvailableFeatures.java new file mode 100644 index 000000000000..efffb0ab4bd9 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentAvailableFeatures.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentAvailableFeaturesInner; +import java.util.List; + +/** + * Type representing ApplicationInsightsComponentAvailableFeatures. + */ +public interface ApplicationInsightsComponentAvailableFeatures extends HasInner, HasManager { + /** + * @return the result value. + */ + List result(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentBillingFeatures.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentBillingFeatures.java new file mode 100644 index 000000000000..984990d8440d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentBillingFeatures.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentBillingFeaturesInner; +import java.util.List; + +/** + * Type representing ApplicationInsightsComponentBillingFeatures. + */ +public interface ApplicationInsightsComponentBillingFeatures extends HasInner, HasManager { + /** + * @return the currentBillingFeatures value. + */ + List currentBillingFeatures(); + + /** + * @return the dataVolumeCap value. + */ + ApplicationInsightsComponentDataVolumeCap dataVolumeCap(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentDataVolumeCap.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentDataVolumeCap.java new file mode 100644 index 000000000000..47da2f3d85b2 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentDataVolumeCap.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component daily data volume cap. + */ +public class ApplicationInsightsComponentDataVolumeCap { + /** + * Daily data volume cap in GB. + */ + @JsonProperty(value = "Cap") + private Double cap; + + /** + * Daily data volume cap UTC reset hour. + */ + @JsonProperty(value = "ResetTime", access = JsonProperty.Access.WRITE_ONLY) + private Integer resetTime; + + /** + * Reserved, not used for now. + */ + @JsonProperty(value = "WarningThreshold") + private Integer warningThreshold; + + /** + * Reserved, not used for now. + */ + @JsonProperty(value = "StopSendNotificationWhenHitThreshold") + private Boolean stopSendNotificationWhenHitThreshold; + + /** + * Do not send a notification email when the daily data volume cap is met. + */ + @JsonProperty(value = "StopSendNotificationWhenHitCap") + private Boolean stopSendNotificationWhenHitCap; + + /** + * Maximum daily data volume cap that the user can set for this component. + */ + @JsonProperty(value = "MaxHistoryCap", access = JsonProperty.Access.WRITE_ONLY) + private Double maxHistoryCap; + + /** + * Get daily data volume cap in GB. + * + * @return the cap value + */ + public Double cap() { + return this.cap; + } + + /** + * Set daily data volume cap in GB. + * + * @param cap the cap value to set + * @return the ApplicationInsightsComponentDataVolumeCap object itself. + */ + public ApplicationInsightsComponentDataVolumeCap withCap(Double cap) { + this.cap = cap; + return this; + } + + /** + * Get daily data volume cap UTC reset hour. + * + * @return the resetTime value + */ + public Integer resetTime() { + return this.resetTime; + } + + /** + * Get reserved, not used for now. + * + * @return the warningThreshold value + */ + public Integer warningThreshold() { + return this.warningThreshold; + } + + /** + * Set reserved, not used for now. + * + * @param warningThreshold the warningThreshold value to set + * @return the ApplicationInsightsComponentDataVolumeCap object itself. + */ + public ApplicationInsightsComponentDataVolumeCap withWarningThreshold(Integer warningThreshold) { + this.warningThreshold = warningThreshold; + return this; + } + + /** + * Get reserved, not used for now. + * + * @return the stopSendNotificationWhenHitThreshold value + */ + public Boolean stopSendNotificationWhenHitThreshold() { + return this.stopSendNotificationWhenHitThreshold; + } + + /** + * Set reserved, not used for now. + * + * @param stopSendNotificationWhenHitThreshold the stopSendNotificationWhenHitThreshold value to set + * @return the ApplicationInsightsComponentDataVolumeCap object itself. + */ + public ApplicationInsightsComponentDataVolumeCap withStopSendNotificationWhenHitThreshold(Boolean stopSendNotificationWhenHitThreshold) { + this.stopSendNotificationWhenHitThreshold = stopSendNotificationWhenHitThreshold; + return this; + } + + /** + * Get do not send a notification email when the daily data volume cap is met. + * + * @return the stopSendNotificationWhenHitCap value + */ + public Boolean stopSendNotificationWhenHitCap() { + return this.stopSendNotificationWhenHitCap; + } + + /** + * Set do not send a notification email when the daily data volume cap is met. + * + * @param stopSendNotificationWhenHitCap the stopSendNotificationWhenHitCap value to set + * @return the ApplicationInsightsComponentDataVolumeCap object itself. + */ + public ApplicationInsightsComponentDataVolumeCap withStopSendNotificationWhenHitCap(Boolean stopSendNotificationWhenHitCap) { + this.stopSendNotificationWhenHitCap = stopSendNotificationWhenHitCap; + return this; + } + + /** + * Get maximum daily data volume cap that the user can set for this component. + * + * @return the maxHistoryCap value + */ + public Double maxHistoryCap() { + return this.maxHistoryCap; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentExportConfiguration.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentExportConfiguration.java new file mode 100644 index 000000000000..79de450ae147 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentExportConfiguration.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentExportConfigurationInner; + +/** + * Type representing ApplicationInsightsComponentExportConfiguration. + */ +public interface ApplicationInsightsComponentExportConfiguration extends HasInner, HasManager { + /** + * @return the applicationName value. + */ + String applicationName(); + + /** + * @return the containerName value. + */ + String containerName(); + + /** + * @return the destinationAccountId value. + */ + String destinationAccountId(); + + /** + * @return the destinationStorageLocationId value. + */ + String destinationStorageLocationId(); + + /** + * @return the destinationStorageSubscriptionId value. + */ + String destinationStorageSubscriptionId(); + + /** + * @return the destinationType value. + */ + String destinationType(); + + /** + * @return the exportId value. + */ + String exportId(); + + /** + * @return the exportStatus value. + */ + String exportStatus(); + + /** + * @return the instrumentationKey value. + */ + String instrumentationKey(); + + /** + * @return the isUserEnabled value. + */ + String isUserEnabled(); + + /** + * @return the lastGapTime value. + */ + String lastGapTime(); + + /** + * @return the lastSuccessTime value. + */ + String lastSuccessTime(); + + /** + * @return the lastUserUpdate value. + */ + String lastUserUpdate(); + + /** + * @return the notificationQueueEnabled value. + */ + String notificationQueueEnabled(); + + /** + * @return the permanentErrorReason value. + */ + String permanentErrorReason(); + + /** + * @return the recordTypes value. + */ + String recordTypes(); + + /** + * @return the resourceGroup value. + */ + String resourceGroup(); + + /** + * @return the storageName value. + */ + String storageName(); + + /** + * @return the subscriptionId value. + */ + String subscriptionId(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentExportRequest.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentExportRequest.java new file mode 100644 index 000000000000..4434b7d6c2e6 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentExportRequest.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component Continuous Export configuration request + * definition. + */ +public class ApplicationInsightsComponentExportRequest { + /** + * The document types to be exported, as comma separated values. Allowed + * values include 'Requests', 'Event', 'Exceptions', 'Metrics', + * 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', + * 'Availability', 'Messages'. + */ + @JsonProperty(value = "RecordTypes") + private String recordTypes; + + /** + * The Continuous Export destination type. This has to be 'Blob'. + */ + @JsonProperty(value = "DestinationType") + private String destinationType; + + /** + * The SAS URL for the destination storage container. It must grant write + * permission. + */ + @JsonProperty(value = "DestinationAddress") + private String destinationAddress; + + /** + * Set to 'true' to create a Continuous Export configuration as enabled, + * otherwise set it to 'false'. + */ + @JsonProperty(value = "IsEnabled") + private String isEnabled; + + /** + * Deprecated. + */ + @JsonProperty(value = "NotificationQueueEnabled") + private String notificationQueueEnabled; + + /** + * Deprecated. + */ + @JsonProperty(value = "NotificationQueueUri") + private String notificationQueueUri; + + /** + * The subscription ID of the destination storage container. + */ + @JsonProperty(value = "DestinationStorageSubscriptionId") + private String destinationStorageSubscriptionId; + + /** + * The location ID of the destination storage container. + */ + @JsonProperty(value = "DestinationStorageLocationId") + private String destinationStorageLocationId; + + /** + * The name of destination storage account. + */ + @JsonProperty(value = "DestinationAccountId") + private String destinationAccountId; + + /** + * Get the document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + * + * @return the recordTypes value + */ + public String recordTypes() { + return this.recordTypes; + } + + /** + * Set the document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + * + * @param recordTypes the recordTypes value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withRecordTypes(String recordTypes) { + this.recordTypes = recordTypes; + return this; + } + + /** + * Get the Continuous Export destination type. This has to be 'Blob'. + * + * @return the destinationType value + */ + public String destinationType() { + return this.destinationType; + } + + /** + * Set the Continuous Export destination type. This has to be 'Blob'. + * + * @param destinationType the destinationType value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withDestinationType(String destinationType) { + this.destinationType = destinationType; + return this; + } + + /** + * Get the SAS URL for the destination storage container. It must grant write permission. + * + * @return the destinationAddress value + */ + public String destinationAddress() { + return this.destinationAddress; + } + + /** + * Set the SAS URL for the destination storage container. It must grant write permission. + * + * @param destinationAddress the destinationAddress value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + return this; + } + + /** + * Get set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + * + * @return the isEnabled value + */ + public String isEnabled() { + return this.isEnabled; + } + + /** + * Set set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + * + * @param isEnabled the isEnabled value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withIsEnabled(String isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get deprecated. + * + * @return the notificationQueueEnabled value + */ + public String notificationQueueEnabled() { + return this.notificationQueueEnabled; + } + + /** + * Set deprecated. + * + * @param notificationQueueEnabled the notificationQueueEnabled value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withNotificationQueueEnabled(String notificationQueueEnabled) { + this.notificationQueueEnabled = notificationQueueEnabled; + return this; + } + + /** + * Get deprecated. + * + * @return the notificationQueueUri value + */ + public String notificationQueueUri() { + return this.notificationQueueUri; + } + + /** + * Set deprecated. + * + * @param notificationQueueUri the notificationQueueUri value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withNotificationQueueUri(String notificationQueueUri) { + this.notificationQueueUri = notificationQueueUri; + return this; + } + + /** + * Get the subscription ID of the destination storage container. + * + * @return the destinationStorageSubscriptionId value + */ + public String destinationStorageSubscriptionId() { + return this.destinationStorageSubscriptionId; + } + + /** + * Set the subscription ID of the destination storage container. + * + * @param destinationStorageSubscriptionId the destinationStorageSubscriptionId value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withDestinationStorageSubscriptionId(String destinationStorageSubscriptionId) { + this.destinationStorageSubscriptionId = destinationStorageSubscriptionId; + return this; + } + + /** + * Get the location ID of the destination storage container. + * + * @return the destinationStorageLocationId value + */ + public String destinationStorageLocationId() { + return this.destinationStorageLocationId; + } + + /** + * Set the location ID of the destination storage container. + * + * @param destinationStorageLocationId the destinationStorageLocationId value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withDestinationStorageLocationId(String destinationStorageLocationId) { + this.destinationStorageLocationId = destinationStorageLocationId; + return this; + } + + /** + * Get the name of destination storage account. + * + * @return the destinationAccountId value + */ + public String destinationAccountId() { + return this.destinationAccountId; + } + + /** + * Set the name of destination storage account. + * + * @param destinationAccountId the destinationAccountId value to set + * @return the ApplicationInsightsComponentExportRequest object itself. + */ + public ApplicationInsightsComponentExportRequest withDestinationAccountId(String destinationAccountId) { + this.destinationAccountId = destinationAccountId; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFavorite.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFavorite.java new file mode 100644 index 000000000000..83fb566013bd --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFavorite.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentFavoriteInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import java.util.List; + +/** + * Type representing ApplicationInsightsComponentFavorite. + */ +public interface ApplicationInsightsComponentFavorite extends HasInner, Indexable, HasManager { + /** + * @return the category value. + */ + String category(); + + /** + * @return the config value. + */ + String config(); + + /** + * @return the favoriteId value. + */ + String favoriteId(); + + /** + * @return the favoriteType value. + */ + FavoriteType favoriteType(); + + /** + * @return the isGeneratedFromTemplate value. + */ + Boolean isGeneratedFromTemplate(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sourceType value. + */ + String sourceType(); + + /** + * @return the tags value. + */ + List tags(); + + /** + * @return the timeModified value. + */ + String timeModified(); + + /** + * @return the userId value. + */ + String userId(); + + /** + * @return the version value. + */ + String version(); + + /** + * The entirety of the ApplicationInsightsComponentFavorite definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithComponent, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationInsightsComponentFavorite definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationInsightsComponentFavorite definition. + */ + interface Blank extends WithComponent { + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify Component. + */ + interface WithComponent { + /** + * Specifies resourceGroupName, resourceName. + */ + WithCreate withExistingComponent(String resourceGroupName, String resourceName); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify Category. + */ + interface WithCategory { + /** + * Specifies category. + */ + WithCreate withCategory(String category); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify Config. + */ + interface WithConfig { + /** + * Specifies config. + */ + WithCreate withConfig(String config); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify FavoriteType. + */ + interface WithFavoriteType { + /** + * Specifies favoriteType. + */ + WithCreate withFavoriteType(FavoriteType favoriteType); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify IsGeneratedFromTemplate. + */ + interface WithIsGeneratedFromTemplate { + /** + * Specifies isGeneratedFromTemplate. + */ + WithCreate withIsGeneratedFromTemplate(Boolean isGeneratedFromTemplate); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify SourceType. + */ + interface WithSourceType { + /** + * Specifies sourceType. + */ + WithCreate withSourceType(String sourceType); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(List tags); + } + + /** + * The stage of the applicationinsightscomponentfavorite definition allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + */ + WithCreate withVersion(String 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.WithCategory, DefinitionStages.WithConfig, DefinitionStages.WithFavoriteType, DefinitionStages.WithIsGeneratedFromTemplate, DefinitionStages.WithName, DefinitionStages.WithSourceType, DefinitionStages.WithTags, DefinitionStages.WithVersion { + } + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeature.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeature.java new file mode 100644 index 000000000000..c8c8238ba4e7 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeature.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component daily data volume cap status. + */ +public class ApplicationInsightsComponentFeature { + /** + * The pricing feature name. + */ + @JsonProperty(value = "FeatureName", access = JsonProperty.Access.WRITE_ONLY) + private String featureName; + + /** + * The meter id used for the feature. + */ + @JsonProperty(value = "MeterId", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /** + * The meter rate for the feature's meter. + */ + @JsonProperty(value = "MeterRateFrequency", access = JsonProperty.Access.WRITE_ONLY) + private String meterRateFrequency; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "ResouceId", access = JsonProperty.Access.WRITE_ONLY) + private String resouceId; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "IsHidden", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isHidden; + + /** + * A list of Application Insights component feature capability. + */ + @JsonProperty(value = "Capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * Display name of the feature. + */ + @JsonProperty(value = "Title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /** + * Whether can apply addon feature on to it. + */ + @JsonProperty(value = "IsMainFeature", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isMainFeature; + + /** + * The add on features on main feature. + */ + @JsonProperty(value = "SupportedAddonFeatures", access = JsonProperty.Access.WRITE_ONLY) + private String supportedAddonFeatures; + + /** + * Get the pricing feature name. + * + * @return the featureName value + */ + public String featureName() { + return this.featureName; + } + + /** + * Get the meter id used for the feature. + * + * @return the meterId value + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the meter rate for the feature's meter. + * + * @return the meterRateFrequency value + */ + public String meterRateFrequency() { + return this.meterRateFrequency; + } + + /** + * Get reserved, not used now. + * + * @return the resouceId value + */ + public String resouceId() { + return this.resouceId; + } + + /** + * Get reserved, not used now. + * + * @return the isHidden value + */ + public Boolean isHidden() { + return this.isHidden; + } + + /** + * Get a list of Application Insights component feature capability. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get display name of the feature. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Get whether can apply addon feature on to it. + * + * @return the isMainFeature value + */ + public Boolean isMainFeature() { + return this.isMainFeature; + } + + /** + * Get the add on features on main feature. + * + * @return the supportedAddonFeatures value + */ + public String supportedAddonFeatures() { + return this.supportedAddonFeatures; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeatureCapabilities.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeatureCapabilities.java new file mode 100644 index 000000000000..1a586aa20626 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeatureCapabilities.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentFeatureCapabilitiesInner; + +/** + * Type representing ApplicationInsightsComponentFeatureCapabilities. + */ +public interface ApplicationInsightsComponentFeatureCapabilities extends HasInner, HasManager { + /** + * @return the analyticsIntegration value. + */ + Boolean analyticsIntegration(); + + /** + * @return the apiAccessLevel value. + */ + String apiAccessLevel(); + + /** + * @return the applicationMap value. + */ + Boolean applicationMap(); + + /** + * @return the burstThrottlePolicy value. + */ + String burstThrottlePolicy(); + + /** + * @return the dailyCap value. + */ + Double dailyCap(); + + /** + * @return the dailyCapResetTime value. + */ + Double dailyCapResetTime(); + + /** + * @return the liveStreamMetrics value. + */ + Boolean liveStreamMetrics(); + + /** + * @return the metadataClass value. + */ + String metadataClass(); + + /** + * @return the multipleStepWebTest value. + */ + Boolean multipleStepWebTest(); + + /** + * @return the openSchema value. + */ + Boolean openSchema(); + + /** + * @return the powerBIIntegration value. + */ + Boolean powerBIIntegration(); + + /** + * @return the proactiveDetection value. + */ + Boolean proactiveDetection(); + + /** + * @return the supportExportData value. + */ + Boolean supportExportData(); + + /** + * @return the throttleRate value. + */ + Double throttleRate(); + + /** + * @return the trackingType value. + */ + String trackingType(); + + /** + * @return the workItemIntegration value. + */ + Boolean workItemIntegration(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeatureCapability.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeatureCapability.java new file mode 100644 index 000000000000..7a953b25444a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentFeatureCapability.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component feature capability. + */ +public class ApplicationInsightsComponentFeatureCapability { + /** + * The name of the capability. + */ + @JsonProperty(value = "Name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The description of the capability. + */ + @JsonProperty(value = "Description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The value of the capability. + */ + @JsonProperty(value = "Value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The unit of the capability. + */ + @JsonProperty(value = "Unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * The meter used for the capability. + */ + @JsonProperty(value = "MeterId", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /** + * The meter rate of the meter. + */ + @JsonProperty(value = "MeterRateFrequency", access = JsonProperty.Access.WRITE_ONLY) + private String meterRateFrequency; + + /** + * Get the name of the capability. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the description of the capability. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the value of the capability. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the unit of the capability. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the meter used for the capability. + * + * @return the meterId value + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the meter rate of the meter. + * + * @return the meterRateFrequency value + */ + public String meterRateFrequency() { + return this.meterRateFrequency; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentProactiveDetectionConfiguration.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentProactiveDetectionConfiguration.java new file mode 100644 index 000000000000..4117158b657e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentProactiveDetectionConfiguration.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentProactiveDetectionConfigurationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import java.util.List; + +/** + * Type representing ApplicationInsightsComponentProactiveDetectionConfiguration. + */ +public interface ApplicationInsightsComponentProactiveDetectionConfiguration extends HasInner, HasManager { + /** + * @return the customEmails value. + */ + List customEmails(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the lastUpdatedTime value. + */ + String lastUpdatedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the ruleDefinitions value. + */ + ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions ruleDefinitions(); + + /** + * @return the sendEmailsToSubscriptionOwners value. + */ + Boolean sendEmailsToSubscriptionOwners(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.java new file mode 100644 index 000000000000..2c05678ea249 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Static definitions of the ProactiveDetection configuration rule (same values + * for all components). + */ +public class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions { + /** + * The rule name. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The rule name as it is displayed in UI. + */ + @JsonProperty(value = "DisplayName") + private String displayName; + + /** + * The rule description. + */ + @JsonProperty(value = "Description") + private String description; + + /** + * URL which displays additional info about the proactive detection rule. + */ + @JsonProperty(value = "HelpUrl") + private String helpUrl; + + /** + * A flag indicating whether the rule is hidden (from the UI). + */ + @JsonProperty(value = "IsHidden") + private Boolean isHidden; + + /** + * A flag indicating whether the rule is enabled by default. + */ + @JsonProperty(value = "IsEnabledByDefault") + private Boolean isEnabledByDefault; + + /** + * A flag indicating whether the rule is in preview. + */ + @JsonProperty(value = "IsInPreview") + private Boolean isInPreview; + + /** + * A flag indicating whether email notifications are supported for + * detections for this rule. + */ + @JsonProperty(value = "SupportsEmailNotifications") + private Boolean supportsEmailNotifications; + + /** + * Get the rule name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the rule name. + * + * @param name the name value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withName(String name) { + this.name = name; + return this; + } + + /** + * Get the rule name as it is displayed in UI. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the rule name as it is displayed in UI. + * + * @param displayName the displayName value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the rule description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the rule description. + * + * @param description the description value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get uRL which displays additional info about the proactive detection rule. + * + * @return the helpUrl value + */ + public String helpUrl() { + return this.helpUrl; + } + + /** + * Set uRL which displays additional info about the proactive detection rule. + * + * @param helpUrl the helpUrl value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withHelpUrl(String helpUrl) { + this.helpUrl = helpUrl; + return this; + } + + /** + * Get a flag indicating whether the rule is hidden (from the UI). + * + * @return the isHidden value + */ + public Boolean isHidden() { + return this.isHidden; + } + + /** + * Set a flag indicating whether the rule is hidden (from the UI). + * + * @param isHidden the isHidden value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withIsHidden(Boolean isHidden) { + this.isHidden = isHidden; + return this; + } + + /** + * Get a flag indicating whether the rule is enabled by default. + * + * @return the isEnabledByDefault value + */ + public Boolean isEnabledByDefault() { + return this.isEnabledByDefault; + } + + /** + * Set a flag indicating whether the rule is enabled by default. + * + * @param isEnabledByDefault the isEnabledByDefault value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withIsEnabledByDefault(Boolean isEnabledByDefault) { + this.isEnabledByDefault = isEnabledByDefault; + return this; + } + + /** + * Get a flag indicating whether the rule is in preview. + * + * @return the isInPreview value + */ + public Boolean isInPreview() { + return this.isInPreview; + } + + /** + * Set a flag indicating whether the rule is in preview. + * + * @param isInPreview the isInPreview value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withIsInPreview(Boolean isInPreview) { + this.isInPreview = isInPreview; + return this; + } + + /** + * Get a flag indicating whether email notifications are supported for detections for this rule. + * + * @return the supportsEmailNotifications value + */ + public Boolean supportsEmailNotifications() { + return this.supportsEmailNotifications; + } + + /** + * Set a flag indicating whether email notifications are supported for detections for this rule. + * + * @param supportsEmailNotifications the supportsEmailNotifications value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions withSupportsEmailNotifications(Boolean supportsEmailNotifications) { + this.supportsEmailNotifications = supportsEmailNotifications; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentQuotaStatus.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentQuotaStatus.java new file mode 100644 index 000000000000..36fada2ab618 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentQuotaStatus.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentQuotaStatusInner; + +/** + * Type representing ApplicationInsightsComponentQuotaStatus. + */ +public interface ApplicationInsightsComponentQuotaStatus extends HasInner, HasManager { + /** + * @return the appId value. + */ + String appId(); + + /** + * @return the expirationTime value. + */ + String expirationTime(); + + /** + * @return the shouldBeThrottled value. + */ + Boolean shouldBeThrottled(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentWebTestLocation.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentWebTestLocation.java new file mode 100644 index 000000000000..107d5d1b07fc --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationInsightsComponentWebTestLocation.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentWebTestLocationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; + +/** + * Type representing ApplicationInsightsComponentWebTestLocation. + */ +public interface ApplicationInsightsComponentWebTestLocation extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the tag value. + */ + String tag(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationType.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationType.java new file mode 100644 index 000000000000..52d4299cf92f --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ApplicationType.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.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationType. + */ +public final class ApplicationType extends ExpandableStringEnum { + /** Static value web for ApplicationType. */ + public static final ApplicationType WEB = fromString("web"); + + /** Static value other for ApplicationType. */ + public static final ApplicationType OTHER = fromString("other"); + + /** + * Creates or finds a ApplicationType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationType + */ + @JsonCreator + public static ApplicationType fromString(String name) { + return fromString(name, ApplicationType.class); + } + + /** + * @return known ApplicationType values + */ + public static Collection values() { + return values(ApplicationType.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/CategoryType.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/CategoryType.java new file mode 100644 index 000000000000..de7c92922167 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/CategoryType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CategoryType. + */ +public final class CategoryType extends ExpandableStringEnum { + /** Static value workbook for CategoryType. */ + public static final CategoryType WORKBOOK = fromString("workbook"); + + /** Static value TSG for CategoryType. */ + public static final CategoryType TSG = fromString("TSG"); + + /** Static value performance for CategoryType. */ + public static final CategoryType PERFORMANCE = fromString("performance"); + + /** Static value retention for CategoryType. */ + public static final CategoryType RETENTION = fromString("retention"); + + /** + * Creates or finds a CategoryType from its string representation. + * @param name a name to look for + * @return the corresponding CategoryType + */ + @JsonCreator + public static CategoryType fromString(String name) { + return fromString(name, CategoryType.class); + } + + /** + * @return known CategoryType values + */ + public static Collection values() { + return values(CategoryType.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentAvailableFeatures.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentAvailableFeatures.java new file mode 100644 index 000000000000..af68a46e6b9c --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentAvailableFeatures.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ComponentAvailableFeaturesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ComponentAvailableFeatures. + */ +public interface ComponentAvailableFeatures extends HasInner { + /** + * Returns all available features of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentCurrentBillingFeatures.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentCurrentBillingFeatures.java new file mode 100644 index 000000000000..62707c2816cd --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentCurrentBillingFeatures.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.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ApplicationInsightsComponentBillingFeaturesInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ComponentCurrentBillingFeaturesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ComponentCurrentBillingFeatures. + */ +public interface ComponentCurrentBillingFeatures extends HasInner { + /** + * Returns current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName); + + /** + * Update current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param billingFeaturesProperties Properties that need to be specified to update billing features for an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentFeatureCapabilities.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentFeatureCapabilities.java new file mode 100644 index 000000000000..6938c748726b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentFeatureCapabilities.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ComponentFeatureCapabilitiesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ComponentFeatureCapabilities. + */ +public interface ComponentFeatureCapabilities extends HasInner { + /** + * Returns feature capabilities of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeBody.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeBody.java new file mode 100644 index 000000000000..db27a6224844 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeBody.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.applicationinsights.v2015_05_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the body of a purge request for an App Insights component. + */ +public class ComponentPurgeBody { + /** + * 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 ComponentPurgeBody object itself. + */ + public ComponentPurgeBody 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 ComponentPurgeBody object itself. + */ + public ComponentPurgeBody withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeBodyFilters.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeBodyFilters.java new file mode 100644 index 000000000000..e84676243cd9 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeBodyFilters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User-defined filters to return data which will be purged from the table. + */ +public class ComponentPurgeBodyFilters { + /** + * 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). + */ + @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 ComponentPurgeBodyFilters object itself. + */ + public ComponentPurgeBodyFilters withColumn(String column) { + this.column = column; + return this; + } + + /** + * Get a query operator to evaluate over the provided column and value(s). + * + * @return the operator value + */ + public String operator() { + return this.operator; + } + + /** + * Set a query operator to evaluate over the provided column and value(s). + * + * @param operator the operator value to set + * @return the ComponentPurgeBodyFilters object itself. + */ + public ComponentPurgeBodyFilters 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 ComponentPurgeBodyFilters object itself. + */ + public ComponentPurgeBodyFilters 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 ComponentPurgeBodyFilters object itself. + */ + public ComponentPurgeBodyFilters withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeResponse.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeResponse.java new file mode 100644 index 000000000000..b9d27cdea88d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeResponse.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ComponentPurgeResponseInner; + +/** + * Type representing ComponentPurgeResponse. + */ +public interface ComponentPurgeResponse extends HasInner, HasManager { + /** + * @return the operationId value. + */ + String operationId(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeStatusResponse.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeStatusResponse.java new file mode 100644 index 000000000000..dd0de19a8802 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentPurgeStatusResponse.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ComponentPurgeStatusResponseInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; + +/** + * Type representing ComponentPurgeStatusResponse. + */ +public interface ComponentPurgeStatusResponse extends HasInner, HasManager { + /** + * @return the status value. + */ + PurgeState status(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentQuotaStatus.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentQuotaStatus.java new file mode 100644 index 000000000000..cd3a82939013 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentQuotaStatus.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ComponentQuotaStatusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ComponentQuotaStatus. + */ +public interface ComponentQuotaStatus extends HasInner { + /** + * Returns daily data volume cap (quota) status for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Components.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Components.java new file mode 100644 index 000000000000..10df03721321 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Components.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ComponentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Components. + */ +public interface Components extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Purges data in an Application Insights component by a set of user-defined filters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param body Describes the body of a request to purge data in a single table of an Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable purgeAsync(String resourceGroupName, String resourceName, ComponentPurgeBody body); + + /** + * Get status for an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPurgeStatusAsync(String resourceGroupName, String resourceName, String purgeId); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentsResource.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentsResource.java new file mode 100644 index 000000000000..88d80df9b937 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ComponentsResource.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.Resource; + +/** + * An azure resource object. + */ +public class ComponentsResource extends Resource { +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorFieldContract.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorFieldContract.java new file mode 100644 index 000000000000..e5d63c1b5782 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorFieldContract.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error Field contract. + */ +public class ErrorFieldContract { + /** + * Property level error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Human-readable representation of property-level error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Property name. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get property level error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set property level error code. + * + * @param code the code value to set + * @return the ErrorFieldContract object itself. + */ + public ErrorFieldContract withCode(String code) { + this.code = code; + return this; + } + + /** + * Get human-readable representation of property-level error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set human-readable representation of property-level error. + * + * @param message the message value to set + * @return the ErrorFieldContract object itself. + */ + public ErrorFieldContract withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get property name. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set property name. + * + * @param target the target value to set + * @return the ErrorFieldContract object itself. + */ + public ErrorFieldContract withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorResponse.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorResponse.java new file mode 100644 index 000000000000..3ccda6b572b7 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorResponse.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates Insights service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorResponseException.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorResponseException.java new file mode 100644 index 000000000000..3f9f5c39eb4f --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ExportConfigurations.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ExportConfigurations.java new file mode 100644 index 000000000000..45bd53095dba --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ExportConfigurations.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.applicationinsights.v2015_05_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ExportConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExportConfigurations. + */ +public interface ExportConfigurations extends HasInner { + /** + * Gets a list of Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + + /** + * Create a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportProperties Properties that need to be specified to create a Continuous Export configuration of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties); + + /** + * Delete a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable deleteAsync(String resourceGroupName, String resourceName, String exportId); + + /** + * Get the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String exportId); + + /** + * Update the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @param exportProperties Properties that need to be specified to update the Continuous Export configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String resourceName, String exportId, ApplicationInsightsComponentExportRequest exportProperties); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FavoriteSourceType.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FavoriteSourceType.java new file mode 100644 index 000000000000..b7fe5822545e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FavoriteSourceType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FavoriteSourceType. + */ +public final class FavoriteSourceType extends ExpandableStringEnum { + /** Static value retention for FavoriteSourceType. */ + public static final FavoriteSourceType RETENTION = fromString("retention"); + + /** Static value notebook for FavoriteSourceType. */ + public static final FavoriteSourceType NOTEBOOK = fromString("notebook"); + + /** Static value sessions for FavoriteSourceType. */ + public static final FavoriteSourceType SESSIONS = fromString("sessions"); + + /** Static value events for FavoriteSourceType. */ + public static final FavoriteSourceType EVENTS = fromString("events"); + + /** Static value userflows for FavoriteSourceType. */ + public static final FavoriteSourceType USERFLOWS = fromString("userflows"); + + /** Static value funnel for FavoriteSourceType. */ + public static final FavoriteSourceType FUNNEL = fromString("funnel"); + + /** Static value impact for FavoriteSourceType. */ + public static final FavoriteSourceType IMPACT = fromString("impact"); + + /** Static value segmentation for FavoriteSourceType. */ + public static final FavoriteSourceType SEGMENTATION = fromString("segmentation"); + + /** + * Creates or finds a FavoriteSourceType from its string representation. + * @param name a name to look for + * @return the corresponding FavoriteSourceType + */ + @JsonCreator + public static FavoriteSourceType fromString(String name) { + return fromString(name, FavoriteSourceType.class); + } + + /** + * @return known FavoriteSourceType values + */ + public static Collection values() { + return values(FavoriteSourceType.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FavoriteType.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FavoriteType.java new file mode 100644 index 000000000000..950ca0f28d4f --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FavoriteType.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FavoriteType. + */ +public enum FavoriteType { + /** Enum value shared. */ + SHARED("shared"), + + /** Enum value user. */ + USER("user"); + + /** The actual serialized value for a FavoriteType instance. */ + private String value; + + FavoriteType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FavoriteType instance. + * + * @param value the serialized value to parse. + * @return the parsed FavoriteType object, or null if unable to parse. + */ + @JsonCreator + public static FavoriteType fromString(String value) { + FavoriteType[] items = FavoriteType.values(); + for (FavoriteType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Favorites.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Favorites.java new file mode 100644 index 000000000000..28cf21d908c7 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Favorites.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.FavoritesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Favorites. + */ +public interface Favorites extends SupportsCreating, HasInner { + /** + * Get a single favorite by its FavoriteId, defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String favoriteId); + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + + /** + * Remove a favorite that is associated to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String favoriteId); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FlowType.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FlowType.java new file mode 100644 index 000000000000..4718be92212c --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/FlowType.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.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FlowType. + */ +public final class FlowType extends ExpandableStringEnum { + /** Static value Bluefield for FlowType. */ + public static final FlowType BLUEFIELD = fromString("Bluefield"); + + /** + * Creates or finds a FlowType from its string representation. + * @param name a name to look for + * @return the corresponding FlowType + */ + @JsonCreator + public static FlowType fromString(String name) { + return fromString(name, FlowType.class); + } + + /** + * @return known FlowType values + */ + public static Collection values() { + return values(FlowType.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/InnerError.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/InnerError.java new file mode 100644 index 000000000000..6c1692f7f31a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/InnerError.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.applicationinsights.v2015_05_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Inner error. + */ +public class InnerError { + /** + * Provides correlation for request. + */ + @JsonProperty(value = "diagnosticcontext") + private String diagnosticcontext; + + /** + * Request time. + */ + @JsonProperty(value = "time") + private DateTime time; + + /** + * Get provides correlation for request. + * + * @return the diagnosticcontext value + */ + public String diagnosticcontext() { + return this.diagnosticcontext; + } + + /** + * Set provides correlation for request. + * + * @param diagnosticcontext the diagnosticcontext value to set + * @return the InnerError object itself. + */ + public InnerError withDiagnosticcontext(String diagnosticcontext) { + this.diagnosticcontext = diagnosticcontext; + return this; + } + + /** + * Get request time. + * + * @return the time value + */ + public DateTime time() { + return this.time; + } + + /** + * Set request time. + * + * @param time the time value to set + * @return the InnerError object itself. + */ + public InnerError withTime(DateTime time) { + this.time = time; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemScope.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemScope.java new file mode 100644 index 000000000000..162fbf919ea5 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemScope.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.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ItemScope. + */ +public final class ItemScope extends ExpandableStringEnum { + /** Static value shared for ItemScope. */ + public static final ItemScope SHARED = fromString("shared"); + + /** Static value user for ItemScope. */ + public static final ItemScope USER = fromString("user"); + + /** + * Creates or finds a ItemScope from its string representation. + * @param name a name to look for + * @return the corresponding ItemScope + */ + @JsonCreator + public static ItemScope fromString(String name) { + return fromString(name, ItemScope.class); + } + + /** + * @return known ItemScope values + */ + public static Collection values() { + return values(ItemScope.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemScopePath.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemScopePath.java new file mode 100644 index 000000000000..9c6f5771ebe2 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemScopePath.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.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ItemScopePath. + */ +public final class ItemScopePath extends ExpandableStringEnum { + /** Static value analyticsItems for ItemScopePath. */ + public static final ItemScopePath ANALYTICS_ITEMS = fromString("analyticsItems"); + + /** Static value myanalyticsItems for ItemScopePath. */ + public static final ItemScopePath MYANALYTICS_ITEMS = fromString("myanalyticsItems"); + + /** + * Creates or finds a ItemScopePath from its string representation. + * @param name a name to look for + * @return the corresponding ItemScopePath + */ + @JsonCreator + public static ItemScopePath fromString(String name) { + return fromString(name, ItemScopePath.class); + } + + /** + * @return known ItemScopePath values + */ + public static Collection values() { + return values(ItemScopePath.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemType.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemType.java new file mode 100644 index 000000000000..a82d11e3c329 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ItemType. + */ +public final class ItemType extends ExpandableStringEnum { + /** Static value query for ItemType. */ + public static final ItemType QUERY = fromString("query"); + + /** Static value function for ItemType. */ + public static final ItemType FUNCTION = fromString("function"); + + /** Static value folder for ItemType. */ + public static final ItemType FOLDER = fromString("folder"); + + /** Static value recent for ItemType. */ + public static final ItemType RECENT = fromString("recent"); + + /** + * Creates or finds a ItemType from its string representation. + * @param name a name to look for + * @return the corresponding ItemType + */ + @JsonCreator + public static ItemType fromString(String name) { + return fromString(name, ItemType.class); + } + + /** + * @return known ItemType values + */ + public static Collection values() { + return values(ItemType.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemTypeParameter.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemTypeParameter.java new file mode 100644 index 000000000000..61b3a7d9b2dc --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ItemTypeParameter.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ItemTypeParameter. + */ +public final class ItemTypeParameter extends ExpandableStringEnum { + /** Static value none for ItemTypeParameter. */ + public static final ItemTypeParameter NONE = fromString("none"); + + /** Static value query for ItemTypeParameter. */ + public static final ItemTypeParameter QUERY = fromString("query"); + + /** Static value function for ItemTypeParameter. */ + public static final ItemTypeParameter FUNCTION = fromString("function"); + + /** Static value folder for ItemTypeParameter. */ + public static final ItemTypeParameter FOLDER = fromString("folder"); + + /** Static value recent for ItemTypeParameter. */ + public static final ItemTypeParameter RECENT = fromString("recent"); + + /** + * Creates or finds a ItemTypeParameter from its string representation. + * @param name a name to look for + * @return the corresponding ItemTypeParameter + */ + @JsonCreator + public static ItemTypeParameter fromString(String name) { + return fromString(name, ItemTypeParameter.class); + } + + /** + * @return known ItemTypeParameter values + */ + public static Collection values() { + return values(ItemTypeParameter.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/LinkProperties.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/LinkProperties.java new file mode 100644 index 000000000000..d994efac5d8e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/LinkProperties.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains a sourceId and workbook resource id to link two resources. + */ +public class LinkProperties { + /** + * The source Azure resource id. + */ + @JsonProperty(value = "sourceId") + private String sourceId; + + /** + * The workbook Azure resource id. + */ + @JsonProperty(value = "targetId") + private String targetId; + + /** + * The category of workbook. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Get the source Azure resource id. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set the source Azure resource id. + * + * @param sourceId the sourceId value to set + * @return the LinkProperties object itself. + */ + public LinkProperties withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get the workbook Azure resource id. + * + * @return the targetId value + */ + public String targetId() { + return this.targetId; + } + + /** + * Set the workbook Azure resource id. + * + * @param targetId the targetId value to set + * @return the LinkProperties object itself. + */ + public LinkProperties withTargetId(String targetId) { + this.targetId = targetId; + return this; + } + + /** + * Get the category of workbook. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category of workbook. + * + * @param category the category value to set + * @return the LinkProperties object itself. + */ + public LinkProperties withCategory(String category) { + this.category = category; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Operation.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Operation.java new file mode 100644 index 000000000000..fc3acc7da62a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Operation.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/OperationDisplay.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/OperationDisplay.java new file mode 100644 index 000000000000..6ebb2e4fe77e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.Cdn. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get service provider: Microsoft.Cdn. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft.Cdn. + * + * @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: Profile, endpoint, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed: Profile, endpoint, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation type: Read, write, 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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Operations.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Operations.java new file mode 100644 index 000000000000..902427138469 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available insights REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ProactiveDetectionConfigurations.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ProactiveDetectionConfigurations.java new file mode 100644 index 000000000000..495f08f0dd11 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/ProactiveDetectionConfigurations.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.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.ProactiveDetectionConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProactiveDetectionConfigurations. + */ +public interface ProactiveDetectionConfigurations extends HasInner { + /** + * Get the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName, String configurationId); + + /** + * Gets a list of ProactiveDetection configurations of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/PurgeState.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/PurgeState.java new file mode 100644 index 000000000000..29b2d4f32681 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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.applicationinsights.v2015_05_01; + +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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/RequestSource.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/RequestSource.java new file mode 100644 index 000000000000..cd5163b32176 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/RequestSource.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.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RequestSource. + */ +public final class RequestSource extends ExpandableStringEnum { + /** Static value rest for RequestSource. */ + public static final RequestSource REST = fromString("rest"); + + /** + * Creates or finds a RequestSource from its string representation. + * @param name a name to look for + * @return the corresponding RequestSource + */ + @JsonCreator + public static RequestSource fromString(String name) { + return fromString(name, RequestSource.class); + } + + /** + * @return known RequestSource values + */ + public static Collection values() { + return values(RequestSource.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/SharedTypeKind.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/SharedTypeKind.java new file mode 100644 index 000000000000..e943a09cd3b7 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/SharedTypeKind.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.applicationinsights.v2015_05_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SharedTypeKind. + */ +public final class SharedTypeKind extends ExpandableStringEnum { + /** Static value user for SharedTypeKind. */ + public static final SharedTypeKind USER = fromString("user"); + + /** Static value shared for SharedTypeKind. */ + public static final SharedTypeKind SHARED = fromString("shared"); + + /** + * Creates or finds a SharedTypeKind from its string representation. + * @param name a name to look for + * @return the corresponding SharedTypeKind + */ + @JsonCreator + public static SharedTypeKind fromString(String name) { + return fromString(name, SharedTypeKind.class); + } + + /** + * @return known SharedTypeKind values + */ + public static Collection values() { + return values(SharedTypeKind.class); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/TagsResource.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/TagsResource.java new file mode 100644 index 000000000000..50704e48e2a4 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/TagsResource.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.applicationinsights.v2015_05_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container holding only the Tags for a resource, allowing the user to + * update the tags on a WebTest instance. + */ +public class TagsResource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 TagsResource object itself. + */ + public TagsResource withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTest.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTest.java new file mode 100644 index 000000000000..f40f224550af --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTest.java @@ -0,0 +1,309 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.WebTestInner; + +/** + * Type representing WebTest. + */ +public interface WebTest extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the configuration value. + */ + WebTestPropertiesConfiguration configuration(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the frequency value. + */ + Integer frequency(); + + /** + * @return the kind value. + */ + WebTestKind kind(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the retryEnabled value. + */ + Boolean retryEnabled(); + + /** + * @return the syntheticMonitorId value. + */ + String syntheticMonitorId(); + + /** + * @return the timeout value. + */ + Integer timeout(); + + /** + * @return the webTestKind value. + */ + WebTestKind webTestKind(); + + /** + * @return the webTestName value. + */ + String webTestName(); + + /** + * The entirety of the WebTest definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithLocations, DefinitionStages.WithSyntheticMonitorId, DefinitionStages.WithWebTestKind, DefinitionStages.WithWebTestName, DefinitionStages.WithCreate { + } + + /** + * Grouping of WebTest definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WebTest definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the WebTest definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the webtest definition allowing to specify Locations. + */ + interface WithLocations { + /** + * Specifies locations. + */ + WithSyntheticMonitorId withLocations(List locations); + } + + /** + * The stage of the webtest definition allowing to specify SyntheticMonitorId. + */ + interface WithSyntheticMonitorId { + /** + * Specifies syntheticMonitorId. + */ + WithWebTestKind withSyntheticMonitorId(String syntheticMonitorId); + } + + /** + * The stage of the webtest definition allowing to specify WebTestKind. + */ + interface WithWebTestKind { + /** + * Specifies webTestKind. + */ + WithWebTestName withWebTestKind(WebTestKind webTestKind); + } + + /** + * The stage of the webtest definition allowing to specify WebTestName. + */ + interface WithWebTestName { + /** + * Specifies webTestName. + */ + WithCreate withWebTestName(String webTestName); + } + + /** + * The stage of the webtest update allowing to specify Configuration. + */ + interface WithConfiguration { + /** + * Specifies configuration. + */ + WithCreate withConfiguration(WebTestPropertiesConfiguration configuration); + } + + /** + * The stage of the webtest update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the webtest update allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the webtest update allowing to specify Frequency. + */ + interface WithFrequency { + /** + * Specifies frequency. + */ + WithCreate withFrequency(Integer frequency); + } + + /** + * The stage of the webtest update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + */ + WithCreate withKind(WebTestKind kind); + } + + /** + * The stage of the webtest update allowing to specify RetryEnabled. + */ + interface WithRetryEnabled { + /** + * Specifies retryEnabled. + */ + WithCreate withRetryEnabled(Boolean retryEnabled); + } + + /** + * The stage of the webtest update allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + */ + WithCreate withTimeout(Integer timeout); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithConfiguration, DefinitionStages.WithDescription, DefinitionStages.WithEnabled, DefinitionStages.WithFrequency, DefinitionStages.WithKind, DefinitionStages.WithRetryEnabled, DefinitionStages.WithTimeout { + } + } + /** + * The template for a WebTest update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithConfiguration, UpdateStages.WithDescription, UpdateStages.WithEnabled, UpdateStages.WithFrequency, UpdateStages.WithKind, UpdateStages.WithRetryEnabled, UpdateStages.WithTimeout { + } + + /** + * Grouping of WebTest update stages. + */ + interface UpdateStages { + /** + * The stage of the webtest {0} allowing to specify Configuration. + */ + interface WithConfiguration { + /** + * Specifies configuration. + */ + Update withConfiguration(WebTestPropertiesConfiguration configuration); + } + + /** + * The stage of the webtest {0} allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + /** + * The stage of the webtest {0} allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + */ + Update withEnabled(Boolean enabled); + } + + /** + * The stage of the webtest {0} allowing to specify Frequency. + */ + interface WithFrequency { + /** + * Specifies frequency. + */ + Update withFrequency(Integer frequency); + } + + /** + * The stage of the webtest {0} allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + */ + Update withKind(WebTestKind kind); + } + + /** + * The stage of the webtest {0} allowing to specify RetryEnabled. + */ + interface WithRetryEnabled { + /** + * Specifies retryEnabled. + */ + Update withRetryEnabled(Boolean retryEnabled); + } + + /** + * The stage of the webtest {0} allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + */ + Update withTimeout(Integer timeout); + } + + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestGeolocation.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestGeolocation.java new file mode 100644 index 000000000000..3ac472babee7 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestGeolocation.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Geo-physical location to run a web test from. You must specify one or more + * locations for the test to run from. + */ +public class WebTestGeolocation { + /** + * Location ID for the webtest to run from. + */ + @JsonProperty(value = "Id") + private String location; + + /** + * Get location ID for the webtest to run from. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location ID for the webtest to run from. + * + * @param location the location value to set + * @return the WebTestGeolocation object itself. + */ + public WebTestGeolocation withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestKind.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestKind.java new file mode 100644 index 000000000000..7dec00f413d2 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestKind.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for WebTestKind. + */ +public enum WebTestKind { + /** Enum value ping. */ + PING("ping"), + + /** Enum value multistep. */ + MULTISTEP("multistep"); + + /** The actual serialized value for a WebTestKind instance. */ + private String value; + + WebTestKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WebTestKind instance. + * + * @param value the serialized value to parse. + * @return the parsed WebTestKind object, or null if unable to parse. + */ + @JsonCreator + public static WebTestKind fromString(String value) { + WebTestKind[] items = WebTestKind.values(); + for (WebTestKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestLocations.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestLocations.java new file mode 100644 index 000000000000..05cb42ac90a9 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestLocations.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.WebTestLocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing WebTestLocations. + */ +public interface WebTestLocations extends HasInner { + /** + * Gets a list of web test locations available to this Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestPropertiesConfiguration.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestPropertiesConfiguration.java new file mode 100644 index 000000000000..39469de54e92 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTestPropertiesConfiguration.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An XML configuration specification for a WebTest. + */ +public class WebTestPropertiesConfiguration { + /** + * The XML specification of a WebTest to run against an application. + */ + @JsonProperty(value = "WebTest") + private String webTest; + + /** + * Get the XML specification of a WebTest to run against an application. + * + * @return the webTest value + */ + public String webTest() { + return this.webTest; + } + + /** + * Set the XML specification of a WebTest to run against an application. + * + * @param webTest the webTest value to set + * @return the WebTestPropertiesConfiguration object itself. + */ + public WebTestPropertiesConfiguration withWebTest(String webTest) { + this.webTest = webTest; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTests.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTests.java new file mode 100644 index 000000000000..70345f1c055c --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebTests.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.WebTestsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing WebTests. + */ +public interface WebTests extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Get all Application Insights web tests defined for the specified component. + * + * @param componentName The name of the Application Insights component resource. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByComponentAsync(final String componentName, final String resourceGroupName); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebtestsResource.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebtestsResource.java new file mode 100644 index 000000000000..c2a5da4386ea --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WebtestsResource.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.Resource; + +/** + * An azure resource object. + */ +public class WebtestsResource extends Resource { +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfiguration.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfiguration.java new file mode 100644 index 000000000000..00dc85892e93 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfiguration.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.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.WorkItemConfigurationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; + +/** + * Type representing WorkItemConfiguration. + */ +public interface WorkItemConfiguration extends HasInner, HasManager { + /** + * @return the configDisplayName value. + */ + String configDisplayName(); + + /** + * @return the configProperties value. + */ + String configProperties(); + + /** + * @return the connectorId value. + */ + String connectorId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isDefault value. + */ + Boolean isDefault(); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurationError.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurationError.java new file mode 100644 index 000000000000..8efcd9a3ba0c --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurationError.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error associated with trying to get work item configuration or + * configurations. + */ +public class WorkItemConfigurationError { + /** + * Error detail code and explanation. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The innererror property. + */ + @JsonProperty(value = "innererror") + private InnerError innererror; + + /** + * Get error detail code and explanation. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error detail code and explanation. + * + * @param code the code value to set + * @return the WorkItemConfigurationError object itself. + */ + public WorkItemConfigurationError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the WorkItemConfigurationError object itself. + */ + public WorkItemConfigurationError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the innererror value. + * + * @return the innererror value + */ + public InnerError innererror() { + return this.innererror; + } + + /** + * Set the innererror value. + * + * @param innererror the innererror value to set + * @return the WorkItemConfigurationError object itself. + */ + public WorkItemConfigurationError withInnererror(InnerError innererror) { + this.innererror = innererror; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurationErrorException.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurationErrorException.java new file mode 100644 index 000000000000..4e7212eb6da7 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurationErrorException.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.applicationinsights.v2015_05_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with WorkItemConfigurationError + * information. + */ +public class WorkItemConfigurationErrorException extends RestException { + /** + * Initializes a new instance of the WorkItemConfigurationErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public WorkItemConfigurationErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the WorkItemConfigurationErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public WorkItemConfigurationErrorException(final String message, final Response response, final WorkItemConfigurationError body) { + super(message, response, body); + } + + @Override + public WorkItemConfigurationError body() { + return (WorkItemConfigurationError) super.body(); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurations.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurations.java new file mode 100644 index 000000000000..9e67fc1677d4 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemConfigurations.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemConfiguration; +import rx.Completable; + +/** + * Type representing WorkItemConfigurations. + */ +public interface WorkItemConfigurations { + /** + * Gets the list work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String resourceName); + + /** + * Delete a work item configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName, String workItemConfigId); + + /** + * Create a work item configuration for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigurationProperties Properties that need to be specified to create a work item configuration of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String resourceName, WorkItemCreateConfiguration workItemConfigurationProperties); + + /** + * Gets default work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDefaultAsync(String resourceGroupName, String resourceName); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemCreateConfiguration.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemCreateConfiguration.java new file mode 100644 index 000000000000..a271adfb1ce6 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkItemCreateConfiguration.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.applicationinsights.v2015_05_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Work item configuration creation payload. + */ +public class WorkItemCreateConfiguration { + /** + * Unique connector id. + */ + @JsonProperty(value = "ConnectorId") + private String connectorId; + + /** + * Serialized JSON object for detailed properties. + */ + @JsonProperty(value = "ConnectorDataConfiguration") + private String connectorDataConfiguration; + + /** + * Boolean indicating validate only. + */ + @JsonProperty(value = "ValidateOnly") + private Boolean validateOnly; + + /** + * Custom work item properties. + */ + @JsonProperty(value = "WorkItemProperties") + private String workItemProperties; + + /** + * Get unique connector id. + * + * @return the connectorId value + */ + public String connectorId() { + return this.connectorId; + } + + /** + * Set unique connector id. + * + * @param connectorId the connectorId value to set + * @return the WorkItemCreateConfiguration object itself. + */ + public WorkItemCreateConfiguration withConnectorId(String connectorId) { + this.connectorId = connectorId; + return this; + } + + /** + * Get serialized JSON object for detailed properties. + * + * @return the connectorDataConfiguration value + */ + public String connectorDataConfiguration() { + return this.connectorDataConfiguration; + } + + /** + * Set serialized JSON object for detailed properties. + * + * @param connectorDataConfiguration the connectorDataConfiguration value to set + * @return the WorkItemCreateConfiguration object itself. + */ + public WorkItemCreateConfiguration withConnectorDataConfiguration(String connectorDataConfiguration) { + this.connectorDataConfiguration = connectorDataConfiguration; + return this; + } + + /** + * Get boolean indicating validate only. + * + * @return the validateOnly value + */ + public Boolean validateOnly() { + return this.validateOnly; + } + + /** + * Set boolean indicating validate only. + * + * @param validateOnly the validateOnly value to set + * @return the WorkItemCreateConfiguration object itself. + */ + public WorkItemCreateConfiguration withValidateOnly(Boolean validateOnly) { + this.validateOnly = validateOnly; + return this; + } + + /** + * Get custom work item properties. + * + * @return the workItemProperties value + */ + public String workItemProperties() { + return this.workItemProperties; + } + + /** + * Set custom work item properties. + * + * @param workItemProperties the workItemProperties value to set + * @return the WorkItemCreateConfiguration object itself. + */ + public WorkItemCreateConfiguration withWorkItemProperties(String workItemProperties) { + this.workItemProperties = workItemProperties; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Workbook.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Workbook.java new file mode 100644 index 000000000000..4b90e11c52ff --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Workbook.java @@ -0,0 +1,321 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.WorkbookInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.InsightsManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing Workbook. + */ +public interface Workbook extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the category value. + */ + String category(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the kind value. + */ + SharedTypeKind kind(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the serializedData value. + */ + String serializedData(); + + /** + * @return the sharedTypeKind value. + */ + SharedTypeKind sharedTypeKind(); + + /** + * @return the sourceResourceId value. + */ + String sourceResourceId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the timeModified value. + */ + String timeModified(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userId value. + */ + String userId(); + + /** + * @return the version value. + */ + String version(); + + /** + * @return the workbookId value. + */ + String workbookId(); + + /** + * @return the workbookName value. + */ + String workbookName(); + + /** + * @return the workbookTags value. + */ + List workbookTags(); + + /** + * The entirety of the Workbook definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithCategory, DefinitionStages.WithLocation, DefinitionStages.WithSerializedData, DefinitionStages.WithSharedTypeKind, DefinitionStages.WithUserId, DefinitionStages.WithWorkbookId, DefinitionStages.WithWorkbookName, DefinitionStages.WithCreate { + } + + /** + * Grouping of Workbook definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Workbook definition. + */ + interface Blank extends WithResourceGroupName { + } + + /** + * The stage of the workbook definition allowing to specify ResourceGroupName. + */ + interface WithResourceGroupName { + /** + * Specifies resourceGroupName. + */ + WithCategory withResourceGroupName(String resourceGroupName); + } + + /** + * The stage of the workbook definition allowing to specify Category. + */ + interface WithCategory { + /** + * Specifies category. + */ + WithLocation withCategory(String category); + } + + /** + * The stage of the workbook definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithSerializedData withLocation(String location); + } + + /** + * The stage of the workbook definition allowing to specify SerializedData. + */ + interface WithSerializedData { + /** + * Specifies serializedData. + */ + WithSharedTypeKind withSerializedData(String serializedData); + } + + /** + * The stage of the workbook definition allowing to specify SharedTypeKind. + */ + interface WithSharedTypeKind { + /** + * Specifies sharedTypeKind. + */ + WithUserId withSharedTypeKind(SharedTypeKind sharedTypeKind); + } + + /** + * The stage of the workbook definition allowing to specify UserId. + */ + interface WithUserId { + /** + * Specifies userId. + */ + WithWorkbookId withUserId(String userId); + } + + /** + * The stage of the workbook definition allowing to specify WorkbookId. + */ + interface WithWorkbookId { + /** + * Specifies workbookId. + */ + WithWorkbookName withWorkbookId(String workbookId); + } + + /** + * The stage of the workbook definition allowing to specify WorkbookName. + */ + interface WithWorkbookName { + /** + * Specifies workbookName. + */ + WithCreate withWorkbookName(String workbookName); + } + + /** + * The stage of the workbook definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + */ + WithCreate withKind(SharedTypeKind kind); + } + + /** + * The stage of the workbook definition allowing to specify SourceResourceId. + */ + interface WithSourceResourceId { + /** + * Specifies sourceResourceId. + */ + WithCreate withSourceResourceId(String sourceResourceId); + } + + /** + * The stage of the workbook definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the workbook definition allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + */ + WithCreate withVersion(String version); + } + + /** + * The stage of the workbook definition allowing to specify WorkbookTags. + */ + interface WithWorkbookTags { + /** + * Specifies workbookTags. + */ + WithCreate withWorkbookTags(List workbookTags); + } + + /** + * 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.WithKind, DefinitionStages.WithSourceResourceId, DefinitionStages.WithTags, DefinitionStages.WithVersion, DefinitionStages.WithWorkbookTags { + } + } + /** + * The template for a Workbook update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithKind, UpdateStages.WithSourceResourceId, UpdateStages.WithTags, UpdateStages.WithVersion, UpdateStages.WithWorkbookTags { + } + + /** + * Grouping of Workbook update stages. + */ + interface UpdateStages { + /** + * The stage of the workbook update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + */ + Update withKind(SharedTypeKind kind); + } + + /** + * The stage of the workbook update allowing to specify SourceResourceId. + */ + interface WithSourceResourceId { + /** + * Specifies sourceResourceId. + */ + Update withSourceResourceId(String sourceResourceId); + } + + /** + * The stage of the workbook update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + /** + * The stage of the workbook update allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + */ + Update withVersion(String version); + } + + /** + * The stage of the workbook update allowing to specify WorkbookTags. + */ + interface WithWorkbookTags { + /** + * Specifies workbookTags. + */ + Update withWorkbookTags(List workbookTags); + } + + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookError.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookError.java new file mode 100644 index 000000000000..7b903017d55e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookError.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error message body that will indicate why the operation failed. + */ +public class WorkbookError { + /** + * Service-defined error code. This code serves as a sub-status for the + * HTTP error code specified in the response. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Human-readable representation of the error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The list of invalid fields send in request, in case of validation error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + * + * @param code the code value to set + * @return the WorkbookError object itself. + */ + public WorkbookError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get human-readable representation of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set human-readable representation of the error. + * + * @param message the message value to set + * @return the WorkbookError object itself. + */ + public WorkbookError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the list of invalid fields send in request, in case of validation error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the list of invalid fields send in request, in case of validation error. + * + * @param details the details value to set + * @return the WorkbookError object itself. + */ + public WorkbookError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookErrorException.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookErrorException.java new file mode 100644 index 000000000000..59a8dc90a6ef --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with WorkbookError information. + */ +public class WorkbookErrorException extends RestException { + /** + * Initializes a new instance of the WorkbookErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public WorkbookErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the WorkbookErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public WorkbookErrorException(final String message, final Response response, final WorkbookError body) { + super(message, response, body); + } + + @Override + public WorkbookError body() { + return (WorkbookError) super.body(); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookResource.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookResource.java new file mode 100644 index 000000000000..fb305263d76f --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/WorkbookResource.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.Resource; + +/** + * An azure resource object. + */ +public class WorkbookResource extends Resource { +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Workbooks.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Workbooks.java new file mode 100644 index 000000000000..86eb73b2c242 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/Workbooks.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation.WorkbooksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Workbooks. + */ +public interface Workbooks extends SupportsCreating, HasInner { + /** + * Get a single workbook by its resourceName. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String resourceName); + + /** + * Delete a workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String resourceName); + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName, CategoryType category); + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysImpl.java new file mode 100644 index 000000000000..ba00ae3f23c0 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.APIKeys; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAPIKey; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.APIKeyRequest; + +class APIKeysImpl extends WrapperImpl implements APIKeys { + private final InsightsManager manager; + + APIKeysImpl(InsightsManager manager) { + super(manager.inner().aPIKeys()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + private ApplicationInsightsComponentAPIKeyImpl wrapModel(ApplicationInsightsComponentAPIKeyInner inner) { + return new ApplicationInsightsComponentAPIKeyImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + APIKeysInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponentAPIKey call(ApplicationInsightsComponentAPIKeyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String keyId) { + APIKeysInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, keyId) + .map(new Func1() { + @Override + public ApplicationInsightsComponentAPIKey call(ApplicationInsightsComponentAPIKeyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String keyId) { + APIKeysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, keyId).toCompletable(); + } + + @Override + public Observable createAsync(String resourceGroupName, String resourceName, APIKeyRequest aPIKeyProperties) { + APIKeysInner client = this.inner(); + return client.createAsync(resourceGroupName, resourceName, aPIKeyProperties) + .map(new Func1() { + @Override + public ApplicationInsightsComponentAPIKey call(ApplicationInsightsComponentAPIKeyInner inner) { + return new ApplicationInsightsComponentAPIKeyImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysInner.java new file mode 100644 index 000000000000..1bbfafca118b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysInner.java @@ -0,0 +1,449 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.APIKeyRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in APIKeys. + */ +public class APIKeysInner { + /** The Retrofit service to perform REST calls. */ + private APIKeysService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of APIKeysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public APIKeysInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(APIKeysService.class); + this.client = client; + } + + /** + * The interface defining all the services for APIKeys to be + * used by Retrofit to perform actually REST calls. + */ + interface APIKeysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.APIKeys list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.APIKeys create" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body APIKeyRequest aPIKeyProperties, @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.applicationinsights.v2015_05_01.APIKeys delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("keyId") String keyId, @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.applicationinsights.v2015_05_01.APIKeys get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("keyId") String keyId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of API keys of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 List<ApplicationInsightsComponentAPIKeyInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets a list of API keys of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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> listAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets a list of API keys of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentAPIKeyInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of API keys of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentAPIKeyInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(resourceGroupName, this.client.subscriptionId(), resourceName, 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); + } + + /** + * Create an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param aPIKeyProperties Properties that need to be specified to create an API key of a Application Insights component. + * @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 ApplicationInsightsComponentAPIKeyInner object if successful. + */ + public ApplicationInsightsComponentAPIKeyInner create(String resourceGroupName, String resourceName, APIKeyRequest aPIKeyProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, aPIKeyProperties).toBlocking().single().body(); + } + + /** + * Create an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param aPIKeyProperties Properties that need to be specified to create an API key of a Application Insights component. + * @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 createAsync(String resourceGroupName, String resourceName, APIKeyRequest aPIKeyProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, resourceName, aPIKeyProperties), serviceCallback); + } + + /** + * Create an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param aPIKeyProperties Properties that need to be specified to create an API key of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAPIKeyInner object + */ + public Observable createAsync(String resourceGroupName, String resourceName, APIKeyRequest aPIKeyProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, aPIKeyProperties).map(new Func1, ApplicationInsightsComponentAPIKeyInner>() { + @Override + public ApplicationInsightsComponentAPIKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param aPIKeyProperties Properties that need to be specified to create an API key of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAPIKeyInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String resourceName, APIKeyRequest aPIKeyProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (aPIKeyProperties == null) { + throw new IllegalArgumentException("Parameter aPIKeyProperties is required and cannot be null."); + } + Validator.validate(aPIKeyProperties); + return service.create(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), aPIKeyProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(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 an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @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 ApplicationInsightsComponentAPIKeyInner object if successful. + */ + public ApplicationInsightsComponentAPIKeyInner delete(String resourceGroupName, String resourceName, String keyId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, keyId).toBlocking().single().body(); + } + + /** + * Delete an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @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 resourceName, String keyId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, keyId), serviceCallback); + } + + /** + * Delete an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAPIKeyInner object + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String keyId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, keyId).map(new Func1, ApplicationInsightsComponentAPIKeyInner>() { + @Override + public ApplicationInsightsComponentAPIKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an API Key of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAPIKeyInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String keyId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (keyId == null) { + throw new IllegalArgumentException("Parameter keyId 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, this.client.subscriptionId(), resourceName, keyId, 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); + } + + /** + * Get the API Key for this key id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @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 ApplicationInsightsComponentAPIKeyInner object if successful. + */ + public ApplicationInsightsComponentAPIKeyInner get(String resourceGroupName, String resourceName, String keyId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, keyId).toBlocking().single().body(); + } + + /** + * Get the API Key for this key id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @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 resourceName, String keyId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, keyId), serviceCallback); + } + + /** + * Get the API Key for this key id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAPIKeyInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String keyId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, keyId).map(new Func1, ApplicationInsightsComponentAPIKeyInner>() { + @Override + public ApplicationInsightsComponentAPIKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the API Key for this key id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param keyId The API Key ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAPIKeyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String keyId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (keyId == null) { + throw new IllegalArgumentException("Parameter keyId 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, this.client.subscriptionId(), resourceName, keyId, 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); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsImpl.java new file mode 100644 index 000000000000..2c3289ad2ea5 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsImpl.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. + * abc + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.AnalyticsItems; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAnalyticsItem; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemScopePath; + +class AnalyticsItemsImpl extends WrapperImpl implements AnalyticsItems { + private final InsightsManager manager; + + AnalyticsItemsImpl(InsightsManager manager) { + super(manager.inner().analyticsItems()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + AnalyticsItemsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName, scopePath) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponentAnalyticsItem call(ApplicationInsightsComponentAnalyticsItemInner inner) { + return new ApplicationInsightsComponentAnalyticsItemImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + AnalyticsItemsInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, scopePath) + .map(new Func1() { + @Override + public ApplicationInsightsComponentAnalyticsItem call(ApplicationInsightsComponentAnalyticsItemInner inner) { + return new ApplicationInsightsComponentAnalyticsItemImpl(inner, manager()); + } + }); + } + + @Override + public Observable putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties) { + AnalyticsItemsInner client = this.inner(); + return client.putAsync(resourceGroupName, resourceName, scopePath, itemProperties) + .map(new Func1() { + @Override + public ApplicationInsightsComponentAnalyticsItem call(ApplicationInsightsComponentAnalyticsItemInner inner) { + return new ApplicationInsightsComponentAnalyticsItemImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + AnalyticsItemsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, scopePath).toCompletable(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java new file mode 100644 index 000000000000..4caecd632f5e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java @@ -0,0 +1,850 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemScope; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemScopePath; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemTypeParameter; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AnalyticsItems. + */ +public class AnalyticsItemsInner { + /** The Retrofit service to perform REST calls. */ + private AnalyticsItemsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of AnalyticsItemsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AnalyticsItemsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(AnalyticsItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AnalyticsItems to be + * used by Retrofit to perform actually REST calls. + */ + interface AnalyticsItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.AnalyticsItems list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("scopePath") ItemScopePath scopePath, @Query("api-version") String apiVersion, @Query("scope") ItemScope scope, @Query("type") ItemTypeParameter type, @Query("includeContent") Boolean includeContent, @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.applicationinsights.v2015_05_01.AnalyticsItems get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("scopePath") ItemScopePath scopePath, @Query("api-version") String apiVersion, @Query("id") String id, @Query("name") String name, @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.applicationinsights.v2015_05_01.AnalyticsItems put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item") + Observable> put(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("scopePath") ItemScopePath scopePath, @Query("api-version") String apiVersion, @Query("overrideItem") Boolean overrideItem, @Body ApplicationInsightsComponentAnalyticsItemInner itemProperties, @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.applicationinsights.v2015_05_01.AnalyticsItems delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("scopePath") ItemScopePath scopePath, @Query("api-version") String apiVersion, @Query("id") String id, @Query("name") String name, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationInsightsComponentAnalyticsItemInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).toBlocking().single().body(); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName, scopePath), serviceCallback); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentAnalyticsItemInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentAnalyticsItemInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ItemScope scope = null; + final ItemTypeParameter type = null; + final Boolean includeContent = null; + return service.list(this.client.subscriptionId(), resourceGroupName, resourceName, scopePath, this.client.apiVersion(), scope, type, includeContent, 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); + } + } + }); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param scope Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user' + * @param type Enum indicating the type of the Analytics item. Possible values include: 'none', 'query', 'function', 'folder', 'recent' + * @param includeContent Flag indicating whether or not to return the content of each applicable item. If false, only return the item information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationInsightsComponentAnalyticsItemInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName, ItemScopePath scopePath, ItemScope scope, ItemTypeParameter type, Boolean includeContent) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, scope, type, includeContent).toBlocking().single().body(); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param scope Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user' + * @param type Enum indicating the type of the Analytics item. Possible values include: 'none', 'query', 'function', 'folder', 'recent' + * @param includeContent Flag indicating whether or not to return the content of each applicable item. If false, only return the item information. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ItemScope scope, ItemTypeParameter type, Boolean includeContent, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, scope, type, includeContent), serviceCallback); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param scope Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user' + * @param type Enum indicating the type of the Analytics item. Possible values include: 'none', 'query', 'function', 'folder', 'recent' + * @param includeContent Flag indicating whether or not to return the content of each applicable item. If false, only return the item information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentAnalyticsItemInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ItemScope scope, ItemTypeParameter type, Boolean includeContent) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, scope, type, includeContent).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param scope Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user' + * @param type Enum indicating the type of the Analytics item. Possible values include: 'none', 'query', 'function', 'folder', 'recent' + * @param includeContent Flag indicating whether or not to return the content of each applicable item. If false, only return the item information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentAnalyticsItemInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ItemScope scope, ItemTypeParameter type, Boolean includeContent) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, resourceName, scopePath, this.client.apiVersion(), scope, type, includeContent, 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()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @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 ApplicationInsightsComponentAnalyticsItemInner object if successful. + */ + public ApplicationInsightsComponentAnalyticsItemInner get(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).toBlocking().single().body(); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @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 resourceName, ItemScopePath scopePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, scopePath), serviceCallback); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).map(new Func1, ApplicationInsightsComponentAnalyticsItemInner>() { + @Override + public ApplicationInsightsComponentAnalyticsItemInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String id = null; + final String name = null; + return service.get(this.client.subscriptionId(), resourceGroupName, resourceName, scopePath, this.client.apiVersion(), id, name, 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); + } + } + }); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @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 ApplicationInsightsComponentAnalyticsItemInner object if successful. + */ + public ApplicationInsightsComponentAnalyticsItemInner get(String resourceGroupName, String resourceName, ItemScopePath scopePath, String id, String name) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, id, name).toBlocking().single().body(); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @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 resourceName, ItemScopePath scopePath, String id, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, id, name), serviceCallback); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, String id, String name) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, id, name).map(new Func1, ApplicationInsightsComponentAnalyticsItemInner>() { + @Override + public ApplicationInsightsComponentAnalyticsItemInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, String id, String name) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath 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, resourceName, scopePath, this.client.apiVersion(), id, name, 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); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @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 ApplicationInsightsComponentAnalyticsItemInner object if successful. + */ + public ApplicationInsightsComponentAnalyticsItemInner put(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties) { + return putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, itemProperties).toBlocking().single().body(); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @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 putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, itemProperties), serviceCallback); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties) { + return putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, itemProperties).map(new Func1, ApplicationInsightsComponentAnalyticsItemInner>() { + @Override + public ApplicationInsightsComponentAnalyticsItemInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable> putWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath 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 (itemProperties == null) { + throw new IllegalArgumentException("Parameter itemProperties is required and cannot be null."); + } + Validator.validate(itemProperties); + final Boolean overrideItem = null; + return service.put(this.client.subscriptionId(), resourceGroupName, resourceName, scopePath, this.client.apiVersion(), overrideItem, itemProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @param overrideItem Flag indicating whether or not to force save an item. This allows overriding an item if it already exists. + * @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 ApplicationInsightsComponentAnalyticsItemInner object if successful. + */ + public ApplicationInsightsComponentAnalyticsItemInner put(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem) { + return putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, itemProperties, overrideItem).toBlocking().single().body(); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @param overrideItem Flag indicating whether or not to force save an item. This allows overriding an item if it already exists. + * @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 putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, itemProperties, overrideItem), serviceCallback); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @param overrideItem Flag indicating whether or not to force save an item. This allows overriding an item if it already exists. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem) { + return putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, itemProperties, overrideItem).map(new Func1, ApplicationInsightsComponentAnalyticsItemInner>() { + @Override + public ApplicationInsightsComponentAnalyticsItemInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds or Updates a specific Analytics Item within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param itemProperties Properties that need to be specified to create a new item and add it to an Application Insights component. + * @param overrideItem Flag indicating whether or not to force save an item. This allows overriding an item if it already exists. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAnalyticsItemInner object + */ + public Observable> putWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath 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 (itemProperties == null) { + throw new IllegalArgumentException("Parameter itemProperties is required and cannot be null."); + } + Validator.validate(itemProperties); + return service.put(this.client.subscriptionId(), resourceGroupName, resourceName, scopePath, this.client.apiVersion(), overrideItem, itemProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDelegate(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 specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @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 resourceName, ItemScopePath scopePath) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).toBlocking().single().body(); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @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 resourceName, ItemScopePath scopePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath), serviceCallback); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String id = null; + final String name = null; + return service.delete(this.client.subscriptionId(), resourceGroupName, resourceName, scopePath, this.client.apiVersion(), id, name, 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); + } + } + }); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @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 resourceName, ItemScopePath scopePath, String id, String name) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, id, name).toBlocking().single().body(); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @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 resourceName, ItemScopePath scopePath, String id, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, id, name), serviceCallback); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, String id, String name) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath, id, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specific Analytics Items defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems' + * @param id The Id of a specific item defined in the Application Insights component + * @param name The name of a specific item defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, String id, String name) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (scopePath == null) { + throw new IllegalArgumentException("Parameter scopePath 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, resourceName, scopePath, this.client.apiVersion(), id, name, 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); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationImpl.java new file mode 100644 index 000000000000..67dcb49295d4 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Annotation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class AnnotationImpl extends WrapperImpl implements Annotation { + private final InsightsManager manager; + + AnnotationImpl(AnnotationInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + + + @Override + public String annotationName() { + return this.inner().annotationName(); + } + + @Override + public String category() { + return this.inner().category(); + } + + @Override + public DateTime eventTime() { + return this.inner().eventTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String properties() { + return this.inner().properties(); + } + + @Override + public String relatedAnnotation() { + return this.inner().relatedAnnotation(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationInner.java new file mode 100644 index 000000000000..6f589e5a3806 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationInner.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Annotation associated with an application insights resource. + */ +public class AnnotationInner { + /** + * Name of annotation. + */ + @JsonProperty(value = "AnnotationName") + private String annotationName; + + /** + * Category of annotation, free form. + */ + @JsonProperty(value = "Category") + private String category; + + /** + * Time when event occurred. + */ + @JsonProperty(value = "EventTime") + private DateTime eventTime; + + /** + * Unique Id for annotation. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * Serialized JSON object for detailed properties. + */ + @JsonProperty(value = "Properties") + private String properties; + + /** + * Related parent annotation if any. + */ + @JsonProperty(value = "RelatedAnnotation") + private String relatedAnnotation; + + /** + * Get name of annotation. + * + * @return the annotationName value + */ + public String annotationName() { + return this.annotationName; + } + + /** + * Set name of annotation. + * + * @param annotationName the annotationName value to set + * @return the AnnotationInner object itself. + */ + public AnnotationInner withAnnotationName(String annotationName) { + this.annotationName = annotationName; + return this; + } + + /** + * Get category of annotation, free form. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set category of annotation, free form. + * + * @param category the category value to set + * @return the AnnotationInner object itself. + */ + public AnnotationInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get time when event occurred. + * + * @return the eventTime value + */ + public DateTime eventTime() { + return this.eventTime; + } + + /** + * Set time when event occurred. + * + * @param eventTime the eventTime value to set + * @return the AnnotationInner object itself. + */ + public AnnotationInner withEventTime(DateTime eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Get unique Id for annotation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique Id for annotation. + * + * @param id the id value to set + * @return the AnnotationInner object itself. + */ + public AnnotationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get serialized JSON object for detailed properties. + * + * @return the properties value + */ + public String properties() { + return this.properties; + } + + /** + * Set serialized JSON object for detailed properties. + * + * @param properties the properties value to set + * @return the AnnotationInner object itself. + */ + public AnnotationInner withProperties(String properties) { + this.properties = properties; + return this; + } + + /** + * Get related parent annotation if any. + * + * @return the relatedAnnotation value + */ + public String relatedAnnotation() { + return this.relatedAnnotation; + } + + /** + * Set related parent annotation if any. + * + * @param relatedAnnotation the relatedAnnotation value to set + * @return the AnnotationInner object itself. + */ + public AnnotationInner withRelatedAnnotation(String relatedAnnotation) { + this.relatedAnnotation = relatedAnnotation; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsImpl.java new file mode 100644 index 000000000000..5a8fb45e024e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsImpl.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Annotations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Annotation; + +class AnnotationsImpl extends WrapperImpl implements Annotations { + private final InsightsManager manager; + + AnnotationsImpl(InsightsManager manager) { + super(manager.inner().annotations()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + private AnnotationImpl wrapModel(AnnotationInner inner) { + return new AnnotationImpl(inner, manager()); + } + + @Override + public Observable createAsync(String resourceGroupName, String resourceName, AnnotationInner annotationProperties) { + AnnotationsInner client = this.inner(); + return client.createAsync(resourceGroupName, resourceName, annotationProperties) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Annotation call(AnnotationInner inner) { + return new AnnotationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String annotationId) { + AnnotationsInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, annotationId) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Annotation call(AnnotationInner inner) { + return new AnnotationImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName, String start, String end) { + AnnotationsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName, start, end) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Annotation call(AnnotationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String annotationId) { + AnnotationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, annotationId).toCompletable(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsInner.java new file mode 100644 index 000000000000..c3346fd86fc1 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnnotationsInner.java @@ -0,0 +1,463 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.AnnotationErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Annotations. + */ +public class AnnotationsInner { + /** The Retrofit service to perform REST calls. */ + private AnnotationsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of AnnotationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AnnotationsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(AnnotationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Annotations to be + * used by Retrofit to perform actually REST calls. + */ + interface AnnotationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.Annotations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Query("start") String start, @Query("end") String end, @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.applicationinsights.v2015_05_01.Annotations create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body AnnotationInner annotationProperties, @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.applicationinsights.v2015_05_01.Annotations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("annotationId") String annotationId, @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.applicationinsights.v2015_05_01.Annotations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("annotationId") String annotationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the list of annotations for a component for given time range. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param start The start time to query from for annotations, cannot be older than 90 days from current date. + * @param end The end time to query for annotations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws AnnotationErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<AnnotationInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName, String start, String end) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, start, end).toBlocking().single().body(); + } + + /** + * Gets the list of annotations for a component for given time range. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param start The start time to query from for annotations, cannot be older than 90 days from current date. + * @param end The end time to query for annotations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String resourceName, String start, String end, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName, start, end), serviceCallback); + } + + /** + * Gets the list of annotations for a component for given time range. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param start The start time to query from for annotations, cannot be older than 90 days from current date. + * @param end The end time to query for annotations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AnnotationInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName, String start, String end) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, start, end).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of annotations for a component for given time range. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param start The start time to query from for annotations, cannot be older than 90 days from current date. + * @param end The end time to query for annotations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AnnotationInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName, String start, String end) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (start == null) { + throw new IllegalArgumentException("Parameter start is required and cannot be null."); + } + if (end == null) { + throw new IllegalArgumentException("Parameter end is required and cannot be null."); + } + return service.list(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), start, end, 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 AnnotationErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., AnnotationErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(AnnotationErrorException.class) + .build(response); + } + + /** + * Create an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationProperties Properties that need to be specified to create an annotation of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws AnnotationErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<AnnotationInner> object if successful. + */ + public List create(String resourceGroupName, String resourceName, AnnotationInner annotationProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, annotationProperties).toBlocking().single().body(); + } + + /** + * Create an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationProperties Properties that need to be specified to create an annotation of a Application Insights component. + * @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> createAsync(String resourceGroupName, String resourceName, AnnotationInner annotationProperties, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, resourceName, annotationProperties), serviceCallback); + } + + /** + * Create an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationProperties Properties that need to be specified to create an annotation of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AnnotationInner> object + */ + public Observable> createAsync(String resourceGroupName, String resourceName, AnnotationInner annotationProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, annotationProperties).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Create an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationProperties Properties that need to be specified to create an annotation of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AnnotationInner> object + */ + public Observable>> createWithServiceResponseAsync(String resourceGroupName, String resourceName, AnnotationInner annotationProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (annotationProperties == null) { + throw new IllegalArgumentException("Parameter annotationProperties is required and cannot be null."); + } + Validator.validate(annotationProperties); + return service.create(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), annotationProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> createDelegate(Response response) throws AnnotationErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., AnnotationErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(AnnotationErrorException.class) + .build(response); + } + + /** + * Delete an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @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 Object object if successful. + */ + public Object delete(String resourceGroupName, String resourceName, String annotationId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, annotationId).toBlocking().single().body(); + } + + /** + * Delete an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @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 resourceName, String annotationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, annotationId), serviceCallback); + } + + /** + * Delete an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String annotationId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, annotationId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Annotation of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String annotationId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (annotationId == null) { + throw new IllegalArgumentException("Parameter annotationId 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, this.client.subscriptionId(), resourceName, annotationId, 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); + } + + /** + * Get the annotation for given id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws AnnotationErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<AnnotationInner> object if successful. + */ + public List get(String resourceGroupName, String resourceName, String annotationId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, annotationId).toBlocking().single().body(); + } + + /** + * Get the annotation for given id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @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 resourceName, String annotationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, annotationId), serviceCallback); + } + + /** + * Get the annotation for given id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AnnotationInner> object + */ + public Observable> getAsync(String resourceGroupName, String resourceName, String annotationId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, annotationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the annotation for given id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param annotationId The unique annotation ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AnnotationInner> object + */ + public Observable>> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String annotationId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (annotationId == null) { + throw new IllegalArgumentException("Parameter annotationId 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, this.client.subscriptionId(), resourceName, annotationId, 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 AnnotationErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., AnnotationErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(AnnotationErrorException.class) + .build(response); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAPIKeyImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAPIKeyImpl.java new file mode 100644 index 000000000000..1dabd5ef041b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAPIKeyImpl.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAPIKey; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; + +class ApplicationInsightsComponentAPIKeyImpl extends IndexableRefreshableWrapperImpl implements ApplicationInsightsComponentAPIKey { + private final InsightsManager manager; + private String resourceGroupName; + private String resourceName; + private String keyId; + + ApplicationInsightsComponentAPIKeyImpl(ApplicationInsightsComponentAPIKeyInner inner, InsightsManager manager) { + super(null, inner); + this.manager = manager; + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "components"); + this.keyId = IdParsingUtils.getValueFromIdByName(inner.id(), "APIKeys"); + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + APIKeysInner client = this.manager().inner().aPIKeys(); + return client.getAsync(this.resourceGroupName, this.resourceName, this.keyId); + } + + + + @Override + public String apiKey() { + return this.inner().apiKey(); + } + + @Override + public String createdDate() { + return this.inner().createdDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List linkedReadProperties() { + return this.inner().linkedReadProperties(); + } + + @Override + public List linkedWriteProperties() { + return this.inner().linkedWriteProperties(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAPIKeyInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAPIKeyInner.java new file mode 100644 index 000000000000..c8ad8954ee26 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAPIKeyInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that define an API key of an Application Insights Component. + */ +public class ApplicationInsightsComponentAPIKeyInner { + /** + * The unique ID of the API key inside an Application Insights component. + * It is auto generated when the API key is created. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The API key value. It will be only return once when the API Key was + * created. + */ + @JsonProperty(value = "apiKey", access = JsonProperty.Access.WRITE_ONLY) + private String apiKey; + + /** + * The create date of this API key. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /** + * The name of the API key. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The read access rights of this API Key. + */ + @JsonProperty(value = "linkedReadProperties") + private List linkedReadProperties; + + /** + * The write access rights of this API Key. + */ + @JsonProperty(value = "linkedWriteProperties") + private List linkedWriteProperties; + + /** + * Get the unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the API key value. It will be only return once when the API Key was created. + * + * @return the apiKey value + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Get the create date of this API key. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the create date of this API key. + * + * @param createdDate the createdDate value to set + * @return the ApplicationInsightsComponentAPIKeyInner object itself. + */ + public ApplicationInsightsComponentAPIKeyInner withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the name of the API key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the API key. + * + * @param name the name value to set + * @return the ApplicationInsightsComponentAPIKeyInner object itself. + */ + public ApplicationInsightsComponentAPIKeyInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the read access rights of this API Key. + * + * @return the linkedReadProperties value + */ + public List linkedReadProperties() { + return this.linkedReadProperties; + } + + /** + * Set the read access rights of this API Key. + * + * @param linkedReadProperties the linkedReadProperties value to set + * @return the ApplicationInsightsComponentAPIKeyInner object itself. + */ + public ApplicationInsightsComponentAPIKeyInner withLinkedReadProperties(List linkedReadProperties) { + this.linkedReadProperties = linkedReadProperties; + return this; + } + + /** + * Get the write access rights of this API Key. + * + * @return the linkedWriteProperties value + */ + public List linkedWriteProperties() { + return this.linkedWriteProperties; + } + + /** + * Set the write access rights of this API Key. + * + * @param linkedWriteProperties the linkedWriteProperties value to set + * @return the ApplicationInsightsComponentAPIKeyInner object itself. + */ + public ApplicationInsightsComponentAPIKeyInner withLinkedWriteProperties(List linkedWriteProperties) { + this.linkedWriteProperties = linkedWriteProperties; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAnalyticsItemImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAnalyticsItemImpl.java new file mode 100644 index 000000000000..f7407d461a1d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAnalyticsItemImpl.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAnalyticsItem; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAnalyticsItemProperties; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemScope; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemType; + +class ApplicationInsightsComponentAnalyticsItemImpl extends WrapperImpl implements ApplicationInsightsComponentAnalyticsItem { + private final InsightsManager manager; + ApplicationInsightsComponentAnalyticsItemImpl(ApplicationInsightsComponentAnalyticsItemInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ApplicationInsightsComponentAnalyticsItemProperties properties() { + return this.inner().properties(); + } + + @Override + public ItemScope scope() { + return this.inner().scope(); + } + + @Override + public String timeCreated() { + return this.inner().timeCreated(); + } + + @Override + public String timeModified() { + return this.inner().timeModified(); + } + + @Override + public ItemType type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAnalyticsItemInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAnalyticsItemInner.java new file mode 100644 index 000000000000..3260d6f83d23 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAnalyticsItemInner.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemScope; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ItemType; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAnalyticsItemProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that define an Analytics item that is associated to an + * Application Insights component. + */ +public class ApplicationInsightsComponentAnalyticsItemInner { + /** + * Internally assigned unique id of the item definition. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The user-defined name of the item. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The content of this item. + */ + @JsonProperty(value = "Content") + private String content; + + /** + * This instance's version of the data model. This can change as new + * features are added. + */ + @JsonProperty(value = "Version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Enum indicating if this item definition is owned by a specific user or + * is shared between all users with access to the Application Insights + * component. Possible values include: 'shared', 'user'. + */ + @JsonProperty(value = "Scope") + private ItemScope scope; + + /** + * Enum indicating the type of the Analytics item. Possible values include: + * 'query', 'function', 'folder', 'recent'. + */ + @JsonProperty(value = "Type") + private ItemType type; + + /** + * Date and time in UTC when this item was created. + */ + @JsonProperty(value = "TimeCreated", access = JsonProperty.Access.WRITE_ONLY) + private String timeCreated; + + /** + * Date and time in UTC of the last modification that was made to this + * item. + */ + @JsonProperty(value = "TimeModified", access = JsonProperty.Access.WRITE_ONLY) + private String timeModified; + + /** + * The properties property. + */ + @JsonProperty(value = "Properties") + private ApplicationInsightsComponentAnalyticsItemProperties properties; + + /** + * Get internally assigned unique id of the item definition. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set internally assigned unique id of the item definition. + * + * @param id the id value to set + * @return the ApplicationInsightsComponentAnalyticsItemInner object itself. + */ + public ApplicationInsightsComponentAnalyticsItemInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the user-defined name of the item. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-defined name of the item. + * + * @param name the name value to set + * @return the ApplicationInsightsComponentAnalyticsItemInner object itself. + */ + public ApplicationInsightsComponentAnalyticsItemInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the content of this item. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of this item. + * + * @param content the content value to set + * @return the ApplicationInsightsComponentAnalyticsItemInner object itself. + */ + public ApplicationInsightsComponentAnalyticsItemInner withContent(String content) { + this.content = content; + return this; + } + + /** + * Get this instance's version of the data model. This can change as new features are added. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user'. + * + * @return the scope value + */ + public ItemScope scope() { + return this.scope; + } + + /** + * Set enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user'. + * + * @param scope the scope value to set + * @return the ApplicationInsightsComponentAnalyticsItemInner object itself. + */ + public ApplicationInsightsComponentAnalyticsItemInner withScope(ItemScope scope) { + this.scope = scope; + return this; + } + + /** + * Get enum indicating the type of the Analytics item. Possible values include: 'query', 'function', 'folder', 'recent'. + * + * @return the type value + */ + public ItemType type() { + return this.type; + } + + /** + * Set enum indicating the type of the Analytics item. Possible values include: 'query', 'function', 'folder', 'recent'. + * + * @param type the type value to set + * @return the ApplicationInsightsComponentAnalyticsItemInner object itself. + */ + public ApplicationInsightsComponentAnalyticsItemInner withType(ItemType type) { + this.type = type; + return this; + } + + /** + * Get date and time in UTC when this item was created. + * + * @return the timeCreated value + */ + public String timeCreated() { + return this.timeCreated; + } + + /** + * Get date and time in UTC of the last modification that was made to this item. + * + * @return the timeModified value + */ + public String timeModified() { + return this.timeModified; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public ApplicationInsightsComponentAnalyticsItemProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the ApplicationInsightsComponentAnalyticsItemInner object itself. + */ + public ApplicationInsightsComponentAnalyticsItemInner withProperties(ApplicationInsightsComponentAnalyticsItemProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAvailableFeaturesImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAvailableFeaturesImpl.java new file mode 100644 index 000000000000..f8c8b5e3b872 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAvailableFeaturesImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAvailableFeatures; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentFeature; + +class ApplicationInsightsComponentAvailableFeaturesImpl extends WrapperImpl implements ApplicationInsightsComponentAvailableFeatures { + private final InsightsManager manager; + ApplicationInsightsComponentAvailableFeaturesImpl(ApplicationInsightsComponentAvailableFeaturesInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public List result() { + return this.inner().result(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAvailableFeaturesInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAvailableFeaturesInner.java new file mode 100644 index 000000000000..278fa313a729 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentAvailableFeaturesInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentFeature; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component available features. + */ +public class ApplicationInsightsComponentAvailableFeaturesInner { + /** + * A list of Application Insights component feature. + */ + @JsonProperty(value = "Result", access = JsonProperty.Access.WRITE_ONLY) + private List result; + + /** + * Get a list of Application Insights component feature. + * + * @return the result value + */ + public List result() { + return this.result; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentBillingFeaturesImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentBillingFeaturesImpl.java new file mode 100644 index 000000000000..5a67db3b6276 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentBillingFeaturesImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentBillingFeatures; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentDataVolumeCap; + +class ApplicationInsightsComponentBillingFeaturesImpl extends WrapperImpl implements ApplicationInsightsComponentBillingFeatures { + private final InsightsManager manager; + ApplicationInsightsComponentBillingFeaturesImpl(ApplicationInsightsComponentBillingFeaturesInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public List currentBillingFeatures() { + return this.inner().currentBillingFeatures(); + } + + @Override + public ApplicationInsightsComponentDataVolumeCap dataVolumeCap() { + return this.inner().dataVolumeCap(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentBillingFeaturesInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentBillingFeaturesInner.java new file mode 100644 index 000000000000..8c64cfffc41c --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentBillingFeaturesInner.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentDataVolumeCap; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component billing features. + */ +public class ApplicationInsightsComponentBillingFeaturesInner { + /** + * An Application Insights component daily data volume cap. + */ + @JsonProperty(value = "DataVolumeCap") + private ApplicationInsightsComponentDataVolumeCap dataVolumeCap; + + /** + * Current enabled pricing plan. When the component is in the Enterprise + * plan, this will list both 'Basic' and 'Application Insights Enterprise'. + */ + @JsonProperty(value = "CurrentBillingFeatures") + private List currentBillingFeatures; + + /** + * Get an Application Insights component daily data volume cap. + * + * @return the dataVolumeCap value + */ + public ApplicationInsightsComponentDataVolumeCap dataVolumeCap() { + return this.dataVolumeCap; + } + + /** + * Set an Application Insights component daily data volume cap. + * + * @param dataVolumeCap the dataVolumeCap value to set + * @return the ApplicationInsightsComponentBillingFeaturesInner object itself. + */ + public ApplicationInsightsComponentBillingFeaturesInner withDataVolumeCap(ApplicationInsightsComponentDataVolumeCap dataVolumeCap) { + this.dataVolumeCap = dataVolumeCap; + return this; + } + + /** + * Get current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + * + * @return the currentBillingFeatures value + */ + public List currentBillingFeatures() { + return this.currentBillingFeatures; + } + + /** + * Set current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + * + * @param currentBillingFeatures the currentBillingFeatures value to set + * @return the ApplicationInsightsComponentBillingFeaturesInner object itself. + */ + public ApplicationInsightsComponentBillingFeaturesInner withCurrentBillingFeatures(List currentBillingFeatures) { + this.currentBillingFeatures = currentBillingFeatures; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentExportConfigurationImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentExportConfigurationImpl.java new file mode 100644 index 000000000000..6c346ac9116a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentExportConfigurationImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentExportConfiguration; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ApplicationInsightsComponentExportConfigurationImpl extends WrapperImpl implements ApplicationInsightsComponentExportConfiguration { + private final InsightsManager manager; + ApplicationInsightsComponentExportConfigurationImpl(ApplicationInsightsComponentExportConfigurationInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public String applicationName() { + return this.inner().applicationName(); + } + + @Override + public String containerName() { + return this.inner().containerName(); + } + + @Override + public String destinationAccountId() { + return this.inner().destinationAccountId(); + } + + @Override + public String destinationStorageLocationId() { + return this.inner().destinationStorageLocationId(); + } + + @Override + public String destinationStorageSubscriptionId() { + return this.inner().destinationStorageSubscriptionId(); + } + + @Override + public String destinationType() { + return this.inner().destinationType(); + } + + @Override + public String exportId() { + return this.inner().exportId(); + } + + @Override + public String exportStatus() { + return this.inner().exportStatus(); + } + + @Override + public String instrumentationKey() { + return this.inner().instrumentationKey(); + } + + @Override + public String isUserEnabled() { + return this.inner().isUserEnabled(); + } + + @Override + public String lastGapTime() { + return this.inner().lastGapTime(); + } + + @Override + public String lastSuccessTime() { + return this.inner().lastSuccessTime(); + } + + @Override + public String lastUserUpdate() { + return this.inner().lastUserUpdate(); + } + + @Override + public String notificationQueueEnabled() { + return this.inner().notificationQueueEnabled(); + } + + @Override + public String permanentErrorReason() { + return this.inner().permanentErrorReason(); + } + + @Override + public String recordTypes() { + return this.inner().recordTypes(); + } + + @Override + public String resourceGroup() { + return this.inner().resourceGroup(); + } + + @Override + public String storageName() { + return this.inner().storageName(); + } + + @Override + public String subscriptionId() { + return this.inner().subscriptionId(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentExportConfigurationInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentExportConfigurationInner.java new file mode 100644 index 000000000000..563a2b9c743c --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentExportConfigurationInner.java @@ -0,0 +1,333 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that define a Continuous Export configuration. + */ +public class ApplicationInsightsComponentExportConfigurationInner { + /** + * The unique ID of the export configuration inside an Application Insights + * component. It is auto generated when the Continuous Export configuration + * is created. + */ + @JsonProperty(value = "ExportId", access = JsonProperty.Access.WRITE_ONLY) + private String exportId; + + /** + * The instrumentation key of the Application Insights component. + */ + @JsonProperty(value = "InstrumentationKey", access = JsonProperty.Access.WRITE_ONLY) + private String instrumentationKey; + + /** + * This comma separated list of document types that will be exported. The + * possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', + * 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', + * 'Availability', 'Messages'. + */ + @JsonProperty(value = "RecordTypes") + private String recordTypes; + + /** + * The name of the Application Insights component. + */ + @JsonProperty(value = "ApplicationName", access = JsonProperty.Access.WRITE_ONLY) + private String applicationName; + + /** + * The subscription of the Application Insights component. + */ + @JsonProperty(value = "SubscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /** + * The resource group of the Application Insights component. + */ + @JsonProperty(value = "ResourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /** + * The destination storage account subscription ID. + */ + @JsonProperty(value = "DestinationStorageSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String destinationStorageSubscriptionId; + + /** + * The destination account location ID. + */ + @JsonProperty(value = "DestinationStorageLocationId", access = JsonProperty.Access.WRITE_ONLY) + private String destinationStorageLocationId; + + /** + * The name of destination account. + */ + @JsonProperty(value = "DestinationAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String destinationAccountId; + + /** + * The destination type. + */ + @JsonProperty(value = "DestinationType", access = JsonProperty.Access.WRITE_ONLY) + private String destinationType; + + /** + * This will be 'true' if the Continuous Export configuration is enabled, + * otherwise it will be 'false'. + */ + @JsonProperty(value = "IsUserEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String isUserEnabled; + + /** + * Last time the Continuous Export configuration was updated. + */ + @JsonProperty(value = "LastUserUpdate", access = JsonProperty.Access.WRITE_ONLY) + private String lastUserUpdate; + + /** + * Deprecated. + */ + @JsonProperty(value = "NotificationQueueEnabled") + private String notificationQueueEnabled; + + /** + * This indicates current Continuous Export configuration status. The + * possible values are 'Preparing', 'Success', 'Failure'. + */ + @JsonProperty(value = "ExportStatus", access = JsonProperty.Access.WRITE_ONLY) + private String exportStatus; + + /** + * The last time data was successfully delivered to the destination storage + * container for this Continuous Export configuration. + */ + @JsonProperty(value = "LastSuccessTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastSuccessTime; + + /** + * The last time the Continuous Export configuration started failing. + */ + @JsonProperty(value = "LastGapTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastGapTime; + + /** + * This is the reason the Continuous Export configuration started failing. + * It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. + */ + @JsonProperty(value = "PermanentErrorReason", access = JsonProperty.Access.WRITE_ONLY) + private String permanentErrorReason; + + /** + * The name of the destination storage account. + */ + @JsonProperty(value = "StorageName", access = JsonProperty.Access.WRITE_ONLY) + private String storageName; + + /** + * The name of the destination storage container. + */ + @JsonProperty(value = "ContainerName", access = JsonProperty.Access.WRITE_ONLY) + private String containerName; + + /** + * Get the unique ID of the export configuration inside an Application Insights component. It is auto generated when the Continuous Export configuration is created. + * + * @return the exportId value + */ + public String exportId() { + return this.exportId; + } + + /** + * Get the instrumentation key of the Application Insights component. + * + * @return the instrumentationKey value + */ + public String instrumentationKey() { + return this.instrumentationKey; + } + + /** + * Get this comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + * + * @return the recordTypes value + */ + public String recordTypes() { + return this.recordTypes; + } + + /** + * Set this comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + * + * @param recordTypes the recordTypes value to set + * @return the ApplicationInsightsComponentExportConfigurationInner object itself. + */ + public ApplicationInsightsComponentExportConfigurationInner withRecordTypes(String recordTypes) { + this.recordTypes = recordTypes; + return this; + } + + /** + * Get the name of the Application Insights component. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Get the subscription of the Application Insights component. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the resource group of the Application Insights component. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Get the destination storage account subscription ID. + * + * @return the destinationStorageSubscriptionId value + */ + public String destinationStorageSubscriptionId() { + return this.destinationStorageSubscriptionId; + } + + /** + * Get the destination account location ID. + * + * @return the destinationStorageLocationId value + */ + public String destinationStorageLocationId() { + return this.destinationStorageLocationId; + } + + /** + * Get the name of destination account. + * + * @return the destinationAccountId value + */ + public String destinationAccountId() { + return this.destinationAccountId; + } + + /** + * Get the destination type. + * + * @return the destinationType value + */ + public String destinationType() { + return this.destinationType; + } + + /** + * Get this will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'. + * + * @return the isUserEnabled value + */ + public String isUserEnabled() { + return this.isUserEnabled; + } + + /** + * Get last time the Continuous Export configuration was updated. + * + * @return the lastUserUpdate value + */ + public String lastUserUpdate() { + return this.lastUserUpdate; + } + + /** + * Get deprecated. + * + * @return the notificationQueueEnabled value + */ + public String notificationQueueEnabled() { + return this.notificationQueueEnabled; + } + + /** + * Set deprecated. + * + * @param notificationQueueEnabled the notificationQueueEnabled value to set + * @return the ApplicationInsightsComponentExportConfigurationInner object itself. + */ + public ApplicationInsightsComponentExportConfigurationInner withNotificationQueueEnabled(String notificationQueueEnabled) { + this.notificationQueueEnabled = notificationQueueEnabled; + return this; + } + + /** + * Get this indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'. + * + * @return the exportStatus value + */ + public String exportStatus() { + return this.exportStatus; + } + + /** + * Get the last time data was successfully delivered to the destination storage container for this Continuous Export configuration. + * + * @return the lastSuccessTime value + */ + public String lastSuccessTime() { + return this.lastSuccessTime; + } + + /** + * Get the last time the Continuous Export configuration started failing. + * + * @return the lastGapTime value + */ + public String lastGapTime() { + return this.lastGapTime; + } + + /** + * Get this is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. + * + * @return the permanentErrorReason value + */ + public String permanentErrorReason() { + return this.permanentErrorReason; + } + + /** + * Get the name of the destination storage account. + * + * @return the storageName value + */ + public String storageName() { + return this.storageName; + } + + /** + * Get the name of the destination storage container. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFavoriteImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFavoriteImpl.java new file mode 100644 index 000000000000..5bd823bf0a1d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFavoriteImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentFavorite; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.FavoriteType; +import java.util.List; + +class ApplicationInsightsComponentFavoriteImpl extends CreatableUpdatableImpl implements ApplicationInsightsComponentFavorite, ApplicationInsightsComponentFavorite.Definition { + private final InsightsManager manager; + private String resourceGroupName; + private String resourceName; + private String favoriteId; + + ApplicationInsightsComponentFavoriteImpl(String name, InsightsManager manager) { + super(name, new ApplicationInsightsComponentFavoriteInner()); + this.manager = manager; + // Set resource name + this.favoriteId = name; + // + } + + ApplicationInsightsComponentFavoriteImpl(ApplicationInsightsComponentFavoriteInner inner, InsightsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.favoriteId = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "components"); + this.favoriteId = IdParsingUtils.getValueFromIdByName(inner.id(), "favorites"); + // + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FavoritesInner client = this.manager().inner().favorites(); + return client.addAsync(this.resourceGroupName, this.resourceName, this.favoriteId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FavoritesInner client = this.manager().inner().favorites(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + FavoritesInner client = this.manager().inner().favorites(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String category() { + return this.inner().category(); + } + + @Override + public String config() { + return this.inner().config(); + } + + @Override + public String favoriteId() { + return this.inner().favoriteId(); + } + + @Override + public FavoriteType favoriteType() { + return this.inner().favoriteType(); + } + + @Override + public Boolean isGeneratedFromTemplate() { + return this.inner().isGeneratedFromTemplate(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String sourceType() { + return this.inner().sourceType(); + } + + @Override + public List tags() { + return this.inner().tags(); + } + + @Override + public String timeModified() { + return this.inner().timeModified(); + } + + @Override + public String userId() { + return this.inner().userId(); + } + + @Override + public String version() { + return this.inner().version(); + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withExistingComponent(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withCategory(String category) { + this.inner().withCategory(category); + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withConfig(String config) { + this.inner().withConfig(config); + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withFavoriteType(FavoriteType favoriteType) { + this.inner().withFavoriteType(favoriteType); + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withIsGeneratedFromTemplate(Boolean isGeneratedFromTemplate) { + this.inner().withIsGeneratedFromTemplate(isGeneratedFromTemplate); + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withSourceType(String sourceType) { + this.inner().withSourceType(sourceType); + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withTags(List tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl withVersion(String version) { + this.inner().withVersion(version); + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFavoriteInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFavoriteInner.java new file mode 100644 index 000000000000..96ed06bbc1f3 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFavoriteInner.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.FavoriteType; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that define a favorite that is associated to an Application + * Insights component. + */ +public class ApplicationInsightsComponentFavoriteInner { + /** + * The user-defined name of the favorite. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Configuration of this particular favorite, which are driven by the Azure + * portal UX. Configuration data is a string containing valid JSON. + */ + @JsonProperty(value = "Config") + private String config; + + /** + * This instance's version of the data model. This can change as new + * features are added that can be marked favorite. Current examples include + * MetricsExplorer (ME) and Search. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * Internally assigned unique id of the favorite definition. + */ + @JsonProperty(value = "FavoriteId", access = JsonProperty.Access.WRITE_ONLY) + private String favoriteId; + + /** + * Enum indicating if this favorite definition is owned by a specific user + * or is shared between all users with access to the Application Insights + * component. Possible values include: 'shared', 'user'. + */ + @JsonProperty(value = "FavoriteType") + private FavoriteType favoriteType; + + /** + * The source of the favorite definition. + */ + @JsonProperty(value = "SourceType") + private String sourceType; + + /** + * Date and time in UTC of the last modification that was made to this + * favorite definition. + */ + @JsonProperty(value = "TimeModified", access = JsonProperty.Access.WRITE_ONLY) + private String timeModified; + + /** + * A list of 0 or more tags that are associated with this favorite + * definition. + */ + @JsonProperty(value = "Tags") + private List tags; + + /** + * Favorite category, as defined by the user at creation time. + */ + @JsonProperty(value = "Category") + private String category; + + /** + * Flag denoting wether or not this favorite was generated from a template. + */ + @JsonProperty(value = "IsGeneratedFromTemplate") + private Boolean isGeneratedFromTemplate; + + /** + * Unique user id of the specific user that owns this favorite. + */ + @JsonProperty(value = "UserId", access = JsonProperty.Access.WRITE_ONLY) + private String userId; + + /** + * Get the user-defined name of the favorite. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-defined name of the favorite. + * + * @param name the name value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get configuration of this particular favorite, which are driven by the Azure portal UX. Configuration data is a string containing valid JSON. + * + * @return the config value + */ + public String config() { + return this.config; + } + + /** + * Set configuration of this particular favorite, which are driven by the Azure portal UX. Configuration data is a string containing valid JSON. + * + * @param config the config value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withConfig(String config) { + this.config = config; + return this; + } + + /** + * Get this instance's version of the data model. This can change as new features are added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set this instance's version of the data model. This can change as new features are added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search. + * + * @param version the version value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get internally assigned unique id of the favorite definition. + * + * @return the favoriteId value + */ + public String favoriteId() { + return this.favoriteId; + } + + /** + * Get enum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user'. + * + * @return the favoriteType value + */ + public FavoriteType favoriteType() { + return this.favoriteType; + } + + /** + * Set enum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'shared', 'user'. + * + * @param favoriteType the favoriteType value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withFavoriteType(FavoriteType favoriteType) { + this.favoriteType = favoriteType; + return this; + } + + /** + * Get the source of the favorite definition. + * + * @return the sourceType value + */ + public String sourceType() { + return this.sourceType; + } + + /** + * Set the source of the favorite definition. + * + * @param sourceType the sourceType value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withSourceType(String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get date and time in UTC of the last modification that was made to this favorite definition. + * + * @return the timeModified value + */ + public String timeModified() { + return this.timeModified; + } + + /** + * Get a list of 0 or more tags that are associated with this favorite definition. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set a list of 0 or more tags that are associated with this favorite definition. + * + * @param tags the tags value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get favorite category, as defined by the user at creation time. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set favorite category, as defined by the user at creation time. + * + * @param category the category value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get flag denoting wether or not this favorite was generated from a template. + * + * @return the isGeneratedFromTemplate value + */ + public Boolean isGeneratedFromTemplate() { + return this.isGeneratedFromTemplate; + } + + /** + * Set flag denoting wether or not this favorite was generated from a template. + * + * @param isGeneratedFromTemplate the isGeneratedFromTemplate value to set + * @return the ApplicationInsightsComponentFavoriteInner object itself. + */ + public ApplicationInsightsComponentFavoriteInner withIsGeneratedFromTemplate(Boolean isGeneratedFromTemplate) { + this.isGeneratedFromTemplate = isGeneratedFromTemplate; + return this; + } + + /** + * Get unique user id of the specific user that owns this favorite. + * + * @return the userId value + */ + public String userId() { + return this.userId; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFeatureCapabilitiesImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFeatureCapabilitiesImpl.java new file mode 100644 index 000000000000..68529b76cee4 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFeatureCapabilitiesImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentFeatureCapabilities; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ApplicationInsightsComponentFeatureCapabilitiesImpl extends WrapperImpl implements ApplicationInsightsComponentFeatureCapabilities { + private final InsightsManager manager; + ApplicationInsightsComponentFeatureCapabilitiesImpl(ApplicationInsightsComponentFeatureCapabilitiesInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public Boolean analyticsIntegration() { + return this.inner().analyticsIntegration(); + } + + @Override + public String apiAccessLevel() { + return this.inner().apiAccessLevel(); + } + + @Override + public Boolean applicationMap() { + return this.inner().applicationMap(); + } + + @Override + public String burstThrottlePolicy() { + return this.inner().burstThrottlePolicy(); + } + + @Override + public Double dailyCap() { + return this.inner().dailyCap(); + } + + @Override + public Double dailyCapResetTime() { + return this.inner().dailyCapResetTime(); + } + + @Override + public Boolean liveStreamMetrics() { + return this.inner().liveStreamMetrics(); + } + + @Override + public String metadataClass() { + return this.inner().metadataClass(); + } + + @Override + public Boolean multipleStepWebTest() { + return this.inner().multipleStepWebTest(); + } + + @Override + public Boolean openSchema() { + return this.inner().openSchema(); + } + + @Override + public Boolean powerBIIntegration() { + return this.inner().powerBIIntegration(); + } + + @Override + public Boolean proactiveDetection() { + return this.inner().proactiveDetection(); + } + + @Override + public Boolean supportExportData() { + return this.inner().supportExportData(); + } + + @Override + public Double throttleRate() { + return this.inner().throttleRate(); + } + + @Override + public String trackingType() { + return this.inner().trackingType(); + } + + @Override + public Boolean workItemIntegration() { + return this.inner().workItemIntegration(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFeatureCapabilitiesInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFeatureCapabilitiesInner.java new file mode 100644 index 000000000000..7df71681d60e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentFeatureCapabilitiesInner.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component feature capabilities. + */ +public class ApplicationInsightsComponentFeatureCapabilitiesInner { + /** + * Whether allow to use continuous export feature. + */ + @JsonProperty(value = "SupportExportData", access = JsonProperty.Access.WRITE_ONLY) + private Boolean supportExportData; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "BurstThrottlePolicy", access = JsonProperty.Access.WRITE_ONLY) + private String burstThrottlePolicy; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "MetadataClass", access = JsonProperty.Access.WRITE_ONLY) + private String metadataClass; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "LiveStreamMetrics", access = JsonProperty.Access.WRITE_ONLY) + private Boolean liveStreamMetrics; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "ApplicationMap", access = JsonProperty.Access.WRITE_ONLY) + private Boolean applicationMap; + + /** + * Whether allow to use work item integration feature. + */ + @JsonProperty(value = "WorkItemIntegration", access = JsonProperty.Access.WRITE_ONLY) + private Boolean workItemIntegration; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "PowerBIIntegration", access = JsonProperty.Access.WRITE_ONLY) + private Boolean powerBIIntegration; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "OpenSchema", access = JsonProperty.Access.WRITE_ONLY) + private Boolean openSchema; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "ProactiveDetection", access = JsonProperty.Access.WRITE_ONLY) + private Boolean proactiveDetection; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "AnalyticsIntegration", access = JsonProperty.Access.WRITE_ONLY) + private Boolean analyticsIntegration; + + /** + * Whether allow to use multiple steps web test feature. + */ + @JsonProperty(value = "MultipleStepWebTest", access = JsonProperty.Access.WRITE_ONLY) + private Boolean multipleStepWebTest; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "ApiAccessLevel", access = JsonProperty.Access.WRITE_ONLY) + private String apiAccessLevel; + + /** + * The application insights component used tracking type. + */ + @JsonProperty(value = "TrackingType", access = JsonProperty.Access.WRITE_ONLY) + private String trackingType; + + /** + * Daily data volume cap in GB. + */ + @JsonProperty(value = "DailyCap", access = JsonProperty.Access.WRITE_ONLY) + private Double dailyCap; + + /** + * Daily data volume cap UTC reset hour. + */ + @JsonProperty(value = "DailyCapResetTime", access = JsonProperty.Access.WRITE_ONLY) + private Double dailyCapResetTime; + + /** + * Reserved, not used now. + */ + @JsonProperty(value = "ThrottleRate", access = JsonProperty.Access.WRITE_ONLY) + private Double throttleRate; + + /** + * Get whether allow to use continuous export feature. + * + * @return the supportExportData value + */ + public Boolean supportExportData() { + return this.supportExportData; + } + + /** + * Get reserved, not used now. + * + * @return the burstThrottlePolicy value + */ + public String burstThrottlePolicy() { + return this.burstThrottlePolicy; + } + + /** + * Get reserved, not used now. + * + * @return the metadataClass value + */ + public String metadataClass() { + return this.metadataClass; + } + + /** + * Get reserved, not used now. + * + * @return the liveStreamMetrics value + */ + public Boolean liveStreamMetrics() { + return this.liveStreamMetrics; + } + + /** + * Get reserved, not used now. + * + * @return the applicationMap value + */ + public Boolean applicationMap() { + return this.applicationMap; + } + + /** + * Get whether allow to use work item integration feature. + * + * @return the workItemIntegration value + */ + public Boolean workItemIntegration() { + return this.workItemIntegration; + } + + /** + * Get reserved, not used now. + * + * @return the powerBIIntegration value + */ + public Boolean powerBIIntegration() { + return this.powerBIIntegration; + } + + /** + * Get reserved, not used now. + * + * @return the openSchema value + */ + public Boolean openSchema() { + return this.openSchema; + } + + /** + * Get reserved, not used now. + * + * @return the proactiveDetection value + */ + public Boolean proactiveDetection() { + return this.proactiveDetection; + } + + /** + * Get reserved, not used now. + * + * @return the analyticsIntegration value + */ + public Boolean analyticsIntegration() { + return this.analyticsIntegration; + } + + /** + * Get whether allow to use multiple steps web test feature. + * + * @return the multipleStepWebTest value + */ + public Boolean multipleStepWebTest() { + return this.multipleStepWebTest; + } + + /** + * Get reserved, not used now. + * + * @return the apiAccessLevel value + */ + public String apiAccessLevel() { + return this.apiAccessLevel; + } + + /** + * Get the application insights component used tracking type. + * + * @return the trackingType value + */ + public String trackingType() { + return this.trackingType; + } + + /** + * Get daily data volume cap in GB. + * + * @return the dailyCap value + */ + public Double dailyCap() { + return this.dailyCap; + } + + /** + * Get daily data volume cap UTC reset hour. + * + * @return the dailyCapResetTime value + */ + public Double dailyCapResetTime() { + return this.dailyCapResetTime; + } + + /** + * Get reserved, not used now. + * + * @return the throttleRate value + */ + public Double throttleRate() { + return this.throttleRate; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentImpl.java new file mode 100644 index 000000000000..3e29029247e9 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationType; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.FlowType; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.RequestSource; +import org.joda.time.DateTime; + +class ApplicationInsightsComponentImpl extends GroupableResourceCoreImpl implements ApplicationInsightsComponent, ApplicationInsightsComponent.Definition, ApplicationInsightsComponent.Update { + ApplicationInsightsComponentImpl(String name, ApplicationInsightsComponentInner inner, InsightsManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + ComponentsInner client = this.manager().inner().components(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ComponentsInner client = this.manager().inner().components(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ComponentsInner client = this.manager().inner().components(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String appId() { + return this.inner().appId(); + } + + @Override + public String applicationId() { + return this.inner().applicationId(); + } + + @Override + public ApplicationType applicationType() { + return this.inner().applicationType(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public FlowType flowType() { + return this.inner().flowType(); + } + + @Override + public String hockeyAppId() { + return this.inner().hockeyAppId(); + } + + @Override + public String hockeyAppToken() { + return this.inner().hockeyAppToken(); + } + + @Override + public String instrumentationKey() { + return this.inner().instrumentationKey(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RequestSource requestSource() { + return this.inner().requestSource(); + } + + @Override + public Double samplingPercentage() { + return this.inner().samplingPercentage(); + } + + @Override + public String tenantId() { + return this.inner().tenantId(); + } + + @Override + public ApplicationInsightsComponentImpl withApplicationType(ApplicationType applicationType) { + this.inner().withApplicationType(applicationType); + return this; + } + + @Override + public ApplicationInsightsComponentImpl withKind(String kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public ApplicationInsightsComponentImpl withFlowType(FlowType flowType) { + this.inner().withFlowType(flowType); + return this; + } + + @Override + public ApplicationInsightsComponentImpl withHockeyAppId(String hockeyAppId) { + this.inner().withHockeyAppId(hockeyAppId); + return this; + } + + @Override + public ApplicationInsightsComponentImpl withRequestSource(RequestSource requestSource) { + this.inner().withRequestSource(requestSource); + return this; + } + + @Override + public ApplicationInsightsComponentImpl withSamplingPercentage(Double samplingPercentage) { + this.inner().withSamplingPercentage(samplingPercentage); + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentInner.java new file mode 100644 index 000000000000..dc6ae4313b77 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentInner.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationType; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.FlowType; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.RequestSource; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentsResource; + +/** + * An Application Insights component definition. + */ +@JsonFlatten +public class ApplicationInsightsComponentInner extends ComponentsResource { + /** + * The kind of application that this component refers to, used to customize + * UI. This value is a freeform string, values should typically be one of + * the following: web, ios, other, store, java, phone. + */ + @JsonProperty(value = "kind", required = true) + private String kind; + + /** + * The unique ID of your application. This field mirrors the 'Name' field + * and cannot be changed. + */ + @JsonProperty(value = "properties.ApplicationId", access = JsonProperty.Access.WRITE_ONLY) + private String applicationId; + + /** + * Application Insights Unique ID for your Application. + */ + @JsonProperty(value = "properties.AppId", access = JsonProperty.Access.WRITE_ONLY) + private String appId; + + /** + * Type of application being monitored. Possible values include: 'web', + * 'other'. + */ + @JsonProperty(value = "properties.Application_Type", required = true) + private ApplicationType applicationType; + + /** + * Used by the Application Insights system to determine what kind of flow + * this component was created by. This is to be set to 'Bluefield' when + * creating/updating a component via the REST API. Possible values include: + * 'Bluefield'. + */ + @JsonProperty(value = "properties.Flow_Type") + private FlowType flowType; + + /** + * Describes what tool created this Application Insights component. + * Customers using this API should set this to the default 'rest'. Possible + * values include: 'rest'. + */ + @JsonProperty(value = "properties.Request_Source") + private RequestSource requestSource; + + /** + * Application Insights Instrumentation key. A read-only value that + * applications can use to identify the destination for all telemetry sent + * to Azure Application Insights. This value will be supplied upon + * construction of each new Application Insights component. + */ + @JsonProperty(value = "properties.InstrumentationKey", access = JsonProperty.Access.WRITE_ONLY) + private String instrumentationKey; + + /** + * Creation Date for the Application Insights component, in ISO 8601 + * format. + */ + @JsonProperty(value = "properties.CreationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * Azure Tenant Id. + */ + @JsonProperty(value = "properties.TenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The unique application ID created when a new application is added to + * HockeyApp, used for communications with HockeyApp. + */ + @JsonProperty(value = "properties.HockeyAppId") + private String hockeyAppId; + + /** + * Token used to authenticate communications with between Application + * Insights and HockeyApp. + */ + @JsonProperty(value = "properties.HockeyAppToken", access = JsonProperty.Access.WRITE_ONLY) + private String hockeyAppToken; + + /** + * Current state of this component: whether or not is has been provisioned + * within the resource group it is defined. Users cannot change this value + * but are able to read from it. Values will include Succeeded, Deploying, + * Canceled, and Failed. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Percentage of the data produced by the application being monitored that + * is being sampled for Application Insights telemetry. + */ + @JsonProperty(value = "properties.SamplingPercentage") + private Double samplingPercentage; + + /** + * Get the kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + * + * @param kind the kind value to set + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + * + * @return the applicationId value + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Get application Insights Unique ID for your Application. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Get type of application being monitored. Possible values include: 'web', 'other'. + * + * @return the applicationType value + */ + public ApplicationType applicationType() { + return this.applicationType; + } + + /** + * Set type of application being monitored. Possible values include: 'web', 'other'. + * + * @param applicationType the applicationType value to set + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withApplicationType(ApplicationType applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. Possible values include: 'Bluefield'. + * + * @return the flowType value + */ + public FlowType flowType() { + return this.flowType; + } + + /** + * Set used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. Possible values include: 'Bluefield'. + * + * @param flowType the flowType value to set + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withFlowType(FlowType flowType) { + this.flowType = flowType; + return this; + } + + /** + * Get describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. Possible values include: 'rest'. + * + * @return the requestSource value + */ + public RequestSource requestSource() { + return this.requestSource; + } + + /** + * Set describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. Possible values include: 'rest'. + * + * @param requestSource the requestSource value to set + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withRequestSource(RequestSource requestSource) { + this.requestSource = requestSource; + return this; + } + + /** + * Get application Insights Instrumentation key. A read-only value that applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application Insights component. + * + * @return the instrumentationKey value + */ + public String instrumentationKey() { + return this.instrumentationKey; + } + + /** + * Get creation Date for the Application Insights component, in ISO 8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get azure Tenant Id. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + * + * @return the hockeyAppId value + */ + public String hockeyAppId() { + return this.hockeyAppId; + } + + /** + * Set the unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + * + * @param hockeyAppId the hockeyAppId value to set + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withHockeyAppId(String hockeyAppId) { + this.hockeyAppId = hockeyAppId; + return this; + } + + /** + * Get token used to authenticate communications with between Application Insights and HockeyApp. + * + * @return the hockeyAppToken value + */ + public String hockeyAppToken() { + return this.hockeyAppToken; + } + + /** + * Get current state of this component: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + * + * @return the samplingPercentage value + */ + public Double samplingPercentage() { + return this.samplingPercentage; + } + + /** + * Set percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + * + * @param samplingPercentage the samplingPercentage value to set + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withSamplingPercentage(Double samplingPercentage) { + this.samplingPercentage = samplingPercentage; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentProactiveDetectionConfigurationImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentProactiveDetectionConfigurationImpl.java new file mode 100644 index 000000000000..0b7202b4e65b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentProactiveDetectionConfigurationImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentProactiveDetectionConfiguration; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; + +class ApplicationInsightsComponentProactiveDetectionConfigurationImpl extends WrapperImpl implements ApplicationInsightsComponentProactiveDetectionConfiguration { + private final InsightsManager manager; + private String resourceGroupName; + private String resourceName; + private String configurationId; + + ApplicationInsightsComponentProactiveDetectionConfigurationImpl(ApplicationInsightsComponentProactiveDetectionConfigurationInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + + + @Override + public List customEmails() { + return this.inner().customEmails(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String lastUpdatedTime() { + return this.inner().lastUpdatedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions ruleDefinitions() { + return this.inner().ruleDefinitions(); + } + + @Override + public Boolean sendEmailsToSubscriptionOwners() { + return this.inner().sendEmailsToSubscriptionOwners(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentProactiveDetectionConfigurationInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentProactiveDetectionConfigurationInner.java new file mode 100644 index 000000000000..bbaf5c897c43 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentProactiveDetectionConfigurationInner.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that define a ProactiveDetection configuration. + */ +public class ApplicationInsightsComponentProactiveDetectionConfigurationInner { + /** + * The rule name. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * A flag that indicates whether this rule is enabled by the user. + */ + @JsonProperty(value = "Enabled") + private Boolean enabled; + + /** + * A flag that indicated whether notifications on this rule should be sent + * to subscription owners. + */ + @JsonProperty(value = "SendEmailsToSubscriptionOwners") + private Boolean sendEmailsToSubscriptionOwners; + + /** + * Custom email addresses for this rule notifications. + */ + @JsonProperty(value = "CustomEmails") + private List customEmails; + + /** + * The last time this rule was updated. + */ + @JsonProperty(value = "LastUpdatedTime") + private String lastUpdatedTime; + + /** + * Static definitions of the ProactiveDetection configuration rule (same + * values for all components). + */ + @JsonProperty(value = "RuleDefinitions") + private ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions ruleDefinitions; + + /** + * Get the rule name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the rule name. + * + * @param name the name value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationInner object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a flag that indicates whether this rule is enabled by the user. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set a flag that indicates whether this rule is enabled by the user. + * + * @param enabled the enabled value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationInner object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get a flag that indicated whether notifications on this rule should be sent to subscription owners. + * + * @return the sendEmailsToSubscriptionOwners value + */ + public Boolean sendEmailsToSubscriptionOwners() { + return this.sendEmailsToSubscriptionOwners; + } + + /** + * Set a flag that indicated whether notifications on this rule should be sent to subscription owners. + * + * @param sendEmailsToSubscriptionOwners the sendEmailsToSubscriptionOwners value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationInner object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner withSendEmailsToSubscriptionOwners(Boolean sendEmailsToSubscriptionOwners) { + this.sendEmailsToSubscriptionOwners = sendEmailsToSubscriptionOwners; + return this; + } + + /** + * Get custom email addresses for this rule notifications. + * + * @return the customEmails value + */ + public List customEmails() { + return this.customEmails; + } + + /** + * Set custom email addresses for this rule notifications. + * + * @param customEmails the customEmails value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationInner object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner withCustomEmails(List customEmails) { + this.customEmails = customEmails; + return this; + } + + /** + * Get the last time this rule was updated. + * + * @return the lastUpdatedTime value + */ + public String lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the last time this rule was updated. + * + * @param lastUpdatedTime the lastUpdatedTime value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationInner object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner withLastUpdatedTime(String lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get static definitions of the ProactiveDetection configuration rule (same values for all components). + * + * @return the ruleDefinitions value + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions ruleDefinitions() { + return this.ruleDefinitions; + } + + /** + * Set static definitions of the ProactiveDetection configuration rule (same values for all components). + * + * @param ruleDefinitions the ruleDefinitions value to set + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationInner object itself. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner withRuleDefinitions(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions ruleDefinitions) { + this.ruleDefinitions = ruleDefinitions; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentQuotaStatusImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentQuotaStatusImpl.java new file mode 100644 index 000000000000..1d9146597853 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentQuotaStatusImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentQuotaStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ApplicationInsightsComponentQuotaStatusImpl extends WrapperImpl implements ApplicationInsightsComponentQuotaStatus { + private final InsightsManager manager; + ApplicationInsightsComponentQuotaStatusImpl(ApplicationInsightsComponentQuotaStatusInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public String appId() { + return this.inner().appId(); + } + + @Override + public String expirationTime() { + return this.inner().expirationTime(); + } + + @Override + public Boolean shouldBeThrottled() { + return this.inner().shouldBeThrottled(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentQuotaStatusInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentQuotaStatusInner.java new file mode 100644 index 000000000000..436bad6ed29b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentQuotaStatusInner.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Application Insights component daily data volume cap status. + */ +public class ApplicationInsightsComponentQuotaStatusInner { + /** + * The Application ID for the Application Insights component. + */ + @JsonProperty(value = "AppId", access = JsonProperty.Access.WRITE_ONLY) + private String appId; + + /** + * The daily data volume cap is met, and data ingestion will be stopped. + */ + @JsonProperty(value = "ShouldBeThrottled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean shouldBeThrottled; + + /** + * Date and time when the daily data volume cap will be reset, and data + * ingestion will resume. + */ + @JsonProperty(value = "ExpirationTime", access = JsonProperty.Access.WRITE_ONLY) + private String expirationTime; + + /** + * Get the Application ID for the Application Insights component. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Get the daily data volume cap is met, and data ingestion will be stopped. + * + * @return the shouldBeThrottled value + */ + public Boolean shouldBeThrottled() { + return this.shouldBeThrottled; + } + + /** + * Get date and time when the daily data volume cap will be reset, and data ingestion will resume. + * + * @return the expirationTime value + */ + public String expirationTime() { + return this.expirationTime; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentWebTestLocationImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentWebTestLocationImpl.java new file mode 100644 index 000000000000..f89e3d71382e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentWebTestLocationImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentWebTestLocation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ApplicationInsightsComponentWebTestLocationImpl extends WrapperImpl implements ApplicationInsightsComponentWebTestLocation { + private final InsightsManager manager; + + ApplicationInsightsComponentWebTestLocationImpl(ApplicationInsightsComponentWebTestLocationInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String tag() { + return this.inner().tag(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentWebTestLocationInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentWebTestLocationInner.java new file mode 100644 index 000000000000..6195fad1ae2a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsComponentWebTestLocationInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that define a web test location available to an Application + * Insights Component. + */ +public class ApplicationInsightsComponentWebTestLocationInner { + /** + * The display name of the web test location. + */ + @JsonProperty(value = "DisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Internally defined geographic location tag. + */ + @JsonProperty(value = "Tag", access = JsonProperty.Access.WRITE_ONLY) + private String tag; + + /** + * Get the display name of the web test location. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get internally defined geographic location tag. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsManagementClientImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsManagementClientImpl.java new file mode 100644 index 000000000000..82897ab922d2 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ApplicationInsightsManagementClientImpl.java @@ -0,0 +1,406 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.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 ApplicationInsightsManagementClientImpl class. + */ +public class ApplicationInsightsManagementClientImpl 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; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ApplicationInsightsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ApplicationInsightsManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or 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 ApplicationInsightsManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** 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 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 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 ApplicationInsightsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * 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; + } + + /** + * The AnnotationsInner object to access its operations. + */ + private AnnotationsInner annotations; + + /** + * Gets the AnnotationsInner object to access its operations. + * @return the AnnotationsInner object. + */ + public AnnotationsInner annotations() { + return this.annotations; + } + + /** + * The APIKeysInner object to access its operations. + */ + private APIKeysInner aPIKeys; + + /** + * Gets the APIKeysInner object to access its operations. + * @return the APIKeysInner object. + */ + public APIKeysInner aPIKeys() { + return this.aPIKeys; + } + + /** + * The ExportConfigurationsInner object to access its operations. + */ + private ExportConfigurationsInner exportConfigurations; + + /** + * Gets the ExportConfigurationsInner object to access its operations. + * @return the ExportConfigurationsInner object. + */ + public ExportConfigurationsInner exportConfigurations() { + return this.exportConfigurations; + } + + /** + * The ComponentCurrentBillingFeaturesInner object to access its operations. + */ + private ComponentCurrentBillingFeaturesInner componentCurrentBillingFeatures; + + /** + * Gets the ComponentCurrentBillingFeaturesInner object to access its operations. + * @return the ComponentCurrentBillingFeaturesInner object. + */ + public ComponentCurrentBillingFeaturesInner componentCurrentBillingFeatures() { + return this.componentCurrentBillingFeatures; + } + + /** + * The ComponentQuotaStatusInner object to access its operations. + */ + private ComponentQuotaStatusInner componentQuotaStatus; + + /** + * Gets the ComponentQuotaStatusInner object to access its operations. + * @return the ComponentQuotaStatusInner object. + */ + public ComponentQuotaStatusInner componentQuotaStatus() { + return this.componentQuotaStatus; + } + + /** + * The ComponentFeatureCapabilitiesInner object to access its operations. + */ + private ComponentFeatureCapabilitiesInner componentFeatureCapabilities; + + /** + * Gets the ComponentFeatureCapabilitiesInner object to access its operations. + * @return the ComponentFeatureCapabilitiesInner object. + */ + public ComponentFeatureCapabilitiesInner componentFeatureCapabilities() { + return this.componentFeatureCapabilities; + } + + /** + * The ComponentAvailableFeaturesInner object to access its operations. + */ + private ComponentAvailableFeaturesInner componentAvailableFeatures; + + /** + * Gets the ComponentAvailableFeaturesInner object to access its operations. + * @return the ComponentAvailableFeaturesInner object. + */ + public ComponentAvailableFeaturesInner componentAvailableFeatures() { + return this.componentAvailableFeatures; + } + + /** + * The ProactiveDetectionConfigurationsInner object to access its operations. + */ + private ProactiveDetectionConfigurationsInner proactiveDetectionConfigurations; + + /** + * Gets the ProactiveDetectionConfigurationsInner object to access its operations. + * @return the ProactiveDetectionConfigurationsInner object. + */ + public ProactiveDetectionConfigurationsInner proactiveDetectionConfigurations() { + return this.proactiveDetectionConfigurations; + } + + /** + * The ComponentsInner object to access its operations. + */ + private ComponentsInner components; + + /** + * Gets the ComponentsInner object to access its operations. + * @return the ComponentsInner object. + */ + public ComponentsInner components() { + return this.components; + } + + /** + * The WorkItemConfigurationsInner object to access its operations. + */ + private WorkItemConfigurationsInner workItemConfigurations; + + /** + * Gets the WorkItemConfigurationsInner object to access its operations. + * @return the WorkItemConfigurationsInner object. + */ + public WorkItemConfigurationsInner workItemConfigurations() { + return this.workItemConfigurations; + } + + /** + * The FavoritesInner object to access its operations. + */ + private FavoritesInner favorites; + + /** + * Gets the FavoritesInner object to access its operations. + * @return the FavoritesInner object. + */ + public FavoritesInner favorites() { + return this.favorites; + } + + /** + * The WebTestLocationsInner object to access its operations. + */ + private WebTestLocationsInner webTestLocations; + + /** + * Gets the WebTestLocationsInner object to access its operations. + * @return the WebTestLocationsInner object. + */ + public WebTestLocationsInner webTestLocations() { + return this.webTestLocations; + } + + /** + * The WebTestsInner object to access its operations. + */ + private WebTestsInner webTests; + + /** + * Gets the WebTestsInner object to access its operations. + * @return the WebTestsInner object. + */ + public WebTestsInner webTests() { + return this.webTests; + } + + /** + * The AnalyticsItemsInner object to access its operations. + */ + private AnalyticsItemsInner analyticsItems; + + /** + * Gets the AnalyticsItemsInner object to access its operations. + * @return the AnalyticsItemsInner object. + */ + public AnalyticsItemsInner analyticsItems() { + return this.analyticsItems; + } + + /** + * The WorkbooksInner object to access its operations. + */ + private WorkbooksInner workbooks; + + /** + * Gets the WorkbooksInner object to access its operations. + * @return the WorkbooksInner object. + */ + public WorkbooksInner workbooks() { + return this.workbooks; + } + + /** + * Initializes an instance of ApplicationInsightsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ApplicationInsightsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ApplicationInsightsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ApplicationInsightsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ApplicationInsightsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ApplicationInsightsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-05-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.annotations = new AnnotationsInner(restClient().retrofit(), this); + this.aPIKeys = new APIKeysInner(restClient().retrofit(), this); + this.exportConfigurations = new ExportConfigurationsInner(restClient().retrofit(), this); + this.componentCurrentBillingFeatures = new ComponentCurrentBillingFeaturesInner(restClient().retrofit(), this); + this.componentQuotaStatus = new ComponentQuotaStatusInner(restClient().retrofit(), this); + this.componentFeatureCapabilities = new ComponentFeatureCapabilitiesInner(restClient().retrofit(), this); + this.componentAvailableFeatures = new ComponentAvailableFeaturesInner(restClient().retrofit(), this); + this.proactiveDetectionConfigurations = new ProactiveDetectionConfigurationsInner(restClient().retrofit(), this); + this.components = new ComponentsInner(restClient().retrofit(), this); + this.workItemConfigurations = new WorkItemConfigurationsInner(restClient().retrofit(), this); + this.favorites = new FavoritesInner(restClient().retrofit(), this); + this.webTestLocations = new WebTestLocationsInner(restClient().retrofit(), this); + this.webTests = new WebTestsInner(restClient().retrofit(), this); + this.analyticsItems = new AnalyticsItemsInner(restClient().retrofit(), this); + this.workbooks = new WorkbooksInner(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)", super.userAgent(), "ApplicationInsightsManagementClient", "2015-05-01"); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesImpl.java new file mode 100644 index 000000000000..bd1346bd1e23 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentAvailableFeatures; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentAvailableFeatures; + +class ComponentAvailableFeaturesImpl extends WrapperImpl implements ComponentAvailableFeatures { + private final InsightsManager manager; + + ComponentAvailableFeaturesImpl(InsightsManager manager) { + super(manager.inner().componentAvailableFeatures()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName) { + ComponentAvailableFeaturesInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public ApplicationInsightsComponentAvailableFeatures call(ApplicationInsightsComponentAvailableFeaturesInner inner) { + return new ApplicationInsightsComponentAvailableFeaturesImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesInner.java new file mode 100644 index 000000000000..9f313fbff38e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentAvailableFeaturesInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.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.Path; +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 ComponentAvailableFeatures. + */ +public class ComponentAvailableFeaturesInner { + /** The Retrofit service to perform REST calls. */ + private ComponentAvailableFeaturesService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ComponentAvailableFeaturesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ComponentAvailableFeaturesInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(ComponentAvailableFeaturesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ComponentAvailableFeatures to be + * used by Retrofit to perform actually REST calls. + */ + interface ComponentAvailableFeaturesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentAvailableFeatures get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns all available features of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 ApplicationInsightsComponentAvailableFeaturesInner object if successful. + */ + public ApplicationInsightsComponentAvailableFeaturesInner get(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Returns all available features of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Returns all available features of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAvailableFeaturesInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, ApplicationInsightsComponentAvailableFeaturesInner>() { + @Override + public ApplicationInsightsComponentAvailableFeaturesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns all available features of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentAvailableFeaturesInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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, this.client.subscriptionId(), resourceName, 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); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesImpl.java new file mode 100644 index 000000000000..5532e288cafd --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesImpl.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentCurrentBillingFeatures; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentBillingFeatures; + +class ComponentCurrentBillingFeaturesImpl extends WrapperImpl implements ComponentCurrentBillingFeatures { + private final InsightsManager manager; + + ComponentCurrentBillingFeaturesImpl(InsightsManager manager) { + super(manager.inner().componentCurrentBillingFeatures()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName) { + ComponentCurrentBillingFeaturesInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public ApplicationInsightsComponentBillingFeatures call(ApplicationInsightsComponentBillingFeaturesInner inner) { + return new ApplicationInsightsComponentBillingFeaturesImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties) { + ComponentCurrentBillingFeaturesInner client = this.inner(); + return client.updateAsync(resourceGroupName, resourceName, billingFeaturesProperties) + .map(new Func1() { + @Override + public ApplicationInsightsComponentBillingFeatures call(ApplicationInsightsComponentBillingFeaturesInner inner) { + return new ApplicationInsightsComponentBillingFeaturesImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java new file mode 100644 index 000000000000..3eee7e2e04c6 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java @@ -0,0 +1,247 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.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.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 ComponentCurrentBillingFeatures. + */ +public class ComponentCurrentBillingFeaturesInner { + /** The Retrofit service to perform REST calls. */ + private ComponentCurrentBillingFeaturesService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ComponentCurrentBillingFeaturesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ComponentCurrentBillingFeaturesInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(ComponentCurrentBillingFeaturesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ComponentCurrentBillingFeatures to be + * used by Retrofit to perform actually REST calls. + */ + interface ComponentCurrentBillingFeaturesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentCurrentBillingFeatures get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.ComponentCurrentBillingFeatures update" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 ApplicationInsightsComponentBillingFeaturesInner object if successful. + */ + public ApplicationInsightsComponentBillingFeaturesInner get(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Returns current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Returns current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentBillingFeaturesInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, ApplicationInsightsComponentBillingFeaturesInner>() { + @Override + public ApplicationInsightsComponentBillingFeaturesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentBillingFeaturesInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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, this.client.subscriptionId(), resourceName, 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); + } + + /** + * Update current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param billingFeaturesProperties Properties that need to be specified to update billing features for an Application Insights component. + * @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 ApplicationInsightsComponentBillingFeaturesInner object if successful. + */ + public ApplicationInsightsComponentBillingFeaturesInner update(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, billingFeaturesProperties).toBlocking().single().body(); + } + + /** + * Update current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param billingFeaturesProperties Properties that need to be specified to update billing features for an Application Insights component. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, billingFeaturesProperties), serviceCallback); + } + + /** + * Update current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param billingFeaturesProperties Properties that need to be specified to update billing features for an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentBillingFeaturesInner object + */ + public Observable updateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, billingFeaturesProperties).map(new Func1, ApplicationInsightsComponentBillingFeaturesInner>() { + @Override + public ApplicationInsightsComponentBillingFeaturesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update current billing features for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param billingFeaturesProperties Properties that need to be specified to update billing features for an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentBillingFeaturesInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentBillingFeaturesInner billingFeaturesProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (billingFeaturesProperties == null) { + throw new IllegalArgumentException("Parameter billingFeaturesProperties is required and cannot be null."); + } + Validator.validate(billingFeaturesProperties); + return service.update(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), billingFeaturesProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesImpl.java new file mode 100644 index 000000000000..21ac989da398 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentFeatureCapabilities; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentFeatureCapabilities; + +class ComponentFeatureCapabilitiesImpl extends WrapperImpl implements ComponentFeatureCapabilities { + private final InsightsManager manager; + + ComponentFeatureCapabilitiesImpl(InsightsManager manager) { + super(manager.inner().componentFeatureCapabilities()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName) { + ComponentFeatureCapabilitiesInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public ApplicationInsightsComponentFeatureCapabilities call(ApplicationInsightsComponentFeatureCapabilitiesInner inner) { + return new ApplicationInsightsComponentFeatureCapabilitiesImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesInner.java new file mode 100644 index 000000000000..f549d06d1986 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.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.Path; +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 ComponentFeatureCapabilities. + */ +public class ComponentFeatureCapabilitiesInner { + /** The Retrofit service to perform REST calls. */ + private ComponentFeatureCapabilitiesService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ComponentFeatureCapabilitiesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ComponentFeatureCapabilitiesInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(ComponentFeatureCapabilitiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ComponentFeatureCapabilities to be + * used by Retrofit to perform actually REST calls. + */ + interface ComponentFeatureCapabilitiesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentFeatureCapabilities get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns feature capabilities of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 ApplicationInsightsComponentFeatureCapabilitiesInner object if successful. + */ + public ApplicationInsightsComponentFeatureCapabilitiesInner get(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Returns feature capabilities of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Returns feature capabilities of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFeatureCapabilitiesInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, ApplicationInsightsComponentFeatureCapabilitiesInner>() { + @Override + public ApplicationInsightsComponentFeatureCapabilitiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns feature capabilities of the application insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFeatureCapabilitiesInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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, this.client.subscriptionId(), resourceName, 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); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeResponseImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeResponseImpl.java new file mode 100644 index 000000000000..342b5082908d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeResponseImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentPurgeResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ComponentPurgeResponseImpl extends WrapperImpl implements ComponentPurgeResponse { + private final InsightsManager manager; + ComponentPurgeResponseImpl(ComponentPurgeResponseInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public String operationId() { + return this.inner().operationId(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeResponseInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeResponseInner.java new file mode 100644 index 000000000000..cfd10468f8b9 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeResponseInner.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.applicationinsights.v2015_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response containing operationId for a specific purge action. + */ +public class ComponentPurgeResponseInner { + /** + * 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 ComponentPurgeResponseInner object itself. + */ + public ComponentPurgeResponseInner withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeStatusResponseImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeStatusResponseImpl.java new file mode 100644 index 000000000000..48987c97a14d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeStatusResponseImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentPurgeStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.PurgeState; + +class ComponentPurgeStatusResponseImpl extends WrapperImpl implements ComponentPurgeStatusResponse { + private final InsightsManager manager; + private String resourceGroupName; + private String resourceName; + private String purgeId; + + ComponentPurgeStatusResponseImpl(ComponentPurgeStatusResponseInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + + + @Override + public PurgeState status() { + return this.inner().status(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeStatusResponseInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeStatusResponseInner.java new file mode 100644 index 000000000000..0114ebf41efe --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentPurgeStatusResponseInner.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.PurgeState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response containing status for a specific purge operation. + */ +public class ComponentPurgeStatusResponseInner { + /** + * 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 ComponentPurgeStatusResponseInner object itself. + */ + public ComponentPurgeStatusResponseInner withStatus(PurgeState status) { + this.status = status; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusImpl.java new file mode 100644 index 000000000000..b50feeab9772 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentQuotaStatus; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentQuotaStatus; + +class ComponentQuotaStatusImpl extends WrapperImpl implements ComponentQuotaStatus { + private final InsightsManager manager; + + ComponentQuotaStatusImpl(InsightsManager manager) { + super(manager.inner().componentQuotaStatus()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName) { + ComponentQuotaStatusInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public ApplicationInsightsComponentQuotaStatus call(ApplicationInsightsComponentQuotaStatusInner inner) { + return new ApplicationInsightsComponentQuotaStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusInner.java new file mode 100644 index 000000000000..e17c45893b81 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.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.Path; +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 ComponentQuotaStatus. + */ +public class ComponentQuotaStatusInner { + /** The Retrofit service to perform REST calls. */ + private ComponentQuotaStatusService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ComponentQuotaStatusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ComponentQuotaStatusInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(ComponentQuotaStatusService.class); + this.client = client; + } + + /** + * The interface defining all the services for ComponentQuotaStatus to be + * used by Retrofit to perform actually REST calls. + */ + interface ComponentQuotaStatusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentQuotaStatus get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns daily data volume cap (quota) status for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 ApplicationInsightsComponentQuotaStatusInner object if successful. + */ + public ApplicationInsightsComponentQuotaStatusInner get(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Returns daily data volume cap (quota) status for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Returns daily data volume cap (quota) status for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentQuotaStatusInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, ApplicationInsightsComponentQuotaStatusInner>() { + @Override + public ApplicationInsightsComponentQuotaStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns daily data volume cap (quota) status for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentQuotaStatusInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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, this.client.subscriptionId(), resourceName, 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); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsImpl.java new file mode 100644 index 000000000000..502e5b99edd3 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsImpl.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Components; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponent; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentPurgeResponse; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentPurgeBody; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentPurgeStatusResponse; + +class ComponentsImpl extends GroupableResourcesCoreImpl implements Components { + protected ComponentsImpl(InsightsManager manager) { + super(manager.inner().components(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ComponentsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ComponentsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ComponentsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ComponentsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponent call(ApplicationInsightsComponentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ComponentsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ComponentsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponent call(ApplicationInsightsComponentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationInsightsComponentImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable purgeAsync(String resourceGroupName, String resourceName, ComponentPurgeBody body) { + ComponentsInner client = this.inner(); + return client.purgeAsync(resourceGroupName, resourceName, body) + .map(new Func1() { + @Override + public ComponentPurgeResponse call(ComponentPurgeResponseInner inner) { + return new ComponentPurgeResponseImpl(inner, manager()); + } + }); + } + + @Override + protected ApplicationInsightsComponentImpl wrapModel(ApplicationInsightsComponentInner inner) { + return new ApplicationInsightsComponentImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationInsightsComponentImpl wrapModel(String name) { + return new ApplicationInsightsComponentImpl(name, new ApplicationInsightsComponentInner(), this.manager()); + } + + private ComponentPurgeStatusResponseImpl wrapComponentPurgeStatusResponseModel(ComponentPurgeStatusResponseInner inner) { + return new ComponentPurgeStatusResponseImpl(inner, manager()); + } + + private Observable getComponentPurgeStatusResponseInnerUsingComponentsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String resourceName = IdParsingUtils.getValueFromIdByName(id, "components"); + String purgeId = IdParsingUtils.getValueFromIdByName(id, "operations"); + ComponentsInner client = this.inner(); + return client.getPurgeStatusAsync(resourceGroupName, resourceName, purgeId); + } + + @Override + public Observable getPurgeStatusAsync(String resourceGroupName, String resourceName, String purgeId) { + ComponentsInner client = this.inner(); + return client.getPurgeStatusAsync(resourceGroupName, resourceName, purgeId) + .map(new Func1() { + @Override + public ComponentPurgeStatusResponse call(ComponentPurgeStatusResponseInner inner) { + return wrapComponentPurgeStatusResponseModel(inner); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java new file mode 100644 index 000000000000..df6437a50ed0 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java @@ -0,0 +1,1186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentPurgeBody; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.TagsResource; +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 java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.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 Components. + */ +public class ComponentsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ComponentsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ComponentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ComponentsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(ComponentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Components to be + * used by Retrofit to perform actually REST calls. + */ + interface ComponentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.Components list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Insights/components") + 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.applicationinsights.v2015_05_01.Components listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.Components delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.Components getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.Components createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ApplicationInsightsComponentInner insightProperties, @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.applicationinsights.v2015_05_01.Components updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsResource componentTags, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.Components purge" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge") + Observable> purge(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ComponentPurgeBody 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.applicationinsights.v2015_05_01.Components getPurgeStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}") + Observable> getPurgeStatus(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.Components listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.applicationinsights.v2015_05_01.Components listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationInsightsComponentInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInsightsComponentInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInsightsComponentInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInsightsComponentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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<ApplicationInsightsComponentInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInsightsComponentInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInsightsComponentInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInsightsComponentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Deletes an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Deletes an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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, this.client.subscriptionId(), resourceName, 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); + } + + /** + * Returns an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 ApplicationInsightsComponentInner object if successful. + */ + public ApplicationInsightsComponentInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Returns an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 getByResourceGroupAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Returns an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, ApplicationInsightsComponentInner>() { + @Override + public ApplicationInsightsComponentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param insightProperties Properties that need to be specified to create an Application Insights component. + * @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 ApplicationInsightsComponentInner object if successful. + */ + public ApplicationInsightsComponentInner createOrUpdate(String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, insightProperties).toBlocking().single().body(); + } + + /** + * Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param insightProperties Properties that need to be specified to create an Application Insights component. + * @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 resourceName, ApplicationInsightsComponentInner insightProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, insightProperties), serviceCallback); + } + + /** + * Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param insightProperties Properties that need to be specified to create an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, insightProperties).map(new Func1, ApplicationInsightsComponentInner>() { + @Override + public ApplicationInsightsComponentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param insightProperties Properties that need to be specified to create an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (insightProperties == null) { + throw new IllegalArgumentException("Parameter insightProperties is required and cannot be null."); + } + Validator.validate(insightProperties); + return service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), insightProperties, 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); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 ApplicationInsightsComponentInner object if successful. + */ + public ApplicationInsightsComponentInner updateTags(String resourceGroupName, String resourceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 updateTagsAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String resourceName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, ApplicationInsightsComponentInner>() { + @Override + public ApplicationInsightsComponentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + TagsResource componentTags = new TagsResource(); + componentTags.withTags(null); + return service.updateTags(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), this.client.acceptLanguage(), componentTags, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param tags Resource tags + * @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 ApplicationInsightsComponentInner object if successful. + */ + public ApplicationInsightsComponentInner updateTags(String resourceGroupName, String resourceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, resourceName, tags).toBlocking().single().body(); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param tags Resource tags + * @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 updateTagsAsync(String resourceGroupName, String resourceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String resourceName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, resourceName, tags).map(new Func1, ApplicationInsightsComponentInner>() { + @Override + public ApplicationInsightsComponentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String resourceName, Map tags) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(tags); + TagsResource componentTags = new TagsResource(); + componentTags.withTags(tags); + return service.updateTags(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), this.client.acceptLanguage(), componentTags, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(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 Application Insights component by a set of user-defined filters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param body Describes the body of a request to purge data in a single table of an Application Insights component + * @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 ComponentPurgeResponseInner object if successful. + */ + public ComponentPurgeResponseInner purge(String resourceGroupName, String resourceName, ComponentPurgeBody body) { + return purgeWithServiceResponseAsync(resourceGroupName, resourceName, body).toBlocking().single().body(); + } + + /** + * Purges data in an Application Insights component by a set of user-defined filters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param body Describes the body of a request to purge data in a single table of an Application Insights component + * @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 resourceName, ComponentPurgeBody body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(purgeWithServiceResponseAsync(resourceGroupName, resourceName, body), serviceCallback); + } + + /** + * Purges data in an Application Insights component by a set of user-defined filters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param body Describes the body of a request to purge data in a single table of an Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComponentPurgeResponseInner object + */ + public Observable purgeAsync(String resourceGroupName, String resourceName, ComponentPurgeBody body) { + return purgeWithServiceResponseAsync(resourceGroupName, resourceName, body).map(new Func1, ComponentPurgeResponseInner>() { + @Override + public ComponentPurgeResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Purges data in an Application Insights component by a set of user-defined filters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param body Describes the body of a request to purge data in a single table of an Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComponentPurgeResponseInner object + */ + public Observable> purgeWithServiceResponseAsync(String resourceGroupName, String resourceName, ComponentPurgeBody 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(), resourceName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = purgeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse purgeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get status for an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @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 ComponentPurgeStatusResponseInner object if successful. + */ + public ComponentPurgeStatusResponseInner getPurgeStatus(String resourceGroupName, String resourceName, String purgeId) { + return getPurgeStatusWithServiceResponseAsync(resourceGroupName, resourceName, purgeId).toBlocking().single().body(); + } + + /** + * Get status for an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @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 resourceName, String purgeId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPurgeStatusWithServiceResponseAsync(resourceGroupName, resourceName, purgeId), serviceCallback); + } + + /** + * Get status for an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComponentPurgeStatusResponseInner object + */ + public Observable getPurgeStatusAsync(String resourceGroupName, String resourceName, String purgeId) { + return getPurgeStatusWithServiceResponseAsync(resourceGroupName, resourceName, purgeId).map(new Func1, ComponentPurgeStatusResponseInner>() { + @Override + public ComponentPurgeStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get status for an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComponentPurgeStatusResponseInner object + */ + public Observable> getPurgeStatusWithServiceResponseAsync(String resourceGroupName, String resourceName, String purgeId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (purgeId == null) { + throw new IllegalArgumentException("Parameter 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(), resourceName, 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 a list of all Application Insights components within a subscription. + * + * @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<ApplicationInsightsComponentInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @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<ApplicationInsightsComponentInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + * @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<ApplicationInsightsComponentInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all Application Insights components within a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInsightsComponentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @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<ApplicationInsightsComponentInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @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<ApplicationInsightsComponentInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + * @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<ApplicationInsightsComponentInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of Application Insights components within a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInsightsComponentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsImpl.java new file mode 100644 index 000000000000..168b0e420f17 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentExportConfiguration; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentExportRequest; + +class ExportConfigurationsImpl extends WrapperImpl implements ExportConfigurations { + private final InsightsManager manager; + + ExportConfigurationsImpl(InsightsManager manager) { + super(manager.inner().exportConfigurations()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + ExportConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponentExportConfiguration call(ApplicationInsightsComponentExportConfigurationInner inner) { + return new ApplicationInsightsComponentExportConfigurationImpl(inner, manager()); + } + }); + } + + @Override + public Observable createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) { + ExportConfigurationsInner client = this.inner(); + return client.createAsync(resourceGroupName, resourceName, exportProperties) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponentExportConfiguration call(ApplicationInsightsComponentExportConfigurationInner inner) { + return new ApplicationInsightsComponentExportConfigurationImpl(inner, manager()); + } + }); + } + + @Override + public Observable deleteAsync(String resourceGroupName, String resourceName, String exportId) { + ExportConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, exportId) + .map(new Func1() { + @Override + public ApplicationInsightsComponentExportConfiguration call(ApplicationInsightsComponentExportConfigurationInner inner) { + return new ApplicationInsightsComponentExportConfigurationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String exportId) { + ExportConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, exportId) + .map(new Func1() { + @Override + public ApplicationInsightsComponentExportConfiguration call(ApplicationInsightsComponentExportConfigurationInner inner) { + return new ApplicationInsightsComponentExportConfigurationImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateAsync(String resourceGroupName, String resourceName, String exportId, ApplicationInsightsComponentExportRequest exportProperties) { + ExportConfigurationsInner client = this.inner(); + return client.updateAsync(resourceGroupName, resourceName, exportId, exportProperties) + .map(new Func1() { + @Override + public ApplicationInsightsComponentExportConfiguration call(ApplicationInsightsComponentExportConfigurationInner inner) { + return new ApplicationInsightsComponentExportConfigurationImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java new file mode 100644 index 000000000000..2eef319fdc72 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java @@ -0,0 +1,550 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentExportRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExportConfigurations. + */ +public class ExportConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ExportConfigurationsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ExportConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExportConfigurationsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(ExportConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExportConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ExportConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.ExportConfigurations create" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body ApplicationInsightsComponentExportRequest exportProperties, @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.applicationinsights.v2015_05_01.ExportConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("exportId") String exportId, @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.applicationinsights.v2015_05_01.ExportConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("exportId") String exportId, @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.applicationinsights.v2015_05_01.ExportConfigurations update" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("exportId") String exportId, @Query("api-version") String apiVersion, @Body ApplicationInsightsComponentExportRequest exportProperties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 List<ApplicationInsightsComponentExportConfigurationInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets a list of Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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> listAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets a list of Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentExportConfigurationInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentExportConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(resourceGroupName, this.client.subscriptionId(), resourceName, 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()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportProperties Properties that need to be specified to create a Continuous Export configuration of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationInsightsComponentExportConfigurationInner> object if successful. + */ + public List create(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, exportProperties).toBlocking().single().body(); + } + + /** + * Create a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportProperties Properties that need to be specified to create a Continuous Export configuration of a Application Insights component. + * @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> createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, resourceName, exportProperties), serviceCallback); + } + + /** + * Create a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportProperties Properties that need to be specified to create a Continuous Export configuration of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentExportConfigurationInner> object + */ + public Observable> createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, exportProperties).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Create a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportProperties Properties that need to be specified to create a Continuous Export configuration of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentExportConfigurationInner> object + */ + public Observable>> createWithServiceResponseAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (exportProperties == null) { + throw new IllegalArgumentException("Parameter exportProperties is required and cannot be null."); + } + Validator.validate(exportProperties); + return service.create(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), exportProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> createDelegate(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); + } + + /** + * Delete a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @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 ApplicationInsightsComponentExportConfigurationInner object if successful. + */ + public ApplicationInsightsComponentExportConfigurationInner delete(String resourceGroupName, String resourceName, String exportId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, exportId).toBlocking().single().body(); + } + + /** + * Delete a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @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 resourceName, String exportId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, exportId), serviceCallback); + } + + /** + * Delete a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentExportConfigurationInner object + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String exportId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, exportId).map(new Func1, ApplicationInsightsComponentExportConfigurationInner>() { + @Override + public ApplicationInsightsComponentExportConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Continuous Export configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentExportConfigurationInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String exportId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (exportId == null) { + throw new IllegalArgumentException("Parameter exportId 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, this.client.subscriptionId(), resourceName, exportId, 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); + } + + /** + * Get the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @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 ApplicationInsightsComponentExportConfigurationInner object if successful. + */ + public ApplicationInsightsComponentExportConfigurationInner get(String resourceGroupName, String resourceName, String exportId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, exportId).toBlocking().single().body(); + } + + /** + * Get the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @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 resourceName, String exportId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, exportId), serviceCallback); + } + + /** + * Get the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentExportConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String exportId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, exportId).map(new Func1, ApplicationInsightsComponentExportConfigurationInner>() { + @Override + public ApplicationInsightsComponentExportConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentExportConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String exportId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (exportId == null) { + throw new IllegalArgumentException("Parameter exportId 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, this.client.subscriptionId(), resourceName, exportId, 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); + } + + /** + * Update the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @param exportProperties Properties that need to be specified to update the Continuous Export configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInsightsComponentExportConfigurationInner object if successful. + */ + public ApplicationInsightsComponentExportConfigurationInner update(String resourceGroupName, String resourceName, String exportId, ApplicationInsightsComponentExportRequest exportProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, exportId, exportProperties).toBlocking().single().body(); + } + + /** + * Update the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @param exportProperties Properties that need to be specified to update the Continuous Export configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, String exportId, ApplicationInsightsComponentExportRequest exportProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, exportId, exportProperties), serviceCallback); + } + + /** + * Update the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @param exportProperties Properties that need to be specified to update the Continuous Export configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentExportConfigurationInner object + */ + public Observable updateAsync(String resourceGroupName, String resourceName, String exportId, ApplicationInsightsComponentExportRequest exportProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, exportId, exportProperties).map(new Func1, ApplicationInsightsComponentExportConfigurationInner>() { + @Override + public ApplicationInsightsComponentExportConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the Continuous Export configuration for this export id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param exportId The Continuous Export configuration ID. This is unique within a Application Insights component. + * @param exportProperties Properties that need to be specified to update the Continuous Export configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentExportConfigurationInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, String exportId, ApplicationInsightsComponentExportRequest exportProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (exportId == null) { + throw new IllegalArgumentException("Parameter exportId 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 (exportProperties == null) { + throw new IllegalArgumentException("Parameter exportProperties is required and cannot be null."); + } + Validator.validate(exportProperties); + return service.update(resourceGroupName, this.client.subscriptionId(), resourceName, exportId, this.client.apiVersion(), exportProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesImpl.java new file mode 100644 index 000000000000..a7bc7383b16e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Favorites; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentFavorite; + +class FavoritesImpl extends WrapperImpl implements Favorites { + private final InsightsManager manager; + + FavoritesImpl(InsightsManager manager) { + super(manager.inner().favorites()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public ApplicationInsightsComponentFavoriteImpl define(String name) { + return wrapModel(name); + } + + private ApplicationInsightsComponentFavoriteImpl wrapModel(ApplicationInsightsComponentFavoriteInner inner) { + return new ApplicationInsightsComponentFavoriteImpl(inner, manager()); + } + + private ApplicationInsightsComponentFavoriteImpl wrapModel(String name) { + return new ApplicationInsightsComponentFavoriteImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + FavoritesInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponentFavorite call(ApplicationInsightsComponentFavoriteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String favoriteId) { + FavoritesInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, favoriteId) + .map(new Func1() { + @Override + public ApplicationInsightsComponentFavorite call(ApplicationInsightsComponentFavoriteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String favoriteId) { + FavoritesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, favoriteId).toCompletable(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java new file mode 100644 index 000000000000..6e3034540403 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java @@ -0,0 +1,660 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.FavoriteSourceType; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.FavoriteType; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 Favorites. + */ +public class FavoritesInner { + /** The Retrofit service to perform REST calls. */ + private FavoritesService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of FavoritesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FavoritesInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(FavoritesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Favorites to be + * used by Retrofit to perform actually REST calls. + */ + interface FavoritesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.Favorites list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Query("favoriteType") FavoriteType favoriteType1, @Query("sourceType") FavoriteSourceType sourceType, @Query("canFetchContent") Boolean canFetchContent, @Query("tags") String tags, @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.applicationinsights.v2015_05_01.Favorites get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("favoriteId") String favoriteId, @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.applicationinsights.v2015_05_01.Favorites add" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}") + Observable> add(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("favoriteId") String favoriteId, @Query("api-version") String apiVersion, @Body ApplicationInsightsComponentFavoriteInner favoriteProperties, @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.applicationinsights.v2015_05_01.Favorites update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("favoriteId") String favoriteId, @Query("api-version") String apiVersion, @Body ApplicationInsightsComponentFavoriteInner favoriteProperties, @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.applicationinsights.v2015_05_01.Favorites delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("favoriteId") String favoriteId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 List<ApplicationInsightsComponentFavoriteInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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> listAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentFavoriteInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentFavoriteInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final FavoriteType favoriteType = null; + final FavoriteSourceType sourceType = null; + final Boolean canFetchContent = null; + final List tags = null; + String tagsConverted = this.client.serializerAdapter().serializeList(tags, CollectionFormat.CSV); + return service.list(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), favoriteType, sourceType, canFetchContent, tagsConverted, 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); + } + } + }); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteType The type of favorite. Value can be either shared or user. Possible values include: 'shared', 'user' + * @param sourceType Source type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum). Possible values include: 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', 'impact', 'segmentation' + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content for favorites. + * @param tags Tags that must be present on each favorite returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationInsightsComponentFavoriteInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName, FavoriteType favoriteType, FavoriteSourceType sourceType, Boolean canFetchContent, List tags) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, favoriteType, sourceType, canFetchContent, tags).toBlocking().single().body(); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteType The type of favorite. Value can be either shared or user. Possible values include: 'shared', 'user' + * @param sourceType Source type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum). Possible values include: 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', 'impact', 'segmentation' + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content for favorites. + * @param tags Tags that must be present on each favorite returned. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String resourceName, FavoriteType favoriteType, FavoriteSourceType sourceType, Boolean canFetchContent, List tags, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName, favoriteType, sourceType, canFetchContent, tags), serviceCallback); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteType The type of favorite. Value can be either shared or user. Possible values include: 'shared', 'user' + * @param sourceType Source type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum). Possible values include: 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', 'impact', 'segmentation' + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content for favorites. + * @param tags Tags that must be present on each favorite returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentFavoriteInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName, FavoriteType favoriteType, FavoriteSourceType sourceType, Boolean canFetchContent, List tags) { + return listWithServiceResponseAsync(resourceGroupName, resourceName, favoriteType, sourceType, canFetchContent, tags).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of favorites defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteType The type of favorite. Value can be either shared or user. Possible values include: 'shared', 'user' + * @param sourceType Source type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum). Possible values include: 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', 'impact', 'segmentation' + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content for favorites. + * @param tags Tags that must be present on each favorite returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentFavoriteInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName, FavoriteType favoriteType, FavoriteSourceType sourceType, Boolean canFetchContent, List tags) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(tags); + String tagsConverted = this.client.serializerAdapter().serializeList(tags, CollectionFormat.CSV); + return service.list(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), favoriteType, sourceType, canFetchContent, tagsConverted, 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()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a single favorite by its FavoriteId, defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @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 ApplicationInsightsComponentFavoriteInner object if successful. + */ + public ApplicationInsightsComponentFavoriteInner get(String resourceGroupName, String resourceName, String favoriteId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId).toBlocking().single().body(); + } + + /** + * Get a single favorite by its FavoriteId, defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @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 resourceName, String favoriteId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId), serviceCallback); + } + + /** + * Get a single favorite by its FavoriteId, defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFavoriteInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String favoriteId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId).map(new Func1, ApplicationInsightsComponentFavoriteInner>() { + @Override + public ApplicationInsightsComponentFavoriteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a single favorite by its FavoriteId, defined within an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFavoriteInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String favoriteId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (favoriteId == null) { + throw new IllegalArgumentException("Parameter favoriteId 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, this.client.subscriptionId(), resourceName, favoriteId, 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); + } + + /** + * Adds a new favorites to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to create a new favorite and add it to an Application Insights component. + * @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 ApplicationInsightsComponentFavoriteInner object if successful. + */ + public ApplicationInsightsComponentFavoriteInner add(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) { + return addWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties).toBlocking().single().body(); + } + + /** + * Adds a new favorites to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to create a new favorite and add it to an Application Insights component. + * @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 addAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties), serviceCallback); + } + + /** + * Adds a new favorites to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to create a new favorite and add it to an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFavoriteInner object + */ + public Observable addAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) { + return addWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties).map(new Func1, ApplicationInsightsComponentFavoriteInner>() { + @Override + public ApplicationInsightsComponentFavoriteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds a new favorites to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to create a new favorite and add it to an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFavoriteInner object + */ + public Observable> addWithServiceResponseAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (favoriteId == null) { + throw new IllegalArgumentException("Parameter favoriteId 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 (favoriteProperties == null) { + throw new IllegalArgumentException("Parameter favoriteProperties is required and cannot be null."); + } + Validator.validate(favoriteProperties); + return service.add(resourceGroupName, this.client.subscriptionId(), resourceName, favoriteId, this.client.apiVersion(), favoriteProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addDelegate(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); + } + + /** + * Updates a favorite that has already been added to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to update the existing favorite. + * @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 ApplicationInsightsComponentFavoriteInner object if successful. + */ + public ApplicationInsightsComponentFavoriteInner update(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties).toBlocking().single().body(); + } + + /** + * Updates a favorite that has already been added to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to update the existing favorite. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties), serviceCallback); + } + + /** + * Updates a favorite that has already been added to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to update the existing favorite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFavoriteInner object + */ + public Observable updateAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties).map(new Func1, ApplicationInsightsComponentFavoriteInner>() { + @Override + public ApplicationInsightsComponentFavoriteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a favorite that has already been added to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @param favoriteProperties Properties that need to be specified to update the existing favorite. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentFavoriteInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, String favoriteId, ApplicationInsightsComponentFavoriteInner favoriteProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (favoriteId == null) { + throw new IllegalArgumentException("Parameter favoriteId 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 (favoriteProperties == null) { + throw new IllegalArgumentException("Parameter favoriteProperties is required and cannot be null."); + } + Validator.validate(favoriteProperties); + return service.update(resourceGroupName, this.client.subscriptionId(), resourceName, favoriteId, this.client.apiVersion(), favoriteProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Remove a favorite that is associated to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @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 resourceName, String favoriteId) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId).toBlocking().single().body(); + } + + /** + * Remove a favorite that is associated to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @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 resourceName, String favoriteId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId), serviceCallback); + } + + /** + * Remove a favorite that is associated to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String favoriteId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, favoriteId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a favorite that is associated to an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param favoriteId The Id of a specific favorite defined in the Application Insights component + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String favoriteId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (favoriteId == null) { + throw new IllegalArgumentException("Parameter favoriteId 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, this.client.subscriptionId(), resourceName, favoriteId, 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); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/IdParsingUtils.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..936d2581e44f --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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.applicationinsights.v2015_05_01.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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/InsightsManager.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/InsightsManager.java new file mode 100644 index 000000000000..51ba5cb4ced8 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/InsightsManager.java @@ -0,0 +1,279 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.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.applicationinsights.v2015_05_01.Operations; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Annotations; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.APIKeys; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentCurrentBillingFeatures; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentQuotaStatus; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentFeatureCapabilities; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ComponentAvailableFeatures; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ProactiveDetectionConfigurations; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Components; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemConfigurations; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Favorites; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestLocations; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTests; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.AnalyticsItems; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Workbooks; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Insights resource management. + */ +public final class InsightsManager extends ManagerCore { + private Operations operations; + private Annotations annotations; + private APIKeys aPIKeys; + private ExportConfigurations exportConfigurations; + private ComponentCurrentBillingFeatures componentCurrentBillingFeatures; + private ComponentQuotaStatus componentQuotaStatus; + private ComponentFeatureCapabilities componentFeatureCapabilities; + private ComponentAvailableFeatures componentAvailableFeatures; + private ProactiveDetectionConfigurations proactiveDetectionConfigurations; + private Components components; + private WorkItemConfigurations workItemConfigurations; + private Favorites favorites; + private WebTestLocations webTestLocations; + private WebTests webTests; + private AnalyticsItems analyticsItems; + private Workbooks workbooks; + /** + * Get a Configurable instance that can be used to create InsightsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new InsightsManager.ConfigurableImpl(); + } + /** + * Creates an instance of InsightsManager that exposes Insights resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the InsightsManager + */ + public static InsightsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new InsightsManager(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 InsightsManager that exposes Insights resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the InsightsManager + */ + public static InsightsManager authenticate(RestClient restClient, String subscriptionId) { + return new InsightsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of InsightsManager that exposes Insights management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Insights management API entry points that work across subscriptions + */ + InsightsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Annotations. + */ + public Annotations annotations() { + if (this.annotations == null) { + this.annotations = new AnnotationsImpl(this); + } + return this.annotations; + } + + /** + * @return Entry point to manage APIKeys. + */ + public APIKeys aPIKeys() { + if (this.aPIKeys == null) { + this.aPIKeys = new APIKeysImpl(this); + } + return this.aPIKeys; + } + + /** + * @return Entry point to manage ExportConfigurations. + */ + public ExportConfigurations exportConfigurations() { + if (this.exportConfigurations == null) { + this.exportConfigurations = new ExportConfigurationsImpl(this); + } + return this.exportConfigurations; + } + + /** + * @return Entry point to manage ComponentCurrentBillingFeatures. + */ + public ComponentCurrentBillingFeatures componentCurrentBillingFeatures() { + if (this.componentCurrentBillingFeatures == null) { + this.componentCurrentBillingFeatures = new ComponentCurrentBillingFeaturesImpl(this); + } + return this.componentCurrentBillingFeatures; + } + + /** + * @return Entry point to manage ComponentQuotaStatus. + */ + public ComponentQuotaStatus componentQuotaStatus() { + if (this.componentQuotaStatus == null) { + this.componentQuotaStatus = new ComponentQuotaStatusImpl(this); + } + return this.componentQuotaStatus; + } + + /** + * @return Entry point to manage ComponentFeatureCapabilities. + */ + public ComponentFeatureCapabilities componentFeatureCapabilities() { + if (this.componentFeatureCapabilities == null) { + this.componentFeatureCapabilities = new ComponentFeatureCapabilitiesImpl(this); + } + return this.componentFeatureCapabilities; + } + + /** + * @return Entry point to manage ComponentAvailableFeatures. + */ + public ComponentAvailableFeatures componentAvailableFeatures() { + if (this.componentAvailableFeatures == null) { + this.componentAvailableFeatures = new ComponentAvailableFeaturesImpl(this); + } + return this.componentAvailableFeatures; + } + + /** + * @return Entry point to manage ProactiveDetectionConfigurations. + */ + public ProactiveDetectionConfigurations proactiveDetectionConfigurations() { + if (this.proactiveDetectionConfigurations == null) { + this.proactiveDetectionConfigurations = new ProactiveDetectionConfigurationsImpl(this); + } + return this.proactiveDetectionConfigurations; + } + + /** + * @return Entry point to manage Components. + */ + public Components components() { + if (this.components == null) { + this.components = new ComponentsImpl(this); + } + return this.components; + } + + /** + * @return Entry point to manage WorkItemConfigurations. + */ + public WorkItemConfigurations workItemConfigurations() { + if (this.workItemConfigurations == null) { + this.workItemConfigurations = new WorkItemConfigurationsImpl(this); + } + return this.workItemConfigurations; + } + + /** + * @return Entry point to manage Favorites. + */ + public Favorites favorites() { + if (this.favorites == null) { + this.favorites = new FavoritesImpl(this); + } + return this.favorites; + } + + /** + * @return Entry point to manage WebTestLocations. + */ + public WebTestLocations webTestLocations() { + if (this.webTestLocations == null) { + this.webTestLocations = new WebTestLocationsImpl(this); + } + return this.webTestLocations; + } + + /** + * @return Entry point to manage WebTests. + */ + public WebTests webTests() { + if (this.webTests == null) { + this.webTests = new WebTestsImpl(this); + } + return this.webTests; + } + + /** + * @return Entry point to manage AnalyticsItems. + */ + public AnalyticsItems analyticsItems() { + if (this.analyticsItems == null) { + this.analyticsItems = new AnalyticsItemsImpl(this); + } + return this.analyticsItems; + } + + /** + * @return Entry point to manage Workbooks. + */ + public Workbooks workbooks() { + if (this.workbooks == null) { + this.workbooks = new WorkbooksImpl(this); + } + return this.workbooks; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public InsightsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return InsightsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private InsightsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ApplicationInsightsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..db2804ea56a8 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final InsightsManager manager; + OperationImpl(OperationInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationInner.java new file mode 100644 index 000000000000..f5c7efc66ab3 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * CDN REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents 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 the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents 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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..7cd5e30c2670 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final InsightsManager manager; + + OperationsImpl(InsightsManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..082873e207f2 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl 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, ApplicationInsightsManagementClientImpl 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.applicationinsights.v2015_05_01.Operations list" }) + @GET("providers/Microsoft.Insights/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available insights REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available insights 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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available insights REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available insights REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available insights REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available insights REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available insights REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available insights REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available insights REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available insights REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/PageImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/PageImpl.java new file mode 100644 index 000000000000..c2dcddd2da4d --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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.applicationinsights.v2015_05_01.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("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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/PageImpl1.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..d819e42f927b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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.applicationinsights.v2015_05_01.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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsImpl.java new file mode 100644 index 000000000000..50b4fc0fbe1b --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ProactiveDetectionConfigurations; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentProactiveDetectionConfiguration; + +class ProactiveDetectionConfigurationsImpl extends WrapperImpl implements ProactiveDetectionConfigurations { + private final InsightsManager manager; + + ProactiveDetectionConfigurationsImpl(InsightsManager manager) { + super(manager.inner().proactiveDetectionConfigurations()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + private ApplicationInsightsComponentProactiveDetectionConfigurationImpl wrapModel(ApplicationInsightsComponentProactiveDetectionConfigurationInner inner) { + return new ApplicationInsightsComponentProactiveDetectionConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + ProactiveDetectionConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponentProactiveDetectionConfiguration call(ApplicationInsightsComponentProactiveDetectionConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName, String configurationId) { + ProactiveDetectionConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName, configurationId) + .map(new Func1() { + @Override + public ApplicationInsightsComponentProactiveDetectionConfiguration call(ApplicationInsightsComponentProactiveDetectionConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsInner.java new file mode 100644 index 000000000000..2d6064231d0a --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsInner.java @@ -0,0 +1,352 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.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 ProactiveDetectionConfigurations. + */ +public class ProactiveDetectionConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ProactiveDetectionConfigurationsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ProactiveDetectionConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProactiveDetectionConfigurationsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(ProactiveDetectionConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProactiveDetectionConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ProactiveDetectionConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ProactiveDetectionConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.ProactiveDetectionConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("ConfigurationId") String configurationId, @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.applicationinsights.v2015_05_01.ProactiveDetectionConfigurations update" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("ConfigurationId") String configurationId, @Query("api-version") String apiVersion, @Body ApplicationInsightsComponentProactiveDetectionConfigurationInner proactiveDetectionProperties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of ProactiveDetection configurations of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 List<ApplicationInsightsComponentProactiveDetectionConfigurationInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets a list of ProactiveDetection configurations of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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> listAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets a list of ProactiveDetection configurations of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentProactiveDetectionConfigurationInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of ProactiveDetection configurations of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentProactiveDetectionConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(resourceGroupName, this.client.subscriptionId(), resourceName, 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()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @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 ApplicationInsightsComponentProactiveDetectionConfigurationInner object if successful. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner get(String resourceGroupName, String resourceName, String configurationId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, configurationId).toBlocking().single().body(); + } + + /** + * Get the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @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 resourceName, String configurationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName, configurationId), serviceCallback); + } + + /** + * Get the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentProactiveDetectionConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName, String configurationId) { + return getWithServiceResponseAsync(resourceGroupName, resourceName, configurationId).map(new Func1, ApplicationInsightsComponentProactiveDetectionConfigurationInner>() { + @Override + public ApplicationInsightsComponentProactiveDetectionConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentProactiveDetectionConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName, String configurationId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (configurationId == null) { + throw new IllegalArgumentException("Parameter configurationId 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, this.client.subscriptionId(), resourceName, configurationId, 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); + } + + /** + * Update the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @param proactiveDetectionProperties Properties that need to be specified to update the ProactiveDetection configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInsightsComponentProactiveDetectionConfigurationInner object if successful. + */ + public ApplicationInsightsComponentProactiveDetectionConfigurationInner update(String resourceGroupName, String resourceName, String configurationId, ApplicationInsightsComponentProactiveDetectionConfigurationInner proactiveDetectionProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, configurationId, proactiveDetectionProperties).toBlocking().single().body(); + } + + /** + * Update the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @param proactiveDetectionProperties Properties that need to be specified to update the ProactiveDetection configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, String configurationId, ApplicationInsightsComponentProactiveDetectionConfigurationInner proactiveDetectionProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, configurationId, proactiveDetectionProperties), serviceCallback); + } + + /** + * Update the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @param proactiveDetectionProperties Properties that need to be specified to update the ProactiveDetection configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentProactiveDetectionConfigurationInner object + */ + public Observable updateAsync(String resourceGroupName, String resourceName, String configurationId, ApplicationInsightsComponentProactiveDetectionConfigurationInner proactiveDetectionProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, configurationId, proactiveDetectionProperties).map(new Func1, ApplicationInsightsComponentProactiveDetectionConfigurationInner>() { + @Override + public ApplicationInsightsComponentProactiveDetectionConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the ProactiveDetection configuration for this configuration id. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights component. + * @param proactiveDetectionProperties Properties that need to be specified to update the ProactiveDetection configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInsightsComponentProactiveDetectionConfigurationInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, String configurationId, ApplicationInsightsComponentProactiveDetectionConfigurationInner proactiveDetectionProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (configurationId == null) { + throw new IllegalArgumentException("Parameter configurationId 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 (proactiveDetectionProperties == null) { + throw new IllegalArgumentException("Parameter proactiveDetectionProperties is required and cannot be null."); + } + Validator.validate(proactiveDetectionProperties); + return service.update(resourceGroupName, this.client.subscriptionId(), resourceName, configurationId, this.client.apiVersion(), proactiveDetectionProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestImpl.java new file mode 100644 index 000000000000..d6b17b49136e --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestImpl.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTest; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestKind; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestGeolocation; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestPropertiesConfiguration; + +class WebTestImpl extends GroupableResourceCoreImpl implements WebTest, WebTest.Definition, WebTest.Update { + WebTestImpl(String name, WebTestInner inner, InsightsManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + WebTestsInner client = this.manager().inner().webTests(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebTestsInner client = this.manager().inner().webTests(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebTestsInner client = this.manager().inner().webTests(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public WebTestPropertiesConfiguration configuration() { + return this.inner().configuration(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public Integer frequency() { + return this.inner().frequency(); + } + + @Override + public WebTestKind kind() { + return this.inner().kind(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Boolean retryEnabled() { + return this.inner().retryEnabled(); + } + + @Override + public String syntheticMonitorId() { + return this.inner().syntheticMonitorId(); + } + + @Override + public Integer timeout() { + return this.inner().timeout(); + } + + @Override + public WebTestKind webTestKind() { + return this.inner().webTestKind(); + } + + @Override + public String webTestName() { + return this.inner().webTestName(); + } + + @Override + public WebTestImpl withLocations(List locations) { + this.inner().withLocations(locations); + return this; + } + + @Override + public WebTestImpl withSyntheticMonitorId(String syntheticMonitorId) { + this.inner().withSyntheticMonitorId(syntheticMonitorId); + return this; + } + + @Override + public WebTestImpl withWebTestKind(WebTestKind webTestKind) { + this.inner().withWebTestKind(webTestKind); + return this; + } + + @Override + public WebTestImpl withWebTestName(String webTestName) { + this.inner().withWebTestName(webTestName); + return this; + } + + @Override + public WebTestImpl withConfiguration(WebTestPropertiesConfiguration configuration) { + this.inner().withConfiguration(configuration); + return this; + } + + @Override + public WebTestImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public WebTestImpl withEnabled(Boolean enabled) { + this.inner().withEnabled(enabled); + return this; + } + + @Override + public WebTestImpl withFrequency(Integer frequency) { + this.inner().withFrequency(frequency); + return this; + } + + @Override + public WebTestImpl withKind(WebTestKind kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public WebTestImpl withRetryEnabled(Boolean retryEnabled) { + this.inner().withRetryEnabled(retryEnabled); + return this; + } + + @Override + public WebTestImpl withTimeout(Integer timeout) { + this.inner().withTimeout(timeout); + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestInner.java new file mode 100644 index 000000000000..4397c4231bd0 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestInner.java @@ -0,0 +1,333 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestKind; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestGeolocation; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestPropertiesConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebtestsResource; + +/** + * An Application Insights web test definition. + */ +@JsonFlatten +public class WebTestInner extends WebtestsResource { + /** + * The kind of web test that this web test watches. Choices are ping and + * multistep. Possible values include: 'ping', 'multistep'. + */ + @JsonProperty(value = "kind") + private WebTestKind kind; + + /** + * Unique ID of this WebTest. This is typically the same value as the Name + * field. + */ + @JsonProperty(value = "properties.SyntheticMonitorId", required = true) + private String syntheticMonitorId; + + /** + * User defined name if this WebTest. + */ + @JsonProperty(value = "properties.Name", required = true) + private String webTestName; + + /** + * Purpose/user defined descriptive test for this WebTest. + */ + @JsonProperty(value = "properties.Description") + private String description; + + /** + * Is the test actively being monitored. + */ + @JsonProperty(value = "properties.Enabled") + private Boolean enabled; + + /** + * Interval in seconds between test runs for this WebTest. Default value is + * 300. + */ + @JsonProperty(value = "properties.Frequency") + private Integer frequency; + + /** + * Seconds until this WebTest will timeout and fail. Default value is 30. + */ + @JsonProperty(value = "properties.Timeout") + private Integer timeout; + + /** + * The kind of web test this is, valid choices are ping and multistep. + * Possible values include: 'ping', 'multistep'. + */ + @JsonProperty(value = "properties.Kind", required = true) + private WebTestKind webTestKind; + + /** + * Allow for retries should this WebTest fail. + */ + @JsonProperty(value = "properties.RetryEnabled") + private Boolean retryEnabled; + + /** + * A list of where to physically run the tests from to give global coverage + * for accessibility of your application. + */ + @JsonProperty(value = "properties.Locations", required = true) + private List locations; + + /** + * An XML configuration specification for a WebTest. + */ + @JsonProperty(value = "properties.Configuration") + private WebTestPropertiesConfiguration configuration; + + /** + * Current state of this component, whether or not is has been provisioned + * within the resource group it is defined. Users cannot change this value + * but are able to read from it. Values will include Succeeded, Deploying, + * Canceled, and Failed. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the kind of web test that this web test watches. Choices are ping and multistep. Possible values include: 'ping', 'multistep'. + * + * @return the kind value + */ + public WebTestKind kind() { + return this.kind; + } + + /** + * Set the kind of web test that this web test watches. Choices are ping and multistep. Possible values include: 'ping', 'multistep'. + * + * @param kind the kind value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withKind(WebTestKind kind) { + this.kind = kind; + return this; + } + + /** + * Get unique ID of this WebTest. This is typically the same value as the Name field. + * + * @return the syntheticMonitorId value + */ + public String syntheticMonitorId() { + return this.syntheticMonitorId; + } + + /** + * Set unique ID of this WebTest. This is typically the same value as the Name field. + * + * @param syntheticMonitorId the syntheticMonitorId value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withSyntheticMonitorId(String syntheticMonitorId) { + this.syntheticMonitorId = syntheticMonitorId; + return this; + } + + /** + * Get user defined name if this WebTest. + * + * @return the webTestName value + */ + public String webTestName() { + return this.webTestName; + } + + /** + * Set user defined name if this WebTest. + * + * @param webTestName the webTestName value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withWebTestName(String webTestName) { + this.webTestName = webTestName; + return this; + } + + /** + * Get purpose/user defined descriptive test for this WebTest. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set purpose/user defined descriptive test for this WebTest. + * + * @param description the description value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get is the test actively being monitored. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set is the test actively being monitored. + * + * @param enabled the enabled value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get interval in seconds between test runs for this WebTest. Default value is 300. + * + * @return the frequency value + */ + public Integer frequency() { + return this.frequency; + } + + /** + * Set interval in seconds between test runs for this WebTest. Default value is 300. + * + * @param frequency the frequency value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withFrequency(Integer frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get seconds until this WebTest will timeout and fail. Default value is 30. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set seconds until this WebTest will timeout and fail. Default value is 30. + * + * @param timeout the timeout value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the kind of web test this is, valid choices are ping and multistep. Possible values include: 'ping', 'multistep'. + * + * @return the webTestKind value + */ + public WebTestKind webTestKind() { + return this.webTestKind; + } + + /** + * Set the kind of web test this is, valid choices are ping and multistep. Possible values include: 'ping', 'multistep'. + * + * @param webTestKind the webTestKind value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withWebTestKind(WebTestKind webTestKind) { + this.webTestKind = webTestKind; + return this; + } + + /** + * Get allow for retries should this WebTest fail. + * + * @return the retryEnabled value + */ + public Boolean retryEnabled() { + return this.retryEnabled; + } + + /** + * Set allow for retries should this WebTest fail. + * + * @param retryEnabled the retryEnabled value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withRetryEnabled(Boolean retryEnabled) { + this.retryEnabled = retryEnabled; + return this; + } + + /** + * Get a list of where to physically run the tests from to give global coverage for accessibility of your application. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set a list of where to physically run the tests from to give global coverage for accessibility of your application. + * + * @param locations the locations value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get an XML configuration specification for a WebTest. + * + * @return the configuration value + */ + public WebTestPropertiesConfiguration configuration() { + return this.configuration; + } + + /** + * Set an XML configuration specification for a WebTest. + * + * @param configuration the configuration value to set + * @return the WebTestInner object itself. + */ + public WebTestInner withConfiguration(WebTestPropertiesConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestLocationsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestLocationsImpl.java new file mode 100644 index 000000000000..ed61a87f7cdf --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestLocationsImpl.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.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestLocations; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.ApplicationInsightsComponentWebTestLocation; + +class WebTestLocationsImpl extends WrapperImpl implements WebTestLocations { + private final InsightsManager manager; + + WebTestLocationsImpl(InsightsManager manager) { + super(manager.inner().webTestLocations()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + private ApplicationInsightsComponentWebTestLocationImpl wrapModel(ApplicationInsightsComponentWebTestLocationInner inner) { + return new ApplicationInsightsComponentWebTestLocationImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + WebTestLocationsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ApplicationInsightsComponentWebTestLocation call(ApplicationInsightsComponentWebTestLocationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestLocationsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestLocationsInner.java new file mode 100644 index 000000000000..85fecfd96329 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestLocationsInner.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.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 java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 WebTestLocations. + */ +public class WebTestLocationsInner { + /** The Retrofit service to perform REST calls. */ + private WebTestLocationsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of WebTestLocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebTestLocationsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(WebTestLocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for WebTestLocations to be + * used by Retrofit to perform actually REST calls. + */ + interface WebTestLocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTestLocations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of web test locations available to this Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 List<ApplicationInsightsComponentWebTestLocationInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets a list of web test locations available to this Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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> listAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets a list of web test locations available to this Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentWebTestLocationInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of web test locations available to this Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationInsightsComponentWebTestLocationInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestsImpl.java new file mode 100644 index 000000000000..67149bb0f867 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestsImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTests; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTest; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class WebTestsImpl extends GroupableResourcesCoreImpl implements WebTests { + protected WebTestsImpl(InsightsManager manager) { + super(manager.inner().webTests(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + WebTestsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + WebTestsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + WebTestsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + WebTestsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WebTest call(WebTestInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + WebTestsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + WebTestsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WebTest call(WebTestInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public WebTestImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listByComponentAsync(final String componentName, final String resourceGroupName) { + WebTestsInner client = this.inner(); + return client.listByComponentAsync(componentName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WebTest call(WebTestInner inner) { + return new WebTestImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected WebTestImpl wrapModel(WebTestInner inner) { + return new WebTestImpl(inner.name(), inner, manager()); + } + + @Override + protected WebTestImpl wrapModel(String name) { + return new WebTestImpl(name, new WebTestInner(), this.manager()); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestsInner.java new file mode 100644 index 000000000000..b2125c3eccb6 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WebTestsInner.java @@ -0,0 +1,1231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.TagsResource; +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 java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 WebTests. + */ +public class WebTestsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private WebTestsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of WebTestsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebTestsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(WebTestsService.class); + this.client = client; + } + + /** + * The interface defining all the services for WebTests to be + * used by Retrofit to perform actually REST calls. + */ + interface WebTestsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTests listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTests getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("webTestName") String webTestName, @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.applicationinsights.v2015_05_01.WebTests createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("webTestName") String webTestName, @Query("api-version") String apiVersion, @Body WebTestInner webTestDefinition, @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.applicationinsights.v2015_05_01.WebTests updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("webTestName") String webTestName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsResource webTestTags, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTests delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("webTestName") String webTestName, @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.applicationinsights.v2015_05_01.WebTests list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests") + 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.applicationinsights.v2015_05_01.WebTests listByComponent" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests") + Observable> listByComponent(@Path("componentName") String componentName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.WebTests listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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.applicationinsights.v2015_05_01.WebTests listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.applicationinsights.v2015_05_01.WebTests listByComponentNext" }) + @GET + Observable> listByComponentNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @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<WebTestInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebTestInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebTestInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebTestInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a specific Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest 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 WebTestInner object if successful. + */ + public WebTestInner getByResourceGroup(String resourceGroupName, String webTestName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, webTestName).toBlocking().single().body(); + } + + /** + * Get a specific Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest 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 getByResourceGroupAsync(String resourceGroupName, String webTestName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, webTestName), serviceCallback); + } + + /** + * Get a specific Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String webTestName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, webTestName).map(new Func1, WebTestInner>() { + @Override + public WebTestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specific Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String webTestName) { + 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 (webTestName == null) { + throw new IllegalArgumentException("Parameter webTestName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, this.client.subscriptionId(), webTestName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param webTestDefinition Properties that need to be specified to create or update an Application Insights web test definition. + * @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 WebTestInner object if successful. + */ + public WebTestInner createOrUpdate(String resourceGroupName, String webTestName, WebTestInner webTestDefinition) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, webTestName, webTestDefinition).toBlocking().single().body(); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param webTestDefinition Properties that need to be specified to create or update an Application Insights web test definition. + * @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 webTestName, WebTestInner webTestDefinition, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, webTestName, webTestDefinition), serviceCallback); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param webTestDefinition Properties that need to be specified to create or update an Application Insights web test definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String webTestName, WebTestInner webTestDefinition) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, webTestName, webTestDefinition).map(new Func1, WebTestInner>() { + @Override + public WebTestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param webTestDefinition Properties that need to be specified to create or update an Application Insights web test definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String webTestName, WebTestInner webTestDefinition) { + 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 (webTestName == null) { + throw new IllegalArgumentException("Parameter webTestName 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 (webTestDefinition == null) { + throw new IllegalArgumentException("Parameter webTestDefinition is required and cannot be null."); + } + Validator.validate(webTestDefinition); + return service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), webTestName, this.client.apiVersion(), webTestDefinition, 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); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest 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 WebTestInner object if successful. + */ + public WebTestInner updateTags(String resourceGroupName, String webTestName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, webTestName).toBlocking().single().body(); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest 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 updateTagsAsync(String resourceGroupName, String webTestName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, webTestName), serviceCallback); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String webTestName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, webTestName).map(new Func1, WebTestInner>() { + @Override + public WebTestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String webTestName) { + 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 (webTestName == null) { + throw new IllegalArgumentException("Parameter webTestName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + TagsResource webTestTags = new TagsResource(); + webTestTags.withTags(null); + return service.updateTags(resourceGroupName, this.client.subscriptionId(), webTestName, this.client.apiVersion(), this.client.acceptLanguage(), webTestTags, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param tags Resource tags + * @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 WebTestInner object if successful. + */ + public WebTestInner updateTags(String resourceGroupName, String webTestName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, webTestName, tags).toBlocking().single().body(); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param tags Resource tags + * @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 updateTagsAsync(String resourceGroupName, String webTestName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, webTestName, tags), serviceCallback); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String webTestName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, webTestName, tags).map(new Func1, WebTestInner>() { + @Override + public WebTestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Application Insights web test definition. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @param tags Resource tags + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebTestInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String webTestName, Map tags) { + 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 (webTestName == null) { + throw new IllegalArgumentException("Parameter webTestName 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(tags); + TagsResource webTestTags = new TagsResource(); + webTestTags.withTags(tags); + return service.updateTags(resourceGroupName, this.client.subscriptionId(), webTestName, this.client.apiVersion(), this.client.acceptLanguage(), webTestTags, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(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 an Application Insights web test. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest 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 webTestName) { + deleteWithServiceResponseAsync(resourceGroupName, webTestName).toBlocking().single().body(); + } + + /** + * Deletes an Application Insights web test. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest 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 webTestName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, webTestName), serviceCallback); + } + + /** + * Deletes an Application Insights web test. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String webTestName) { + return deleteWithServiceResponseAsync(resourceGroupName, webTestName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an Application Insights web test. + * + * @param resourceGroupName The name of the resource group. + * @param webTestName The name of the Application Insights webtest resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String webTestName) { + 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 (webTestName == null) { + throw new IllegalArgumentException("Parameter webTestName 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, webTestName, 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); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebTestInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebTestInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebTestInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebTestInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @param componentName The name of the Application Insights component resource. + * @param resourceGroupName The name of the resource group. + * @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<WebTestInner> object if successful. + */ + public PagedList listByComponent(final String componentName, final String resourceGroupName) { + ServiceResponse> response = listByComponentSinglePageAsync(componentName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByComponentNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @param componentName The name of the Application Insights component resource. + * @param resourceGroupName The name of the resource group. + * @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> listByComponentAsync(final String componentName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByComponentSinglePageAsync(componentName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByComponentNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @param componentName The name of the Application Insights component resource. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebTestInner> object + */ + public Observable> listByComponentAsync(final String componentName, final String resourceGroupName) { + return listByComponentWithServiceResponseAsync(componentName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @param componentName The name of the Application Insights component resource. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebTestInner> object + */ + public Observable>> listByComponentWithServiceResponseAsync(final String componentName, final String resourceGroupName) { + return listByComponentSinglePageAsync(componentName, resourceGroupName) + .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(listByComponentNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + ServiceResponse> * @param componentName The name of the Application Insights component resource. + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebTestInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByComponentSinglePageAsync(final String componentName, final String resourceGroupName) { + if (componentName == null) { + throw new IllegalArgumentException("Parameter componentName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByComponent(componentName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByComponentDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByComponentDelegate(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); + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @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<WebTestInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @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<WebTestInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + * @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<WebTestInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Application Insights web tests defined within a specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebTestInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(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); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @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<WebTestInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @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<WebTestInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + * @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<WebTestInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Application Insights web test alerts definitions within a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebTestInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @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<WebTestInner> object if successful. + */ + public PagedList listByComponentNext(final String nextPageLink) { + ServiceResponse> response = listByComponentNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByComponentNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @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> listByComponentNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByComponentNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByComponentNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @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<WebTestInner> object + */ + public Observable> listByComponentNextAsync(final String nextPageLink) { + return listByComponentNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + * @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<WebTestInner> object + */ + public Observable>> listByComponentNextWithServiceResponseAsync(final String nextPageLink) { + return listByComponentNextSinglePageAsync(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(listByComponentNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all Application Insights web tests defined for the specified component. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebTestInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByComponentNextSinglePageAsync(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.listByComponentNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByComponentNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByComponentNextDelegate(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/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationImpl.java new file mode 100644 index 000000000000..f1415a72138c --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemConfiguration; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class WorkItemConfigurationImpl extends WrapperImpl implements WorkItemConfiguration { + private final InsightsManager manager; + + WorkItemConfigurationImpl(WorkItemConfigurationInner inner, InsightsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + + + @Override + public String configDisplayName() { + return this.inner().configDisplayName(); + } + + @Override + public String configProperties() { + return this.inner().configProperties(); + } + + @Override + public String connectorId() { + return this.inner().connectorId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isDefault() { + return this.inner().isDefault(); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationInner.java new file mode 100644 index 000000000000..d0207a5c7fc4 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Work item configuration associated with an application insights resource. + */ +public class WorkItemConfigurationInner { + /** + * Connector identifier where work item is created. + */ + @JsonProperty(value = "ConnectorId") + private String connectorId; + + /** + * Configuration friendly name. + */ + @JsonProperty(value = "ConfigDisplayName") + private String configDisplayName; + + /** + * Boolean value indicating whether configuration is default. + */ + @JsonProperty(value = "IsDefault") + private Boolean isDefault; + + /** + * Unique Id for work item. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * Serialized JSON object for detailed properties. + */ + @JsonProperty(value = "ConfigProperties") + private String configProperties; + + /** + * Get connector identifier where work item is created. + * + * @return the connectorId value + */ + public String connectorId() { + return this.connectorId; + } + + /** + * Set connector identifier where work item is created. + * + * @param connectorId the connectorId value to set + * @return the WorkItemConfigurationInner object itself. + */ + public WorkItemConfigurationInner withConnectorId(String connectorId) { + this.connectorId = connectorId; + return this; + } + + /** + * Get configuration friendly name. + * + * @return the configDisplayName value + */ + public String configDisplayName() { + return this.configDisplayName; + } + + /** + * Set configuration friendly name. + * + * @param configDisplayName the configDisplayName value to set + * @return the WorkItemConfigurationInner object itself. + */ + public WorkItemConfigurationInner withConfigDisplayName(String configDisplayName) { + this.configDisplayName = configDisplayName; + return this; + } + + /** + * Get boolean value indicating whether configuration is default. + * + * @return the isDefault value + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set boolean value indicating whether configuration is default. + * + * @param isDefault the isDefault value to set + * @return the WorkItemConfigurationInner object itself. + */ + public WorkItemConfigurationInner withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get unique Id for work item. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set unique Id for work item. + * + * @param id the id value to set + * @return the WorkItemConfigurationInner object itself. + */ + public WorkItemConfigurationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get serialized JSON object for detailed properties. + * + * @return the configProperties value + */ + public String configProperties() { + return this.configProperties; + } + + /** + * Set serialized JSON object for detailed properties. + * + * @param configProperties the configProperties value to set + * @return the WorkItemConfigurationInner object itself. + */ + public WorkItemConfigurationInner withConfigProperties(String configProperties) { + this.configProperties = configProperties; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationsImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationsImpl.java new file mode 100644 index 000000000000..3766952f10eb --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemConfigurations; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemConfiguration; +import rx.Completable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemCreateConfiguration; + +class WorkItemConfigurationsImpl extends WrapperImpl implements WorkItemConfigurations { + private final InsightsManager manager; + + WorkItemConfigurationsImpl(InsightsManager manager) { + super(manager.inner().workItemConfigurations()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + private WorkItemConfigurationImpl wrapWorkItemConfigurationModel(WorkItemConfigurationInner inner) { + return new WorkItemConfigurationImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String resourceName) { + WorkItemConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, resourceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public WorkItemConfiguration call(WorkItemConfigurationInner inner) { + return wrapWorkItemConfigurationModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName, String workItemConfigId) { + WorkItemConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName, workItemConfigId).toCompletable(); + } + + @Override + public Observable createAsync(String resourceGroupName, String resourceName, WorkItemCreateConfiguration workItemConfigurationProperties) { + WorkItemConfigurationsInner client = this.inner(); + return client.createAsync(resourceGroupName, resourceName, workItemConfigurationProperties) + .map(new Func1() { + @Override + public WorkItemConfiguration call(WorkItemConfigurationInner inner) { + return new WorkItemConfigurationImpl(inner, manager()); + } + }); + } + + @Override + public Observable getDefaultAsync(String resourceGroupName, String resourceName) { + WorkItemConfigurationsInner client = this.inner(); + return client.getDefaultAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public WorkItemConfiguration call(WorkItemConfigurationInner inner) { + return new WorkItemConfigurationImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationsInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationsInner.java new file mode 100644 index 000000000000..9a8a75126490 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkItemConfigurationsInner.java @@ -0,0 +1,443 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemConfigurationErrorException; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemCreateConfiguration; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in WorkItemConfigurations. + */ +public class WorkItemConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private WorkItemConfigurationsService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkItemConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkItemConfigurationsInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(WorkItemConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for WorkItemConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkItemConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkItemConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.WorkItemConfigurations create" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body WorkItemCreateConfiguration workItemConfigurationProperties, @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.applicationinsights.v2015_05_01.WorkItemConfigurations getDefault" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig") + Observable> getDefault(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.WorkItemConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("resourceName") String resourceName, @Path("workItemConfigId") String workItemConfigId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the list work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws WorkItemConfigurationErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<WorkItemConfigurationInner> object if successful. + */ + public List list(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets the list work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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> listAsync(String resourceGroupName, String resourceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets the list work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkItemConfigurationInner> object + */ + public Observable> listAsync(String resourceGroupName, String resourceName) { + return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkItemConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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(resourceGroupName, this.client.subscriptionId(), resourceName, 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 WorkItemConfigurationErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., WorkItemConfigurationErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(WorkItemConfigurationErrorException.class) + .build(response); + } + + /** + * Create a work item configuration for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigurationProperties Properties that need to be specified to create a work item configuration of a Application Insights component. + * @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 WorkItemConfigurationInner object if successful. + */ + public WorkItemConfigurationInner create(String resourceGroupName, String resourceName, WorkItemCreateConfiguration workItemConfigurationProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, workItemConfigurationProperties).toBlocking().single().body(); + } + + /** + * Create a work item configuration for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigurationProperties Properties that need to be specified to create a work item configuration of a Application Insights component. + * @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 createAsync(String resourceGroupName, String resourceName, WorkItemCreateConfiguration workItemConfigurationProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, resourceName, workItemConfigurationProperties), serviceCallback); + } + + /** + * Create a work item configuration for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigurationProperties Properties that need to be specified to create a work item configuration of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkItemConfigurationInner object + */ + public Observable createAsync(String resourceGroupName, String resourceName, WorkItemCreateConfiguration workItemConfigurationProperties) { + return createWithServiceResponseAsync(resourceGroupName, resourceName, workItemConfigurationProperties).map(new Func1, WorkItemConfigurationInner>() { + @Override + public WorkItemConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a work item configuration for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigurationProperties Properties that need to be specified to create a work item configuration of a Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkItemConfigurationInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String resourceName, WorkItemCreateConfiguration workItemConfigurationProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (workItemConfigurationProperties == null) { + throw new IllegalArgumentException("Parameter workItemConfigurationProperties is required and cannot be null."); + } + Validator.validate(workItemConfigurationProperties); + return service.create(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), workItemConfigurationProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(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 default work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 WorkItemConfigurationInner object if successful. + */ + public WorkItemConfigurationInner getDefault(String resourceGroupName, String resourceName) { + return getDefaultWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Gets default work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 getDefaultAsync(String resourceGroupName, String resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Gets default work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkItemConfigurationInner object + */ + public Observable getDefaultAsync(String resourceGroupName, String resourceName) { + return getDefaultWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, WorkItemConfigurationInner>() { + @Override + public WorkItemConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets default work item configurations that exist for the application. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkItemConfigurationInner object + */ + public Observable> getDefaultWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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.getDefault(resourceGroupName, this.client.subscriptionId(), resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultDelegate(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 work item configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object delete(String resourceGroupName, String resourceName, String workItemConfigId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, workItemConfigId).toBlocking().single().body(); + } + + /** + * Delete a work item configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String resourceName, String workItemConfigId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName, workItemConfigId), serviceCallback); + } + + /** + * Delete a work item configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable deleteAsync(String resourceGroupName, String resourceName, String workItemConfigId) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName, workItemConfigId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a work item configuration of an Application Insights component. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workItemConfigId The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName, String workItemConfigId) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (workItemConfigId == null) { + throw new IllegalArgumentException("Parameter workItemConfigId 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, this.client.subscriptionId(), resourceName, workItemConfigId, 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); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbookImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbookImpl.java new file mode 100644 index 000000000000..b589ddee74b8 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbookImpl.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Workbook; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.SharedTypeKind; +import java.util.List; +import java.util.Map; + +class WorkbookImpl extends CreatableUpdatableImpl implements Workbook, Workbook.Definition, Workbook.Update { + private String resourceGroupName; + private String resourceName; + private final InsightsManager manager; + + WorkbookImpl(String name, InsightsManager manager) { + super(name, new WorkbookInner()); + this.manager = manager; + // Set resource name + this.resourceName = name; + // + } + + WorkbookImpl(WorkbookInner inner, InsightsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.resourceName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroup"); + this.resourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workbooks"); + // + } + + @Override + public InsightsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WorkbooksInner client = this.manager().inner().workbooks(); + return client.createOrUpdateAsync(this.resourceGroupName, this.resourceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkbooksInner client = this.manager().inner().workbooks(); + return client.updateAsync(this.resourceGroupName, this.resourceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkbooksInner client = this.manager().inner().workbooks(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String category() { + return this.inner().category(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public SharedTypeKind kind() { + return this.inner().kind(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String serializedData() { + return this.inner().serializedData(); + } + + @Override + public SharedTypeKind sharedTypeKind() { + return this.inner().sharedTypeKind(); + } + + @Override + public String sourceResourceId() { + return this.inner().sourceResourceId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String timeModified() { + return this.inner().timeModified(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String userId() { + return this.inner().userId(); + } + + @Override + public String version() { + return this.inner().version(); + } + + @Override + public String workbookId() { + return this.inner().workbookId(); + } + + @Override + public String workbookName() { + return this.inner().workbookName(); + } + + @Override + public List workbookTags() { + return this.inner().workbookTags(); + } + + @Override + public WorkbookImpl withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public WorkbookImpl withCategory(String category) { + this.inner().withCategory(category); + return this; + } + + @Override + public WorkbookImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public WorkbookImpl withSerializedData(String serializedData) { + this.inner().withSerializedData(serializedData); + return this; + } + + @Override + public WorkbookImpl withSharedTypeKind(SharedTypeKind sharedTypeKind) { + this.inner().withSharedTypeKind(sharedTypeKind); + return this; + } + + @Override + public WorkbookImpl withUserId(String userId) { + this.inner().withUserId(userId); + return this; + } + + @Override + public WorkbookImpl withWorkbookId(String workbookId) { + this.inner().withWorkbookId(workbookId); + return this; + } + + @Override + public WorkbookImpl withWorkbookName(String workbookName) { + this.inner().withWorkbookName(workbookName); + return this; + } + + @Override + public WorkbookImpl withKind(SharedTypeKind kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public WorkbookImpl withSourceResourceId(String sourceResourceId) { + this.inner().withSourceResourceId(sourceResourceId); + return this; + } + + @Override + public WorkbookImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public WorkbookImpl withVersion(String version) { + this.inner().withVersion(version); + return this; + } + + @Override + public WorkbookImpl withWorkbookTags(List workbookTags) { + this.inner().withWorkbookTags(workbookTags); + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbookInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbookInner.java new file mode 100644 index 000000000000..3c82413af0c3 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbookInner.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.management.applicationinsights.v2015_05_01.SharedTypeKind; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkbookResource; + +/** + * An Application Insights workbook definition. + */ +@JsonFlatten +public class WorkbookInner extends WorkbookResource { + /** + * The kind of workbook. Choices are user and shared. Possible values + * include: 'user', 'shared'. + */ + @JsonProperty(value = "kind") + private SharedTypeKind kind; + + /** + * The user-defined name of the workbook. + */ + @JsonProperty(value = "properties.name", required = true) + private String workbookName; + + /** + * Configuration of this particular workbook. Configuration data is a + * string containing valid JSON. + */ + @JsonProperty(value = "properties.serializedData", required = true) + private String serializedData; + + /** + * This instance's version of the data model. This can change as new + * features are added that can be marked workbook. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Internally assigned unique id of the workbook definition. + */ + @JsonProperty(value = "properties.workbookId", required = true) + private String workbookId; + + /** + * Enum indicating if this workbook definition is owned by a specific user + * or is shared between all users with access to the Application Insights + * component. Possible values include: 'user', 'shared'. + */ + @JsonProperty(value = "properties.kind", required = true) + private SharedTypeKind sharedTypeKind; + + /** + * Date and time in UTC of the last modification that was made to this + * workbook definition. + */ + @JsonProperty(value = "properties.timeModified", access = JsonProperty.Access.WRITE_ONLY) + private String timeModified; + + /** + * Workbook category, as defined by the user at creation time. + */ + @JsonProperty(value = "properties.category", required = true) + private String category; + + /** + * A list of 0 or more tags that are associated with this workbook + * definition. + */ + @JsonProperty(value = "properties.tags") + private List workbookTags; + + /** + * Unique user id of the specific user that owns this workbook. + */ + @JsonProperty(value = "properties.userId", required = true) + private String userId; + + /** + * Optional resourceId for a source resource. + */ + @JsonProperty(value = "properties.sourceResourceId") + private String sourceResourceId; + + /** + * Get the kind of workbook. Choices are user and shared. Possible values include: 'user', 'shared'. + * + * @return the kind value + */ + public SharedTypeKind kind() { + return this.kind; + } + + /** + * Set the kind of workbook. Choices are user and shared. Possible values include: 'user', 'shared'. + * + * @param kind the kind value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withKind(SharedTypeKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the user-defined name of the workbook. + * + * @return the workbookName value + */ + public String workbookName() { + return this.workbookName; + } + + /** + * Set the user-defined name of the workbook. + * + * @param workbookName the workbookName value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withWorkbookName(String workbookName) { + this.workbookName = workbookName; + return this; + } + + /** + * Get configuration of this particular workbook. Configuration data is a string containing valid JSON. + * + * @return the serializedData value + */ + public String serializedData() { + return this.serializedData; + } + + /** + * Set configuration of this particular workbook. Configuration data is a string containing valid JSON. + * + * @param serializedData the serializedData value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withSerializedData(String serializedData) { + this.serializedData = serializedData; + return this; + } + + /** + * Get this instance's version of the data model. This can change as new features are added that can be marked workbook. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set this instance's version of the data model. This can change as new features are added that can be marked workbook. + * + * @param version the version value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get internally assigned unique id of the workbook definition. + * + * @return the workbookId value + */ + public String workbookId() { + return this.workbookId; + } + + /** + * Set internally assigned unique id of the workbook definition. + * + * @param workbookId the workbookId value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withWorkbookId(String workbookId) { + this.workbookId = workbookId; + return this; + } + + /** + * Get enum indicating if this workbook definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'user', 'shared'. + * + * @return the sharedTypeKind value + */ + public SharedTypeKind sharedTypeKind() { + return this.sharedTypeKind; + } + + /** + * Set enum indicating if this workbook definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'user', 'shared'. + * + * @param sharedTypeKind the sharedTypeKind value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withSharedTypeKind(SharedTypeKind sharedTypeKind) { + this.sharedTypeKind = sharedTypeKind; + return this; + } + + /** + * Get date and time in UTC of the last modification that was made to this workbook definition. + * + * @return the timeModified value + */ + public String timeModified() { + return this.timeModified; + } + + /** + * Get workbook category, as defined by the user at creation time. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set workbook category, as defined by the user at creation time. + * + * @param category the category value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get a list of 0 or more tags that are associated with this workbook definition. + * + * @return the workbookTags value + */ + public List workbookTags() { + return this.workbookTags; + } + + /** + * Set a list of 0 or more tags that are associated with this workbook definition. + * + * @param workbookTags the workbookTags value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withWorkbookTags(List workbookTags) { + this.workbookTags = workbookTags; + return this; + } + + /** + * Get unique user id of the specific user that owns this workbook. + * + * @return the userId value + */ + public String userId() { + return this.userId; + } + + /** + * Set unique user id of the specific user that owns this workbook. + * + * @param userId the userId value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Get optional resourceId for a source resource. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set optional resourceId for a source resource. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the WorkbookInner object itself. + */ + public WorkbookInner withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksImpl.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksImpl.java new file mode 100644 index 000000000000..852f6cc23fdc --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksImpl.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Workbooks; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.Workbook; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.CategoryType; + +class WorkbooksImpl extends WrapperImpl implements Workbooks { + private final InsightsManager manager; + + WorkbooksImpl(InsightsManager manager) { + super(manager.inner().workbooks()); + this.manager = manager; + } + + public InsightsManager manager() { + return this.manager; + } + + @Override + public WorkbookImpl define(String name) { + return wrapModel(name); + } + + private WorkbookImpl wrapModel(WorkbookInner inner) { + return new WorkbookImpl(inner, manager()); + } + + private WorkbookImpl wrapModel(String name) { + return new WorkbookImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String resourceName) { + WorkbooksInner client = this.inner(); + return client.getAsync(resourceGroupName, resourceName) + .map(new Func1() { + @Override + public Workbook call(WorkbookInner inner) { + return new WorkbookImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String resourceName) { + WorkbooksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, resourceName).toCompletable(); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName, CategoryType category) { + WorkbooksInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName, category) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Workbook call(WorkbookInner inner) { + return new WorkbookImpl(inner, manager()); + } + }); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java new file mode 100644 index 000000000000..211eba232243 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java @@ -0,0 +1,634 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.CategoryType; +import com.microsoft.azure.management.applicationinsights.v2015_05_01.WorkbookErrorException; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 Workbooks. + */ +public class WorkbooksInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private WorkbooksService service; + /** The service client containing this operation class. */ + private ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkbooksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkbooksInner(Retrofit retrofit, ApplicationInsightsManagementClientImpl client) { + this.service = retrofit.create(WorkbooksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Workbooks to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkbooksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.Workbooks listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("category") CategoryType category, @Query("tags") String tags, @Query("canFetchContent") Boolean canFetchContent, @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.applicationinsights.v2015_05_01.Workbooks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.Workbooks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @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.applicationinsights.v2015_05_01.Workbooks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body WorkbookInner workbookProperties, @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.applicationinsights.v2015_05_01.Workbooks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Body WorkbookInner workbookProperties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws WorkbookErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<WorkbookInner> object if successful. + */ + public List listByResourceGroup(String resourceGroupName, CategoryType category) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, category).toBlocking().single().body(); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @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> listByResourceGroupAsync(String resourceGroupName, CategoryType category, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName, category), serviceCallback); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkbookInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName, CategoryType category) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, category).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkbookInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName, CategoryType category) { + 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 (category == null) { + throw new IllegalArgumentException("Parameter category is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final List tags = null; + final Boolean canFetchContent = null; + String tagsConverted = this.client.serializerAdapter().serializeList(tags, CollectionFormat.CSV); + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, category, tagsConverted, canFetchContent, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @param tags Tags presents on each workbook returned. + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws WorkbookErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<WorkbookInner> object if successful. + */ + public List listByResourceGroup(String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, category, tags, canFetchContent).toBlocking().single().body(); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @param tags Tags presents on each workbook returned. + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. + * @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> listByResourceGroupAsync(String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName, category, tags, canFetchContent), serviceCallback); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @param tags Tags presents on each workbook returned. + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkbookInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, category, tags, canFetchContent).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all Workbooks defined within a specified resource group and category. + * + * @param resourceGroupName The name of the resource group. + * @param category Category of workbook to return. Possible values include: 'workbook', 'TSG', 'performance', 'retention' + * @param tags Tags presents on each workbook returned. + * @param canFetchContent Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkbookInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent) { + 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 (category == null) { + throw new IllegalArgumentException("Parameter category 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(tags); + String tagsConverted = this.client.serializerAdapter().serializeList(tags, CollectionFormat.CSV); + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, category, tagsConverted, canFetchContent, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws WorkbookErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., WorkbookErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(WorkbookErrorException.class) + .build(response); + } + + /** + * Get a single workbook by its resourceName. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws WorkbookErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkbookInner object if successful. + */ + public WorkbookInner get(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Get a single workbook by its resourceName. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Get a single workbook by its resourceName. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkbookInner object + */ + public Observable getAsync(String resourceGroupName, String resourceName) { + return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, WorkbookInner>() { + @Override + public WorkbookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a single workbook by its resourceName. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkbookInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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, resourceName, 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 WorkbookErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(WorkbookErrorException.class) + .build(response); + } + + /** + * Delete a workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws WorkbookErrorException 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 resourceName) { + deleteWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); + } + + /** + * Delete a workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component 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 resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); + } + + /** + * Delete a workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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, resourceName, 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 WorkbookErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(WorkbookErrorException.class) + .build(response); + } + + /** + * Create a new workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws WorkbookErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkbookInner object if successful. + */ + public WorkbookInner createOrUpdate(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties).toBlocking().single().body(); + } + + /** + * Create a new workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @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 resourceName, WorkbookInner workbookProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties), serviceCallback); + } + + /** + * Create a new workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkbookInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties).map(new Func1, WorkbookInner>() { + @Override + public WorkbookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new workbook. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkbookInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (workbookProperties == null) { + throw new IllegalArgumentException("Parameter workbookProperties is required and cannot be null."); + } + Validator.validate(workbookProperties); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), workbookProperties, 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 WorkbookErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(WorkbookErrorException.class) + .build(response); + } + + /** + * Updates a workbook that has already been added. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws WorkbookErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkbookInner object if successful. + */ + public WorkbookInner update(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties).toBlocking().single().body(); + } + + /** + * Updates a workbook that has already been added. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties), serviceCallback); + } + + /** + * Updates a workbook that has already been added. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkbookInner object + */ + public Observable updateAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + return updateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties).map(new Func1, WorkbookInner>() { + @Override + public WorkbookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a workbook that has already been added. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the Application Insights component resource. + * @param workbookProperties Properties that need to be specified to create a new workbook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkbookInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + 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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName 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 (workbookProperties == null) { + throw new IllegalArgumentException("Parameter workbookProperties is required and cannot be null."); + } + Validator.validate(workbookProperties); + return service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), workbookProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws WorkbookErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(WorkbookErrorException.class) + .build(response); + } + +} diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/package-info.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/package-info.java new file mode 100644 index 000000000000..5e52b737a8d8 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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 ApplicationInsightsManagementClient. + * Composite Swagger for Application Insights Management Client. + */ +package com.microsoft.azure.management.applicationinsights.v2015_05_01.implementation; diff --git a/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/package-info.java b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/package-info.java new file mode 100644 index 000000000000..56161e1a7220 --- /dev/null +++ b/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/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 ApplicationInsightsManagementClient. + * Composite Swagger for Application Insights Management Client. + */ +package com.microsoft.azure.management.applicationinsights.v2015_05_01;