diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md index fc476f67b51b6..77f4166b48342 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-05-10) +- Azure Resource Manager ApplicationInsights client library for Java. This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. Composite Swagger for Application Insights Management Client. Package tag package-preview-2020-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-20) diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md index d106b2b5355d6..ac9d2b8c2525d 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ApplicationInsights client library for Java. -This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. Composite Swagger for Application Insights Management Client. Package tag package-2020-10-20. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. Composite Swagger for Application Insights Management Client. Package tag package-preview-2020-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-applicationinsights - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml index e34895bb9282d..480bd979a34b2 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for ApplicationInsights Management - This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Composite Swagger for Application Insights Management Client. Package tag package-2020-10-20. + This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Composite Swagger for Application Insights Management Client. Package tag package-preview-2020-06. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java index bd7b5e4889807..95fb9347f8a17 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/ApplicationInsightsManager.java @@ -28,10 +28,12 @@ import com.azure.resourcemanager.applicationinsights.implementation.ComponentAvailableFeaturesImpl; import com.azure.resourcemanager.applicationinsights.implementation.ComponentCurrentBillingFeaturesImpl; import com.azure.resourcemanager.applicationinsights.implementation.ComponentFeatureCapabilitiesImpl; +import com.azure.resourcemanager.applicationinsights.implementation.ComponentLinkedStorageAccountsOperationsImpl; import com.azure.resourcemanager.applicationinsights.implementation.ComponentQuotaStatusImpl; import com.azure.resourcemanager.applicationinsights.implementation.ComponentsImpl; import com.azure.resourcemanager.applicationinsights.implementation.ExportConfigurationsImpl; import com.azure.resourcemanager.applicationinsights.implementation.FavoritesImpl; +import com.azure.resourcemanager.applicationinsights.implementation.LiveTokensImpl; import com.azure.resourcemanager.applicationinsights.implementation.MyWorkbooksImpl; import com.azure.resourcemanager.applicationinsights.implementation.OperationsImpl; import com.azure.resourcemanager.applicationinsights.implementation.ProactiveDetectionConfigurationsImpl; @@ -45,10 +47,12 @@ import com.azure.resourcemanager.applicationinsights.models.ComponentAvailableFeatures; import com.azure.resourcemanager.applicationinsights.models.ComponentCurrentBillingFeatures; import com.azure.resourcemanager.applicationinsights.models.ComponentFeatureCapabilities; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsOperations; import com.azure.resourcemanager.applicationinsights.models.ComponentQuotaStatus; import com.azure.resourcemanager.applicationinsights.models.Components; import com.azure.resourcemanager.applicationinsights.models.ExportConfigurations; import com.azure.resourcemanager.applicationinsights.models.Favorites; +import com.azure.resourcemanager.applicationinsights.models.LiveTokens; import com.azure.resourcemanager.applicationinsights.models.MyWorkbooks; import com.azure.resourcemanager.applicationinsights.models.Operations; import com.azure.resourcemanager.applicationinsights.models.ProactiveDetectionConfigurations; @@ -64,7 +68,7 @@ /** Entry point to ApplicationInsightsManager. Composite Swagger for Application Insights Management Client. */ public final class ApplicationInsightsManager { - private AnalyticsItems analyticsItems; + private Operations operations; private Annotations annotations; @@ -82,8 +86,6 @@ public final class ApplicationInsightsManager { private ProactiveDetectionConfigurations proactiveDetectionConfigurations; - private Components components; - private WorkItemConfigurations workItemConfigurations; private Favorites favorites; @@ -92,11 +94,17 @@ public final class ApplicationInsightsManager { private WebTests webTests; - private MyWorkbooks myWorkbooks; + private AnalyticsItems analyticsItems; private Workbooks workbooks; - private Operations operations; + private MyWorkbooks myWorkbooks; + + private Components components; + + private ComponentLinkedStorageAccountsOperations componentLinkedStorageAccountsOperations; + + private LiveTokens liveTokens; private final ApplicationInsightsManagementClient clientObject; @@ -261,12 +269,12 @@ public ApplicationInsightsManager authenticate(TokenCredential credential, Azure } } - /** @return Resource collection API of AnalyticsItems. */ - public AnalyticsItems analyticsItems() { - if (this.analyticsItems == null) { - this.analyticsItems = new AnalyticsItemsImpl(clientObject.getAnalyticsItems(), this); + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return analyticsItems; + return operations; } /** @return Resource collection API of Annotations. */ @@ -337,14 +345,6 @@ public ProactiveDetectionConfigurations proactiveDetectionConfigurations() { return proactiveDetectionConfigurations; } - /** @return Resource collection API of Components. */ - public Components components() { - if (this.components == null) { - this.components = new ComponentsImpl(clientObject.getComponents(), this); - } - return components; - } - /** @return Resource collection API of WorkItemConfigurations. */ public WorkItemConfigurations workItemConfigurations() { if (this.workItemConfigurations == null) { @@ -378,12 +378,12 @@ public WebTests webTests() { return webTests; } - /** @return Resource collection API of MyWorkbooks. */ - public MyWorkbooks myWorkbooks() { - if (this.myWorkbooks == null) { - this.myWorkbooks = new MyWorkbooksImpl(clientObject.getMyWorkbooks(), this); + /** @return Resource collection API of AnalyticsItems. */ + public AnalyticsItems analyticsItems() { + if (this.analyticsItems == null) { + this.analyticsItems = new AnalyticsItemsImpl(clientObject.getAnalyticsItems(), this); } - return myWorkbooks; + return analyticsItems; } /** @return Resource collection API of Workbooks. */ @@ -394,12 +394,38 @@ public Workbooks workbooks() { return workbooks; } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + /** @return Resource collection API of MyWorkbooks. */ + public MyWorkbooks myWorkbooks() { + if (this.myWorkbooks == null) { + this.myWorkbooks = new MyWorkbooksImpl(clientObject.getMyWorkbooks(), this); } - return operations; + return myWorkbooks; + } + + /** @return Resource collection API of Components. */ + public Components components() { + if (this.components == null) { + this.components = new ComponentsImpl(clientObject.getComponents(), this); + } + return components; + } + + /** @return Resource collection API of ComponentLinkedStorageAccountsOperations. */ + public ComponentLinkedStorageAccountsOperations componentLinkedStorageAccountsOperations() { + if (this.componentLinkedStorageAccountsOperations == null) { + this.componentLinkedStorageAccountsOperations = + new ComponentLinkedStorageAccountsOperationsImpl( + clientObject.getComponentLinkedStorageAccountsOperations(), this); + } + return componentLinkedStorageAccountsOperations; + } + + /** @return Resource collection API of LiveTokens. */ + public LiveTokens liveTokens() { + if (this.liveTokens == null) { + this.liveTokens = new LiveTokensImpl(clientObject.getLiveTokens(), this); + } + return liveTokens; } /** diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java index 575ecdd9abe75..fd7e78fb37795 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ApplicationInsightsManagementClient.java @@ -38,11 +38,11 @@ public interface ApplicationInsightsManagementClient { Duration getDefaultPollInterval(); /** - * Gets the AnalyticsItemsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the AnalyticsItemsClient object. + * @return the OperationsClient object. */ - AnalyticsItemsClient getAnalyticsItems(); + OperationsClient getOperations(); /** * Gets the AnnotationsClient object to access its operations. @@ -100,13 +100,6 @@ public interface ApplicationInsightsManagementClient { */ ProactiveDetectionConfigurationsClient getProactiveDetectionConfigurations(); - /** - * Gets the ComponentsClient object to access its operations. - * - * @return the ComponentsClient object. - */ - ComponentsClient getComponents(); - /** * Gets the WorkItemConfigurationsClient object to access its operations. * @@ -136,11 +129,11 @@ public interface ApplicationInsightsManagementClient { WebTestsClient getWebTests(); /** - * Gets the MyWorkbooksClient object to access its operations. + * Gets the AnalyticsItemsClient object to access its operations. * - * @return the MyWorkbooksClient object. + * @return the AnalyticsItemsClient object. */ - MyWorkbooksClient getMyWorkbooks(); + AnalyticsItemsClient getAnalyticsItems(); /** * Gets the WorkbooksClient object to access its operations. @@ -150,9 +143,30 @@ public interface ApplicationInsightsManagementClient { WorkbooksClient getWorkbooks(); /** - * Gets the OperationsClient object to access its operations. + * Gets the MyWorkbooksClient object to access its operations. * - * @return the OperationsClient object. + * @return the MyWorkbooksClient object. */ - OperationsClient getOperations(); + MyWorkbooksClient getMyWorkbooks(); + + /** + * Gets the ComponentsClient object to access its operations. + * + * @return the ComponentsClient object. + */ + ComponentsClient getComponents(); + + /** + * Gets the ComponentLinkedStorageAccountsOperationsClient object to access its operations. + * + * @return the ComponentLinkedStorageAccountsOperationsClient object. + */ + ComponentLinkedStorageAccountsOperationsClient getComponentLinkedStorageAccountsOperations(); + + /** + * Gets the LiveTokensClient object to access its operations. + * + * @return the LiveTokensClient object. + */ + LiveTokensClient getLiveTokens(); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ComponentLinkedStorageAccountsOperationsClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ComponentLinkedStorageAccountsOperationsClient.java new file mode 100644 index 0000000000000..2f3430b9aa8ad --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ComponentLinkedStorageAccountsOperationsClient.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsPatch; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** + * An instance of this class provides access to all the operations defined in + * ComponentLinkedStorageAccountsOperationsClient. + */ +public interface ComponentLinkedStorageAccountsOperationsClient { + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentLinkedStorageAccountsInner get(String resourceGroupName, String resourceName, StorageType storageType); + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context); + + /** + * Replace current linked storage account for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for + * an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentLinkedStorageAccountsInner createAndUpdate( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties); + + /** + * Replace current linked storage account for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for + * an Application Insights component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createAndUpdateWithResponse( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties, + Context context); + + /** + * Update linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts + * for an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentLinkedStorageAccountsInner update( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties); + + /** + * Update linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts + * for an Application Insights component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties, + Context context); + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, StorageType storageType); + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/LiveTokensClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/LiveTokensClient.java new file mode 100644 index 0000000000000..ea0169cb7b165 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/LiveTokensClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.LiveTokenResponseInner; + +/** An instance of this class provides access to all the operations defined in LiveTokensClient. */ +public interface LiveTokensClient { + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveTokenResponseInner get(String resourceUri); + + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/MyWorkbooksClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/MyWorkbooksClient.java index 46834ff927d30..44c0b68c8d378 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/MyWorkbooksClient.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/MyWorkbooksClient.java @@ -21,8 +21,7 @@ public interface MyWorkbooksClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @@ -35,32 +34,24 @@ public interface MyWorkbooksClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context); + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context); /** * Get all private workbooks defined within a specified subscription and category. * * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -76,8 +67,7 @@ PagedIterable listByResourceGroup( * false, only return summary content for workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -91,8 +81,7 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -106,8 +95,7 @@ PagedIterable list( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -121,8 +109,7 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -135,8 +122,7 @@ Response getByResourceGroupWithResponse( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @@ -150,8 +136,7 @@ Response getByResourceGroupWithResponse( * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @@ -164,21 +149,15 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( - String resourceGroupName, - String resourceName, - MyWorkbookInner workbookProperties, - String sourceId, - Context context); + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, Context context); /** * Updates a private workbook that has already been added. @@ -187,8 +166,7 @@ Response createOrUpdateWithResponse( * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @@ -201,19 +179,13 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( - String resourceGroupName, - String resourceName, - MyWorkbookInner workbookProperties, - String sourceId, - Context context); + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, Context context); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/OperationsClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/OperationsClient.java index cf11e5eb39881..1e2ec3a8b7524 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/OperationsClient.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/OperationsClient.java @@ -9,6 +9,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.OperationInner; +import com.azure.resourcemanager.applicationinsights.fluent.models.OperationLiveInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { @@ -17,7 +18,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,8 +30,30 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); + + /** + * List the available operations supported by the resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the available operations supported by the resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java index 0d76cb25e105d..291cda6c467da 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbooksClient.java @@ -11,50 +11,17 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookInner; import com.azure.resourcemanager.applicationinsights.models.CategoryType; -import com.azure.resourcemanager.applicationinsights.models.WorkbookUpdateParameters; import java.util.List; /** An instance of this class provides access to all the operations defined in WorkbooksClient. */ public interface WorkbooksClient { - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(CategoryType category); - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - CategoryType category, List tags, Boolean canFetchContent, Context context); - /** * Get all Workbooks defined within a specified resource group and category. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @@ -67,24 +34,17 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context); + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context); /** * Get a single workbook by its resourceName. @@ -92,8 +52,7 @@ PagedIterable listByResourceGroup( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -107,8 +66,7 @@ PagedIterable listByResourceGroup( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -122,8 +80,7 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -136,8 +93,7 @@ Response getByResourceGroupWithResponse( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @@ -151,8 +107,7 @@ Response getByResourceGroupWithResponse( * @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 com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @@ -165,55 +120,43 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( - String resourceGroupName, - String resourceName, - WorkbookInner workbookProperties, - String sourceId, - Context context); + String resourceGroupName, String resourceName, WorkbookInner workbookProperties, Context context); /** * Updates a workbook that has already been added. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkbookInner update(String resourceGroupName, String resourceName); + WorkbookInner update(String resourceGroupName, String resourceName, WorkbookInner workbookProperties); /** * Updates a workbook that has already been added. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @param workbookUpdateParameters Properties that need to be specified to create a new workbook. + * @param workbookProperties Properties that need to be specified to create a new workbook. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( - String resourceGroupName, - String resourceName, - String sourceId, - WorkbookUpdateParameters workbookUpdateParameters, - Context context); + String resourceGroupName, String resourceName, WorkbookInner workbookProperties, Context context); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentInner.java index 5b3fc73c3a261..0007b4b894d7e 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentInner.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentInner.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.applicationinsights.models.FlowType; import com.azure.resourcemanager.applicationinsights.models.IngestionMode; import com.azure.resourcemanager.applicationinsights.models.PrivateLinkScopedResource; +import com.azure.resourcemanager.applicationinsights.models.PublicNetworkAccessType; import com.azure.resourcemanager.applicationinsights.models.RequestSource; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -149,6 +150,18 @@ public class ApplicationInsightsComponentInner extends ComponentsResource { @JsonProperty(value = "properties.PrivateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) private List privateLinkScopedResources; + /* + * The network access type for accessing Application Insights ingestion. + */ + @JsonProperty(value = "properties.publicNetworkAccessForIngestion") + private PublicNetworkAccessType publicNetworkAccessForIngestion; + + /* + * The network access type for accessing Application Insights query. + */ + @JsonProperty(value = "properties.publicNetworkAccessForQuery") + private PublicNetworkAccessType publicNetworkAccessForQuery; + /* * Indicates the flow of the ingestion. */ @@ -432,6 +445,50 @@ public List privateLinkScopedResources() { return this.privateLinkScopedResources; } + /** + * Get the publicNetworkAccessForIngestion property: The network access type for accessing Application Insights + * ingestion. + * + * @return the publicNetworkAccessForIngestion value. + */ + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.publicNetworkAccessForIngestion; + } + + /** + * Set the publicNetworkAccessForIngestion property: The network access type for accessing Application Insights + * ingestion. + * + * @param publicNetworkAccessForIngestion the publicNetworkAccessForIngestion value to set. + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withPublicNetworkAccessForIngestion( + PublicNetworkAccessType publicNetworkAccessForIngestion) { + this.publicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + return this; + } + + /** + * Get the publicNetworkAccessForQuery property: The network access type for accessing Application Insights query. + * + * @return the publicNetworkAccessForQuery value. + */ + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.publicNetworkAccessForQuery; + } + + /** + * Set the publicNetworkAccessForQuery property: The network access type for accessing Application Insights query. + * + * @param publicNetworkAccessForQuery the publicNetworkAccessForQuery value to set. + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withPublicNetworkAccessForQuery( + PublicNetworkAccessType publicNetworkAccessForQuery) { + this.publicNetworkAccessForQuery = publicNetworkAccessForQuery; + return this; + } + /** * Get the ingestionMode property: Indicates the flow of the ingestion. * diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ComponentLinkedStorageAccountsInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ComponentLinkedStorageAccountsInner.java new file mode 100644 index 0000000000000..4b5ba15233b98 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ComponentLinkedStorageAccountsInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Application Insights component linked storage accounts. */ +@JsonFlatten +@Fluent +public class ComponentLinkedStorageAccountsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentLinkedStorageAccountsInner.class); + + /* + * Linked storage account resource ID + */ + @JsonProperty(value = "properties.linkedStorageAccount") + private String linkedStorageAccount; + + /** + * Get the linkedStorageAccount property: Linked storage account resource ID. + * + * @return the linkedStorageAccount value. + */ + public String linkedStorageAccount() { + return this.linkedStorageAccount; + } + + /** + * Set the linkedStorageAccount property: Linked storage account resource ID. + * + * @param linkedStorageAccount the linkedStorageAccount value to set. + * @return the ComponentLinkedStorageAccountsInner object itself. + */ + public ComponentLinkedStorageAccountsInner withLinkedStorageAccount(String linkedStorageAccount) { + this.linkedStorageAccount = linkedStorageAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ErrorDefinition.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LiveTokenResponseInner.java similarity index 54% rename from sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ErrorDefinition.java rename to sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LiveTokenResponseInner.java index af911f5bb338c..19d5a6f6a5312 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ErrorDefinition.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LiveTokenResponseInner.java @@ -2,32 +2,31 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.applicationinsights.models; +package com.azure.resourcemanager.applicationinsights.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Error response. */ +/** The response to a live token query. */ @Immutable -public final class ErrorDefinition extends ManagementError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorDefinition.class); +public final class LiveTokenResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveTokenResponseInner.class); /* - * Internal error details. + * JWT token for accessing live metrics stream data. */ - @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) - private Object innererror; + @JsonProperty(value = "liveToken", access = JsonProperty.Access.WRITE_ONLY) + private String liveToken; /** - * Get the innererror property: Internal error details. + * Get the liveToken property: JWT token for accessing live metrics stream data. * - * @return the innererror value. + * @return the liveToken value. */ - public Object getInnererror() { - return this.innererror; + public String liveToken() { + return this.liveToken; } /** diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java index f475ac944cceb..b9523134e8580 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java @@ -7,9 +7,8 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.applicationinsights.models.Kind; -import com.azure.resourcemanager.applicationinsights.models.ManagedIdentity; import com.azure.resourcemanager.applicationinsights.models.MyWorkbookResource; +import com.azure.resourcemanager.applicationinsights.models.SharedTypeKind; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -25,7 +24,7 @@ public class MyWorkbookInner extends MyWorkbookResource { * The kind of workbook. Choices are user and shared. */ @JsonProperty(value = "kind") - private Kind kind; + private SharedTypeKind kind; /* * The user-defined name of the private workbook. @@ -79,18 +78,12 @@ public class MyWorkbookInner extends MyWorkbookResource { @JsonProperty(value = "properties.sourceId") private String sourceId; - /* - * BYOS Storage Account URI - */ - @JsonProperty(value = "properties.storageUri") - private String storageUri; - /** * Get the kind property: The kind of workbook. Choices are user and shared. * * @return the kind value. */ - public Kind kind() { + public SharedTypeKind kind() { return this.kind; } @@ -100,7 +93,7 @@ public Kind kind() { * @param kind the kind value to set. * @return the MyWorkbookInner object itself. */ - public MyWorkbookInner withKind(Kind kind) { + public MyWorkbookInner withKind(SharedTypeKind kind) { this.kind = kind; return this; } @@ -250,33 +243,6 @@ public MyWorkbookInner withSourceId(String sourceId) { return this; } - /** - * Get the storageUri property: BYOS Storage Account URI. - * - * @return the storageUri value. - */ - public String storageUri() { - return this.storageUri; - } - - /** - * Set the storageUri property: BYOS Storage Account URI. - * - * @param storageUri the storageUri value to set. - * @return the MyWorkbookInner object itself. - */ - public MyWorkbookInner withStorageUri(String storageUri) { - this.storageUri = storageUri; - return this; - } - - /** {@inheritDoc} */ - @Override - public MyWorkbookInner withIdentity(ManagedIdentity identity) { - super.withIdentity(identity); - return this; - } - /** {@inheritDoc} */ @Override public MyWorkbookInner withId(String id) { @@ -298,13 +264,6 @@ public MyWorkbookInner withType(String type) { return this; } - /** {@inheritDoc} */ - @Override - public MyWorkbookInner withEtag(Map etag) { - super.withEtag(etag); - return this; - } - /** {@inheritDoc} */ @Override public MyWorkbookInner withLocation(String location) { diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/OperationInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/OperationInner.java index 2952d50f4b29f..d2105b1acfa7c 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/OperationInner.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/OperationInner.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Azure Workbooks REST API operation. */ +/** CDN REST API operation. */ @Fluent public final class OperationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/OperationLiveInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/OperationLiveInner.java new file mode 100644 index 0000000000000..40973b062bd19 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/OperationLiveInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.applicationinsights.models.OperationInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents an operation returned by the GetOperations request. */ +@Fluent +public final class OperationLiveInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationLiveInner.class); + + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of the operation + */ + @JsonProperty(value = "display") + private OperationInfo display; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationLiveInner object itself. + */ + public OperationLiveInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Display name of the operation. + * + * @return the display value. + */ + public OperationInfo display() { + return this.display; + } + + /** + * Set the display property: Display name of the operation. + * + * @param display the display value to set. + * @return the OperationLiveInner object itself. + */ + public OperationLiveInner withDisplay(OperationInfo display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationLiveInner object itself. + */ + public OperationLiveInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationLiveInner object itself. + */ + public OperationLiveInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookInner.java index f9540794682f4..e3bf69c30726e 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookInner.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookInner.java @@ -6,10 +6,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.applicationinsights.models.Kind; -import com.azure.resourcemanager.applicationinsights.models.ManagedIdentityAutoGenerated; +import com.azure.resourcemanager.applicationinsights.models.SharedTypeKind; +import com.azure.resourcemanager.applicationinsights.models.WorkbookResource; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,20 +17,20 @@ /** An Application Insights workbook definition. */ @JsonFlatten @Fluent -public class WorkbookInner extends Resource { +public class WorkbookInner extends WorkbookResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookInner.class); /* * The kind of workbook. Choices are user and shared. */ @JsonProperty(value = "kind") - private Kind kind; + private SharedTypeKind kind; /* - * The user-defined name (display name) of the workbook. + * The user-defined name of the workbook. */ - @JsonProperty(value = "properties.displayName") - private String displayName; + @JsonProperty(value = "properties.name") + private String namePropertiesName; /* * Configuration of this particular workbook. Configuration data is a @@ -41,11 +40,26 @@ public class WorkbookInner extends Resource { private String serializedData; /* - * Workbook version + * 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") + 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. + */ + @JsonProperty(value = "properties.kind") + private SharedTypeKind sharedTypeKind; + /* * Date and time in UTC of the last modification that was made to this * workbook definition. @@ -69,57 +83,21 @@ public class WorkbookInner extends Resource { /* * Unique user id of the specific user that owns this workbook. */ - @JsonProperty(value = "properties.userId", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "properties.userId") private String userId; /* - * ResourceId for a source resource. - */ - @JsonProperty(value = "properties.sourceId") - private String sourceId; - - /* - * BYOS Storage Account URI - */ - @JsonProperty(value = "properties.storageUri") - private String storageUri; - - /* - * Identity used for BYOS - */ - @JsonProperty(value = "identity") - private ManagedIdentityAutoGenerated identity; - - /* - * Resource etag + * Optional resourceId for a source resource. */ - @JsonProperty(value = "etag") - private Map etag; - - /* - * Azure resource Id - */ - @JsonProperty(value = "id") - private String id; - - /* - * Azure resource name - */ - @JsonProperty(value = "name") - private String name; - - /* - * Azure resource type - */ - @JsonProperty(value = "type") - private String type; + @JsonProperty(value = "properties.sourceResourceId") + private String sourceResourceId; /** * Get the kind property: The kind of workbook. Choices are user and shared. * * @return the kind value. */ - public Kind kind() { + public SharedTypeKind kind() { return this.kind; } @@ -129,28 +107,28 @@ public Kind kind() { * @param kind the kind value to set. * @return the WorkbookInner object itself. */ - public WorkbookInner withKind(Kind kind) { + public WorkbookInner withKind(SharedTypeKind kind) { this.kind = kind; return this; } /** - * Get the displayName property: The user-defined name (display name) of the workbook. + * Get the namePropertiesName property: The user-defined name of the workbook. * - * @return the displayName value. + * @return the namePropertiesName value. */ - public String displayName() { - return this.displayName; + public String namePropertiesName() { + return this.namePropertiesName; } /** - * Set the displayName property: The user-defined name (display name) of the workbook. + * Set the namePropertiesName property: The user-defined name of the workbook. * - * @param displayName the displayName value to set. + * @param namePropertiesName the namePropertiesName value to set. * @return the WorkbookInner object itself. */ - public WorkbookInner withDisplayName(String displayName) { - this.displayName = displayName; + public WorkbookInner withNamePropertiesName(String namePropertiesName) { + this.namePropertiesName = namePropertiesName; return this; } @@ -177,7 +155,8 @@ public WorkbookInner withSerializedData(String serializedData) { } /** - * Get the version property: Workbook version. + * Get the version property: 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. */ @@ -186,7 +165,8 @@ public String version() { } /** - * Set the version property: Workbook version. + * Set the version property: 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. @@ -196,6 +176,48 @@ public WorkbookInner withVersion(String version) { return this; } + /** + * Get the workbookId property: Internally assigned unique id of the workbook definition. + * + * @return the workbookId value. + */ + public String workbookId() { + return this.workbookId; + } + + /** + * Set the workbookId property: 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 the sharedTypeKind property: 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. + * + * @return the sharedTypeKind value. + */ + public SharedTypeKind sharedTypeKind() { + return this.sharedTypeKind; + } + + /** + * Set the sharedTypeKind property: 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. + * + * @param sharedTypeKind the sharedTypeKind value to set. + * @return the WorkbookInner object itself. + */ + public WorkbookInner withSharedTypeKind(SharedTypeKind sharedTypeKind) { + this.sharedTypeKind = sharedTypeKind; + return this; + } + /** * Get the timeModified property: Date and time in UTC of the last modification that was made to this workbook * definition. @@ -256,142 +278,33 @@ public String userId() { } /** - * Get the sourceId property: ResourceId for a source resource. - * - * @return the sourceId value. - */ - public String sourceId() { - return this.sourceId; - } - - /** - * Set the sourceId property: ResourceId for a source resource. - * - * @param sourceId the sourceId value to set. - * @return the WorkbookInner object itself. - */ - public WorkbookInner withSourceId(String sourceId) { - this.sourceId = sourceId; - return this; - } - - /** - * Get the storageUri property: BYOS Storage Account URI. - * - * @return the storageUri value. - */ - public String storageUri() { - return this.storageUri; - } - - /** - * Set the storageUri property: BYOS Storage Account URI. + * Set the userId property: Unique user id of the specific user that owns this workbook. * - * @param storageUri the storageUri value to set. + * @param userId the userId value to set. * @return the WorkbookInner object itself. */ - public WorkbookInner withStorageUri(String storageUri) { - this.storageUri = storageUri; + public WorkbookInner withUserId(String userId) { + this.userId = userId; return this; } /** - * Get the identity property: Identity used for BYOS. + * Get the sourceResourceId property: Optional resourceId for a source resource. * - * @return the identity value. + * @return the sourceResourceId value. */ - public ManagedIdentityAutoGenerated identity() { - return this.identity; + public String sourceResourceId() { + return this.sourceResourceId; } /** - * Set the identity property: Identity used for BYOS. + * Set the sourceResourceId property: Optional resourceId for a source resource. * - * @param identity the identity value to set. + * @param sourceResourceId the sourceResourceId value to set. * @return the WorkbookInner object itself. */ - public WorkbookInner withIdentity(ManagedIdentityAutoGenerated identity) { - this.identity = identity; - return this; - } - - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public Map etag() { - return this.etag; - } - - /** - * Set the etag property: Resource etag. - * - * @param etag the etag value to set. - * @return the WorkbookInner object itself. - */ - public WorkbookInner withEtag(Map etag) { - this.etag = etag; - return this; - } - - /** - * Get the id property: Azure resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Azure resource Id. - * - * @param id the id value to set. - * @return the WorkbookInner object itself. - */ - public WorkbookInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Azure resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Azure resource name. - * - * @param name the name value to set. - * @return the WorkbookInner object itself. - */ - public WorkbookInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Azure resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Azure resource type. - * - * @param type the type value to set. - * @return the WorkbookInner object itself. - */ - public WorkbookInner withType(String type) { - this.type = type; + public WorkbookInner withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; return this; } @@ -414,9 +327,8 @@ public WorkbookInner withTags(Map tags) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { - if (identity() != null) { - identity().validate(); - } + super.validate(); } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsComponentImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsComponentImpl.java index 1003169755bba..ecbf4137f8388 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsComponentImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsComponentImpl.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.applicationinsights.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentInner; import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponent; import com.azure.resourcemanager.applicationinsights.models.ApplicationType; +import com.azure.resourcemanager.applicationinsights.models.ComponentPurgeBody; +import com.azure.resourcemanager.applicationinsights.models.ComponentPurgeResponse; import com.azure.resourcemanager.applicationinsights.models.FlowType; import com.azure.resourcemanager.applicationinsights.models.IngestionMode; import com.azure.resourcemanager.applicationinsights.models.PrivateLinkScopedResource; +import com.azure.resourcemanager.applicationinsights.models.PublicNetworkAccessType; import com.azure.resourcemanager.applicationinsights.models.RequestSource; import com.azure.resourcemanager.applicationinsights.models.TagsResource; import java.time.OffsetDateTime; @@ -129,6 +133,14 @@ public List privateLinkScopedResources() { } } + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.innerModel().publicNetworkAccessForIngestion(); + } + + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.innerModel().publicNetworkAccessForQuery(); + } + public IngestionMode ingestionMode() { return this.innerModel().ingestionMode(); } @@ -241,6 +253,14 @@ public ApplicationInsightsComponent refresh(Context context) { return this; } + public ComponentPurgeResponse purge(ComponentPurgeBody body) { + return serviceManager.components().purge(resourceGroupName, resourceName, body); + } + + public Response purgeWithResponse(ComponentPurgeBody body, Context context) { + return serviceManager.components().purgeWithResponse(resourceGroupName, resourceName, body, context); + } + public ApplicationInsightsComponentImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -306,6 +326,18 @@ public ApplicationInsightsComponentImpl withImmediatePurgeDataOn30Days(Boolean i return this; } + public ApplicationInsightsComponentImpl withPublicNetworkAccessForIngestion( + PublicNetworkAccessType publicNetworkAccessForIngestion) { + this.innerModel().withPublicNetworkAccessForIngestion(publicNetworkAccessForIngestion); + return this; + } + + public ApplicationInsightsComponentImpl withPublicNetworkAccessForQuery( + PublicNetworkAccessType publicNetworkAccessForQuery) { + this.innerModel().withPublicNetworkAccessForQuery(publicNetworkAccessForQuery); + return this; + } + public ApplicationInsightsComponentImpl withIngestionMode(IngestionMode ingestionMode) { this.innerModel().withIngestionMode(ingestionMode); return this; diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java index 1f8a927f1fd14..0d9e158586221 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ApplicationInsightsManagementClientImpl.java @@ -28,10 +28,12 @@ import com.azure.resourcemanager.applicationinsights.fluent.ComponentAvailableFeaturesClient; import com.azure.resourcemanager.applicationinsights.fluent.ComponentCurrentBillingFeaturesClient; import com.azure.resourcemanager.applicationinsights.fluent.ComponentFeatureCapabilitiesClient; +import com.azure.resourcemanager.applicationinsights.fluent.ComponentLinkedStorageAccountsOperationsClient; import com.azure.resourcemanager.applicationinsights.fluent.ComponentQuotaStatusClient; import com.azure.resourcemanager.applicationinsights.fluent.ComponentsClient; import com.azure.resourcemanager.applicationinsights.fluent.ExportConfigurationsClient; import com.azure.resourcemanager.applicationinsights.fluent.FavoritesClient; +import com.azure.resourcemanager.applicationinsights.fluent.LiveTokensClient; import com.azure.resourcemanager.applicationinsights.fluent.MyWorkbooksClient; import com.azure.resourcemanager.applicationinsights.fluent.OperationsClient; import com.azure.resourcemanager.applicationinsights.fluent.ProactiveDetectionConfigurationsClient; @@ -114,16 +116,16 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The AnalyticsItemsClient object to access its operations. */ - private final AnalyticsItemsClient analyticsItems; + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; /** - * Gets the AnalyticsItemsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the AnalyticsItemsClient object. + * @return the OperationsClient object. */ - public AnalyticsItemsClient getAnalyticsItems() { - return this.analyticsItems; + public OperationsClient getOperations() { + return this.operations; } /** The AnnotationsClient object to access its operations. */ @@ -222,18 +224,6 @@ public ProactiveDetectionConfigurationsClient getProactiveDetectionConfiguration return this.proactiveDetectionConfigurations; } - /** The ComponentsClient object to access its operations. */ - private final ComponentsClient components; - - /** - * Gets the ComponentsClient object to access its operations. - * - * @return the ComponentsClient object. - */ - public ComponentsClient getComponents() { - return this.components; - } - /** The WorkItemConfigurationsClient object to access its operations. */ private final WorkItemConfigurationsClient workItemConfigurations; @@ -282,16 +272,16 @@ public WebTestsClient getWebTests() { return this.webTests; } - /** The MyWorkbooksClient object to access its operations. */ - private final MyWorkbooksClient myWorkbooks; + /** The AnalyticsItemsClient object to access its operations. */ + private final AnalyticsItemsClient analyticsItems; /** - * Gets the MyWorkbooksClient object to access its operations. + * Gets the AnalyticsItemsClient object to access its operations. * - * @return the MyWorkbooksClient object. + * @return the AnalyticsItemsClient object. */ - public MyWorkbooksClient getMyWorkbooks() { - return this.myWorkbooks; + public AnalyticsItemsClient getAnalyticsItems() { + return this.analyticsItems; } /** The WorkbooksClient object to access its operations. */ @@ -306,16 +296,52 @@ public WorkbooksClient getWorkbooks() { return this.workbooks; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The MyWorkbooksClient object to access its operations. */ + private final MyWorkbooksClient myWorkbooks; /** - * Gets the OperationsClient object to access its operations. + * Gets the MyWorkbooksClient object to access its operations. * - * @return the OperationsClient object. + * @return the MyWorkbooksClient object. */ - public OperationsClient getOperations() { - return this.operations; + public MyWorkbooksClient getMyWorkbooks() { + return this.myWorkbooks; + } + + /** The ComponentsClient object to access its operations. */ + private final ComponentsClient components; + + /** + * Gets the ComponentsClient object to access its operations. + * + * @return the ComponentsClient object. + */ + public ComponentsClient getComponents() { + return this.components; + } + + /** The ComponentLinkedStorageAccountsOperationsClient object to access its operations. */ + private final ComponentLinkedStorageAccountsOperationsClient componentLinkedStorageAccountsOperations; + + /** + * Gets the ComponentLinkedStorageAccountsOperationsClient object to access its operations. + * + * @return the ComponentLinkedStorageAccountsOperationsClient object. + */ + public ComponentLinkedStorageAccountsOperationsClient getComponentLinkedStorageAccountsOperations() { + return this.componentLinkedStorageAccountsOperations; + } + + /** The LiveTokensClient object to access its operations. */ + private final LiveTokensClient liveTokens; + + /** + * Gets the LiveTokensClient object to access its operations. + * + * @return the LiveTokensClient object. + */ + public LiveTokensClient getLiveTokens() { + return this.liveTokens; } /** @@ -340,7 +366,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.analyticsItems = new AnalyticsItemsClientImpl(this); + this.operations = new OperationsClientImpl(this); this.annotations = new AnnotationsClientImpl(this); this.apiKeys = new ApiKeysClientImpl(this); this.exportConfigurations = new ExportConfigurationsClientImpl(this); @@ -349,14 +375,16 @@ public OperationsClient getOperations() { this.componentFeatureCapabilities = new ComponentFeatureCapabilitiesClientImpl(this); this.componentAvailableFeatures = new ComponentAvailableFeaturesClientImpl(this); this.proactiveDetectionConfigurations = new ProactiveDetectionConfigurationsClientImpl(this); - this.components = new ComponentsClientImpl(this); this.workItemConfigurations = new WorkItemConfigurationsClientImpl(this); this.favorites = new FavoritesClientImpl(this); this.webTestLocations = new WebTestLocationsClientImpl(this); this.webTests = new WebTestsClientImpl(this); - this.myWorkbooks = new MyWorkbooksClientImpl(this); + this.analyticsItems = new AnalyticsItemsClientImpl(this); this.workbooks = new WorkbooksClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.myWorkbooks = new MyWorkbooksClientImpl(this); + this.components = new ComponentsClientImpl(this); + this.componentLinkedStorageAccountsOperations = new ComponentLinkedStorageAccountsOperationsClientImpl(this); + this.liveTokens = new LiveTokensClientImpl(this); } /** diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsImpl.java new file mode 100644 index 0000000000000..4c99cad4b0570 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccounts; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsPatch; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +public final class ComponentLinkedStorageAccountsImpl + implements ComponentLinkedStorageAccounts, + ComponentLinkedStorageAccounts.Definition, + ComponentLinkedStorageAccounts.Update { + private ComponentLinkedStorageAccountsInner innerObject; + + private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String linkedStorageAccount() { + return this.innerModel().linkedStorageAccount(); + } + + public ComponentLinkedStorageAccountsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private StorageType storageType; + + private ComponentLinkedStorageAccountsPatch updateLinkedStorageAccountsProperties; + + public ComponentLinkedStorageAccountsImpl withExistingComponent(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public ComponentLinkedStorageAccounts create() { + this.innerObject = + serviceManager + .serviceClient() + .getComponentLinkedStorageAccountsOperations() + .createAndUpdateWithResponse( + resourceGroupName, resourceName, storageType, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ComponentLinkedStorageAccounts create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getComponentLinkedStorageAccountsOperations() + .createAndUpdateWithResponse(resourceGroupName, resourceName, storageType, this.innerModel(), context) + .getValue(); + return this; + } + + ComponentLinkedStorageAccountsImpl( + StorageType name, com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerObject = new ComponentLinkedStorageAccountsInner(); + this.serviceManager = serviceManager; + this.storageType = name; + } + + public ComponentLinkedStorageAccountsImpl update() { + this.updateLinkedStorageAccountsProperties = new ComponentLinkedStorageAccountsPatch(); + return this; + } + + public ComponentLinkedStorageAccounts apply() { + this.innerObject = + serviceManager + .serviceClient() + .getComponentLinkedStorageAccountsOperations() + .updateWithResponse( + resourceGroupName, resourceName, storageType, updateLinkedStorageAccountsProperties, Context.NONE) + .getValue(); + return this; + } + + public ComponentLinkedStorageAccounts apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getComponentLinkedStorageAccountsOperations() + .updateWithResponse( + resourceGroupName, resourceName, storageType, updateLinkedStorageAccountsProperties, context) + .getValue(); + return this; + } + + ComponentLinkedStorageAccountsImpl( + ComponentLinkedStorageAccountsInner innerObject, + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "components"); + this.storageType = + StorageType.fromString(Utils.getValueFromIdByName(innerObject.id(), "linkedStorageAccounts")); + } + + public ComponentLinkedStorageAccounts refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getComponentLinkedStorageAccountsOperations() + .getWithResponse(resourceGroupName, resourceName, storageType, Context.NONE) + .getValue(); + return this; + } + + public ComponentLinkedStorageAccounts refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getComponentLinkedStorageAccountsOperations() + .getWithResponse(resourceGroupName, resourceName, storageType, context) + .getValue(); + return this; + } + + public ComponentLinkedStorageAccountsImpl withLinkedStorageAccount(String linkedStorageAccount) { + if (isInCreateMode()) { + this.innerModel().withLinkedStorageAccount(linkedStorageAccount); + return this; + } else { + this.updateLinkedStorageAccountsProperties.withLinkedStorageAccount(linkedStorageAccount); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsClientImpl.java new file mode 100644 index 0000000000000..ed2b771b7d223 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsClientImpl.java @@ -0,0 +1,888 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.applicationinsights.fluent.ComponentLinkedStorageAccountsOperationsClient; +import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsPatch; +import com.azure.resourcemanager.applicationinsights.models.StorageType; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ComponentLinkedStorageAccountsOperationsClient. + */ +public final class ComponentLinkedStorageAccountsOperationsClientImpl + implements ComponentLinkedStorageAccountsOperationsClient { + private final ClientLogger logger = new ClientLogger(ComponentLinkedStorageAccountsOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ComponentLinkedStorageAccountsOperationsService service; + + /** The service client containing this operation class. */ + private final ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of ComponentLinkedStorageAccountsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ComponentLinkedStorageAccountsOperationsClientImpl(ApplicationInsightsManagementClientImpl client) { + this.service = + RestProxy + .create( + ComponentLinkedStorageAccountsOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * ApplicationInsightsManagementClientComponentLinkedStorageAccountsOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApplicationInsightsM") + private interface ComponentLinkedStorageAccountsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components" + + "/{resourceName}/linkedStorageAccounts/{storageType}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceName") String resourceName, + @PathParam("storageType") StorageType storageType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components" + + "/{resourceName}/linkedStorageAccounts/{storageType}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createAndUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceName") String resourceName, + @PathParam("storageType") StorageType storageType, + @BodyParam("application/json") ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components" + + "/{resourceName}/linkedStorageAccounts/{storageType}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceName") String resourceName, + @PathParam("storageType") StorageType storageType, + @BodyParam("application/json") ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components" + + "/{resourceName}/linkedStorageAccounts/{storageType}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceName") String resourceName, + @PathParam("storageType") StorageType storageType, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, StorageType storageType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, StorageType storageType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + accept, + context); + } + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String resourceName, StorageType storageType) { + return getWithResponseAsync(resourceGroupName, resourceName, storageType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentLinkedStorageAccountsInner get( + String resourceGroupName, String resourceName, StorageType storageType) { + return getAsync(resourceGroupName, resourceName, storageType).block(); + } + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, storageType, context).block(); + } + + /** + * Replace current linked storage account for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for + * an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createAndUpdateWithResponseAsync( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + if (linkedStorageAccountsProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter linkedStorageAccountsProperties is required and cannot be null.")); + } else { + linkedStorageAccountsProperties.validate(); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createAndUpdate( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + linkedStorageAccountsProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Replace current linked storage account for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for + * an Application Insights component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createAndUpdateWithResponseAsync( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + if (linkedStorageAccountsProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter linkedStorageAccountsProperties is required and cannot be null.")); + } else { + linkedStorageAccountsProperties.validate(); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createAndUpdate( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + linkedStorageAccountsProperties, + accept, + context); + } + + /** + * Replace current linked storage account for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for + * an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAndUpdateAsync( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties) { + return createAndUpdateWithResponseAsync( + resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Replace current linked storage account for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for + * an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentLinkedStorageAccountsInner createAndUpdate( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties) { + return createAndUpdateAsync(resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties) + .block(); + } + + /** + * Replace current linked storage account for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update linked storage accounts for + * an Application Insights component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAndUpdateWithResponse( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties, + Context context) { + return createAndUpdateWithResponseAsync( + resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties, context) + .block(); + } + + /** + * Update linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts + * for an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + if (linkedStorageAccountsProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter linkedStorageAccountsProperties is required and cannot be null.")); + } else { + linkedStorageAccountsProperties.validate(); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + linkedStorageAccountsProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts + * for an Application Insights component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + if (linkedStorageAccountsProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter linkedStorageAccountsProperties is required and cannot be null.")); + } else { + linkedStorageAccountsProperties.validate(); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + linkedStorageAccountsProperties, + accept, + context); + } + + /** + * Update linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts + * for an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties) { + return updateWithResponseAsync(resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts + * for an Application Insights component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentLinkedStorageAccountsInner update( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties) { + return updateAsync(resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties).block(); + } + + /** + * Update linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param linkedStorageAccountsProperties Properties that need to be specified to update a linked storage accounts + * for an Application Insights component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String resourceName, + StorageType storageType, + ComponentLinkedStorageAccountsPatch linkedStorageAccountsProperties, + Context context) { + return updateWithResponseAsync( + resourceGroupName, resourceName, storageType, linkedStorageAccountsProperties, context) + .block(); + } + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String resourceName, StorageType storageType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String resourceName, StorageType storageType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (storageType == null) { + return Mono.error(new IllegalArgumentException("Parameter storageType is required and cannot be null.")); + } + final String apiVersion = "2020-03-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + resourceName, + storageType, + accept, + context); + } + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, StorageType storageType) { + return deleteWithResponseAsync(resourceGroupName, resourceName, storageType) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, StorageType storageType) { + deleteAsync(resourceGroupName, resourceName, storageType).block(); + } + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context) { + return deleteWithResponseAsync(resourceGroupName, resourceName, storageType, context).block(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsImpl.java new file mode 100644 index 0000000000000..b851202e9d9e8 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentLinkedStorageAccountsOperationsImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.applicationinsights.fluent.ComponentLinkedStorageAccountsOperationsClient; +import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccounts; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccountsOperations; +import com.azure.resourcemanager.applicationinsights.models.StorageType; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ComponentLinkedStorageAccountsOperationsImpl implements ComponentLinkedStorageAccountsOperations { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ComponentLinkedStorageAccountsOperationsImpl.class); + + private final ComponentLinkedStorageAccountsOperationsClient innerClient; + + private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager; + + public ComponentLinkedStorageAccountsOperationsImpl( + ComponentLinkedStorageAccountsOperationsClient innerClient, + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ComponentLinkedStorageAccounts get(String resourceGroupName, String resourceName, StorageType storageType) { + ComponentLinkedStorageAccountsInner inner = + this.serviceClient().get(resourceGroupName, resourceName, storageType); + if (inner != null) { + return new ComponentLinkedStorageAccountsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, resourceName, storageType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ComponentLinkedStorageAccountsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, StorageType storageType) { + this.serviceClient().delete(resourceGroupName, resourceName, storageType); + } + + public Response deleteWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, storageType, context); + } + + public ComponentLinkedStorageAccounts getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "components"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + StorageType storageType = StorageType.fromString(Utils.getValueFromIdByName(id, "linkedStorageAccounts")); + if (storageType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", + id))); + } + return this.getWithResponse(resourceGroupName, resourceName, storageType, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "components"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + StorageType storageType = StorageType.fromString(Utils.getValueFromIdByName(id, "linkedStorageAccounts")); + if (storageType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", + id))); + } + return this.getWithResponse(resourceGroupName, resourceName, storageType, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "components"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + StorageType storageType = StorageType.fromString(Utils.getValueFromIdByName(id, "linkedStorageAccounts")); + if (storageType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", + id))); + } + this.deleteWithResponse(resourceGroupName, resourceName, storageType, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "components"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + StorageType storageType = StorageType.fromString(Utils.getValueFromIdByName(id, "linkedStorageAccounts")); + if (storageType == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, resourceName, storageType, context); + } + + private ComponentLinkedStorageAccountsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() { + return this.serviceManager; + } + + public ComponentLinkedStorageAccountsImpl define(StorageType name) { + return new ComponentLinkedStorageAccountsImpl(name, this.manager()); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentsClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentsClientImpl.java index baea1133817b1..ae70131c5f229 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentsClientImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentsClientImpl.java @@ -126,7 +126,7 @@ Mono> getByResourceGroup( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components" + "/{resourceName}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @HostParam("$host") String endpoint, @@ -142,7 +142,7 @@ Mono> createOrUpdate( @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components" + "/{resourceName}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateTags( @HostParam("$host") String endpoint, @@ -228,7 +228,7 @@ private Mono> listSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -270,7 +270,7 @@ private Mono> listSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -367,7 +367,7 @@ private Mono> listByResourceGro new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -421,7 +421,7 @@ private Mono> listByResourceGro new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -538,7 +538,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; return FluxUtil .withContext( context -> @@ -586,7 +586,7 @@ private Mono> deleteWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; context = this.client.mergeContext(context); return service .delete( @@ -675,7 +675,7 @@ private Mono> getByResourceGroupWith if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -725,7 +725,7 @@ private Mono> getByResourceGroupWith if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -835,7 +835,7 @@ private Mono> createOrUpdateWithResp } else { insightProperties.validate(); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -897,7 +897,7 @@ private Mono> createOrUpdateWithResp } else { insightProperties.validate(); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1016,7 +1016,7 @@ private Mono> updateTagsWithResponse } else { componentTags.validate(); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1073,7 +1073,7 @@ private Mono> updateTagsWithResponse } else { componentTags.validate(); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1191,7 +1191,7 @@ private Mono> purgeWithResponseAsync( } else { body.validate(); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1253,7 +1253,7 @@ private Mono> purgeWithResponseAsync( } else { body.validate(); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1378,7 +1378,7 @@ private Mono> getPurgeStatusWithResp if (purgeId == null) { return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1433,7 +1433,7 @@ private Mono> getPurgeStatusWithResp if (purgeId == null) { return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); } - final String apiVersion = "2015-05-01"; + final String apiVersion = "2018-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokenResponseImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokenResponseImpl.java new file mode 100644 index 0000000000000..b012287eb24d5 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokenResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.implementation; + +import com.azure.resourcemanager.applicationinsights.fluent.models.LiveTokenResponseInner; +import com.azure.resourcemanager.applicationinsights.models.LiveTokenResponse; + +public final class LiveTokenResponseImpl implements LiveTokenResponse { + private LiveTokenResponseInner innerObject; + + private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager; + + LiveTokenResponseImpl( + LiveTokenResponseInner innerObject, + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String liveToken() { + return this.innerModel().liveToken(); + } + + public LiveTokenResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokensClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokensClientImpl.java new file mode 100644 index 0000000000000..82786da8d2647 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokensClientImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.applicationinsights.fluent.LiveTokensClient; +import com.azure.resourcemanager.applicationinsights.fluent.models.LiveTokenResponseInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LiveTokensClient. */ +public final class LiveTokensClientImpl implements LiveTokensClient { + private final ClientLogger logger = new ClientLogger(LiveTokensClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LiveTokensService service; + + /** The service client containing this operation class. */ + private final ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of LiveTokensClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LiveTokensClientImpl(ApplicationInsightsManagementClientImpl client) { + this.service = + RestProxy.create(LiveTokensService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationInsightsManagementClientLiveTokens to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApplicationInsightsM") + private interface LiveTokensService { + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/microsoft.insights/generatelivetoken") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String apiVersion = "2020-06-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceUri, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String apiVersion = "2020-06-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceUri, apiVersion, accept, context); + } + + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveTokenResponseInner get(String resourceUri) { + return getAsync(resourceUri).block(); + } + + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokensImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokensImpl.java new file mode 100644 index 0000000000000..83344b427302e --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/LiveTokensImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.applicationinsights.fluent.LiveTokensClient; +import com.azure.resourcemanager.applicationinsights.fluent.models.LiveTokenResponseInner; +import com.azure.resourcemanager.applicationinsights.models.LiveTokenResponse; +import com.azure.resourcemanager.applicationinsights.models.LiveTokens; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LiveTokensImpl implements LiveTokens { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveTokensImpl.class); + + private final LiveTokensClient innerClient; + + private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager; + + public LiveTokensImpl( + LiveTokensClient innerClient, + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LiveTokenResponse get(String resourceUri) { + LiveTokenResponseInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new LiveTokenResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LiveTokenResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LiveTokensClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbookImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbookImpl.java index 3f25483ea1550..d9d185599a0f1 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbookImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbookImpl.java @@ -7,9 +7,8 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.MyWorkbookInner; -import com.azure.resourcemanager.applicationinsights.models.Kind; -import com.azure.resourcemanager.applicationinsights.models.ManagedIdentity; import com.azure.resourcemanager.applicationinsights.models.MyWorkbook; +import com.azure.resourcemanager.applicationinsights.models.SharedTypeKind; import java.util.Collections; import java.util.List; import java.util.Map; @@ -32,10 +31,6 @@ public Map tags() { } } - public ManagedIdentity identity() { - return this.innerModel().identity(); - } - public String id() { return this.innerModel().id(); } @@ -48,16 +43,7 @@ public String type() { return this.innerModel().type(); } - public Map etag() { - Map inner = this.innerModel().etag(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Kind kind() { + public SharedTypeKind kind() { return this.innerModel().kind(); } @@ -98,10 +84,6 @@ public String sourceId() { return this.innerModel().sourceId(); } - public String storageUri() { - return this.innerModel().storageUri(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -122,10 +104,6 @@ private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager private String resourceName; - private String createSourceId; - - private String updateSourceId; - public MyWorkbookImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; @@ -136,8 +114,7 @@ public MyWorkbook create() { serviceManager .serviceClient() .getMyWorkbooks() - .createOrUpdateWithResponse( - resourceGroupName, resourceName, this.innerModel(), createSourceId, Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -147,7 +124,7 @@ public MyWorkbook create(Context context) { serviceManager .serviceClient() .getMyWorkbooks() - .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), createSourceId, context) + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) .getValue(); return this; } @@ -157,11 +134,9 @@ public MyWorkbook create(Context context) { this.innerObject = new MyWorkbookInner(); this.serviceManager = serviceManager; this.resourceName = name; - this.createSourceId = null; } public MyWorkbookImpl update() { - this.updateSourceId = null; return this; } @@ -170,7 +145,7 @@ public MyWorkbook apply() { serviceManager .serviceClient() .getMyWorkbooks() - .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), updateSourceId, Context.NONE) + .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -180,7 +155,7 @@ public MyWorkbook apply(Context context) { serviceManager .serviceClient() .getMyWorkbooks() - .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), updateSourceId, context) + .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) .getValue(); return this; } @@ -229,11 +204,6 @@ public MyWorkbookImpl withTags(Map tags) { return this; } - public MyWorkbookImpl withIdentity(ManagedIdentity identity) { - this.innerModel().withIdentity(identity); - return this; - } - public MyWorkbookImpl withName(String name) { this.innerModel().withName(name); return this; @@ -244,12 +214,7 @@ public MyWorkbookImpl withType(String type) { return this; } - public MyWorkbookImpl withEtag(Map etag) { - this.innerModel().withEtag(etag); - return this; - } - - public MyWorkbookImpl withKind(Kind kind) { + public MyWorkbookImpl withKind(SharedTypeKind kind) { this.innerModel().withKind(kind); return this; } @@ -283,19 +248,4 @@ public MyWorkbookImpl withSourceId(String sourceId) { this.innerModel().withSourceId(sourceId); return this; } - - public MyWorkbookImpl withStorageUri(String storageUri) { - this.innerModel().withStorageUri(storageUri); - return this; - } - - public MyWorkbookImpl withSourceIdParameter(String sourceId) { - this.createSourceId = sourceId; - return this; - } - - public MyWorkbookImpl sourceIdParameter(String sourceId) { - this.updateSourceId = sourceId; - return this; - } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksClientImpl.java index f17f27b69c992..4523616539b77 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksClientImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksClientImpl.java @@ -26,6 +26,7 @@ import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; @@ -34,7 +35,6 @@ import com.azure.resourcemanager.applicationinsights.fluent.MyWorkbooksClient; import com.azure.resourcemanager.applicationinsights.fluent.models.MyWorkbookInner; import com.azure.resourcemanager.applicationinsights.models.CategoryType; -import com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException; import com.azure.resourcemanager.applicationinsights.models.MyWorkbooksListResult; import java.util.List; import reactor.core.publisher.Mono; @@ -72,14 +72,13 @@ private interface MyWorkbooksService { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/myWorkbooks") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("category") CategoryType category, @QueryParam("tags") String tags, - @QueryParam("sourceId") String sourceId, @QueryParam("canFetchContent") Boolean canFetchContent, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -88,7 +87,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/myWorkbooks") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -104,7 +103,7 @@ Mono> list( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/myWorkbooks/{resourceName}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -118,8 +117,8 @@ Mono> getByResourceGroup( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/myWorkbooks/{resourceName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) + @ExpectedResponses({201, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -134,13 +133,12 @@ Mono> delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/myWorkbooks/{resourceName}") @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("sourceId") String sourceId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") MyWorkbookInner workbookProperties, @HeaderParam("Accept") String accept, @@ -150,38 +148,17 @@ Mono> createOrUpdate( @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/myWorkbooks/{resourceName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("sourceId") String sourceId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") MyWorkbookInner workbookProperties, @HeaderParam("Accept") String accept, Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ErrorDefinitionException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); } /** @@ -190,17 +167,16 @@ Mono> listBySubscriptionNext( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, CategoryType category, List tags, String sourceId, Boolean canFetchContent) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -220,7 +196,7 @@ private Mono> listByResourceGroupSinglePageAsync( if (category == null) { return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -234,7 +210,6 @@ private Mono> listByResourceGroupSinglePageAsync( resourceGroupName, category, tagsConverted, - sourceId, canFetchContent, apiVersion, accept, @@ -242,12 +217,7 @@ private Mono> listByResourceGroupSinglePageAsync( .>map( res -> new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -257,23 +227,17 @@ private Mono> listByResourceGroupSinglePageAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -293,7 +257,7 @@ private Mono> listByResourceGroupSinglePageAsync( if (category == null) { return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -305,7 +269,6 @@ private Mono> listByResourceGroupSinglePageAsync( resourceGroupName, category, tagsConverted, - sourceId, canFetchContent, apiVersion, accept, @@ -313,12 +276,7 @@ private Mono> listByResourceGroupSinglePageAsync( .map( res -> new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } /** @@ -327,20 +285,18 @@ private Mono> listByResourceGroupSinglePageAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, CategoryType category, List tags, String sourceId, Boolean canFetchContent) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, sourceId, canFetchContent), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, canFetchContent)); } /** @@ -349,18 +305,16 @@ private PagedFlux listByResourceGroupAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, CategoryType category) { final List tags = null; - final String sourceId = null; final Boolean canFetchContent = null; return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, sourceId, canFetchContent), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, canFetchContent)); } /** @@ -369,28 +323,19 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { return new PagedFlux<>( - () -> - listByResourceGroupSinglePageAsync( - resourceGroupName, category, tags, sourceId, canFetchContent, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, canFetchContent, context)); } /** @@ -399,17 +344,15 @@ private PagedFlux listByResourceGroupAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, CategoryType category) { final List tags = null; - final String sourceId = null; final Boolean canFetchContent = null; - return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, category, tags, sourceId, canFetchContent)); + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, category, tags, canFetchContent)); } /** @@ -418,25 +361,19 @@ public PagedIterable listByResourceGroup(String resourceGroupNa * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, category, tags, sourceId, canFetchContent, context)); + listByResourceGroupAsync(resourceGroupName, category, tags, canFetchContent, context)); } /** @@ -447,7 +384,7 @@ public PagedIterable listByResourceGroup( * @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 ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -469,7 +406,7 @@ private Mono> listSinglePageAsync( if (category == null) { return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -489,12 +426,7 @@ private Mono> listSinglePageAsync( .>map( res -> new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -507,7 +439,7 @@ private Mono> listSinglePageAsync( * false, only return summary content for workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -529,7 +461,7 @@ private Mono> listSinglePageAsync( if (category == null) { return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -547,12 +479,7 @@ private Mono> listSinglePageAsync( .map( res -> new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } /** @@ -563,15 +490,13 @@ private Mono> listSinglePageAsync( * @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 ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(CategoryType category, List tags, Boolean canFetchContent) { - return new PagedFlux<>( - () -> listSinglePageAsync(category, tags, canFetchContent), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(category, tags, canFetchContent)); } /** @@ -579,7 +504,7 @@ private PagedFlux listAsync(CategoryType category, List * * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -587,9 +512,7 @@ private PagedFlux listAsync(CategoryType category, List private PagedFlux listAsync(CategoryType category) { final List tags = null; final Boolean canFetchContent = null; - return new PagedFlux<>( - () -> listSinglePageAsync(category, tags, canFetchContent), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(category, tags, canFetchContent)); } /** @@ -601,16 +524,14 @@ private PagedFlux listAsync(CategoryType category) { * false, only return summary content for workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( CategoryType category, List tags, Boolean canFetchContent, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(category, tags, canFetchContent, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(category, tags, canFetchContent, context)); } /** @@ -618,7 +539,7 @@ private PagedFlux listAsync( * * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -638,7 +559,7 @@ public PagedIterable list(CategoryType category) { * false, only return summary content for workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -654,7 +575,7 @@ public PagedIterable list( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -680,7 +601,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -704,7 +625,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -730,7 +651,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -750,7 +671,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -773,7 +694,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -789,7 +710,7 @@ public MyWorkbookInner getByResourceGroup(String resourceGroupName, String resou * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -805,7 +726,7 @@ public Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @@ -830,7 +751,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -854,7 +775,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @@ -880,7 +801,7 @@ private Mono> deleteWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -900,7 +821,7 @@ private Mono> deleteWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @@ -915,7 +836,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -930,7 +851,7 @@ public void delete(String resourceGroupName, String resourceName) { * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @@ -945,15 +866,14 @@ public Response deleteWithResponse(String resourceGroupName, String resour * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, String sourceId) { + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -979,7 +899,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -990,7 +910,6 @@ private Mono> createOrUpdateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, workbookProperties, accept, @@ -1004,20 +923,15 @@ private Mono> createOrUpdateWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String resourceName, - MyWorkbookInner workbookProperties, - String sourceId, - Context context) { + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1043,7 +957,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1052,39 +966,12 @@ private Mono> createOrUpdateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, workbookProperties, accept, context); } - /** - * Create a new private workbook. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Application Insights private workbook definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, String sourceId) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Create a new private workbook. * @@ -1092,15 +979,14 @@ private Mono createOrUpdateAsync( * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties) { - final String sourceId = null; - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId) + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -1118,15 +1004,14 @@ private Mono createOrUpdateAsync( * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public MyWorkbookInner createOrUpdate( String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties) { - final String sourceId = null; - return createOrUpdateAsync(resourceGroupName, resourceName, workbookProperties, sourceId).block(); + return createOrUpdateAsync(resourceGroupName, resourceName, workbookProperties).block(); } /** @@ -1135,22 +1020,16 @@ public MyWorkbookInner createOrUpdate( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( - String resourceGroupName, - String resourceName, - MyWorkbookInner workbookProperties, - String sourceId, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId, context) - .block(); + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, context).block(); } /** @@ -1159,15 +1038,14 @@ public Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, String sourceId) { + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1193,7 +1071,7 @@ private Mono> updateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1204,7 +1082,6 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, workbookProperties, accept, @@ -1218,20 +1095,15 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, - String resourceName, - MyWorkbookInner workbookProperties, - String sourceId, - Context context) { + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1257,7 +1129,7 @@ private Mono> updateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1266,39 +1138,12 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, workbookProperties, accept, context); } - /** - * Updates a private workbook that has already been added. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the Application Insights component resource. - * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Application Insights private workbook definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, String sourceId) { - return updateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Updates a private workbook that has already been added. * @@ -1306,15 +1151,14 @@ private Mono updateAsync( * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties) { - final String sourceId = null; - return updateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId) + return updateWithResponseAsync(resourceGroupName, resourceName, workbookProperties) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -1332,14 +1176,13 @@ private Mono updateAsync( * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public MyWorkbookInner update(String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties) { - final String sourceId = null; - return updateAsync(resourceGroupName, resourceName, workbookProperties, sourceId).block(); + return updateAsync(resourceGroupName, resourceName, workbookProperties).block(); } /** @@ -1348,166 +1191,15 @@ public MyWorkbookInner update(String resourceGroupName, String resourceName, MyW * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new private workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights private workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( - String resourceGroupName, - String resourceName, - MyWorkbookInner workbookProperties, - String sourceId, - Context context) { - return updateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDefinitionException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + String resourceGroupName, String resourceName, MyWorkbookInner workbookProperties, Context context) { + return updateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, context).block(); } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksImpl.java index 3cc5c8b27f80d..1d0bc6acb2520 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksImpl.java @@ -37,16 +37,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName, C } public PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { PagedIterable inner = - this - .serviceClient() - .listByResourceGroup(resourceGroupName, category, tags, sourceId, canFetchContent, context); + this.serviceClient().listByResourceGroup(resourceGroupName, category, tags, canFetchContent, context); return Utils.mapPage(inner, inner1 -> new MyWorkbookImpl(inner1, this.manager())); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationLiveImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationLiveImpl.java new file mode 100644 index 0000000000000..c256d0b1052c8 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationLiveImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.implementation; + +import com.azure.resourcemanager.applicationinsights.fluent.models.OperationLiveInner; +import com.azure.resourcemanager.applicationinsights.models.OperationInfo; +import com.azure.resourcemanager.applicationinsights.models.OperationLive; + +public final class OperationLiveImpl implements OperationLive { + private OperationLiveInner innerObject; + + private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager; + + OperationLiveImpl( + OperationLiveInner innerObject, + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationInfo display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationLiveInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsClientImpl.java index 7bd03e87bf856..2132f7df8fa6a 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsClientImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsClientImpl.java @@ -28,7 +28,9 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.applicationinsights.fluent.OperationsClient; import com.azure.resourcemanager.applicationinsights.fluent.models.OperationInner; +import com.azure.resourcemanager.applicationinsights.fluent.models.OperationLiveInner; import com.azure.resourcemanager.applicationinsights.models.OperationListResult; +import com.azure.resourcemanager.applicationinsights.models.OperationsListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ @@ -69,6 +71,16 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get("/providers/microsoft.insights/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -85,7 +97,7 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -95,7 +107,7 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) @@ -118,7 +130,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -128,7 +140,7 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -149,7 +161,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -163,7 +175,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -176,7 +188,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -190,13 +202,130 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } + /** + * List the available operations supported by the resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-06-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the available operations supported by the resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-06-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the available operations supported by the resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the available operations supported by the resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the available operations supported by the resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the available operations supported by the resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Get the next page of items. * @@ -204,7 +333,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -240,7 +369,7 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsImpl.java index 38dc6c14deda5..81404e329c70f 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/OperationsImpl.java @@ -9,7 +9,9 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.applicationinsights.fluent.OperationsClient; import com.azure.resourcemanager.applicationinsights.fluent.models.OperationInner; +import com.azure.resourcemanager.applicationinsights.fluent.models.OperationLiveInner; import com.azure.resourcemanager.applicationinsights.models.Operation; +import com.azure.resourcemanager.applicationinsights.models.OperationLive; import com.azure.resourcemanager.applicationinsights.models.Operations; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -37,6 +39,16 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationLiveImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationLiveImpl(inner1, this.manager())); + } + private OperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookImpl.java index 4a85cd1206191..f8851ff6b5c0d 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookImpl.java @@ -7,11 +7,8 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookInner; -import com.azure.resourcemanager.applicationinsights.models.Kind; -import com.azure.resourcemanager.applicationinsights.models.ManagedIdentityAutoGenerated; import com.azure.resourcemanager.applicationinsights.models.SharedTypeKind; import com.azure.resourcemanager.applicationinsights.models.Workbook; -import com.azure.resourcemanager.applicationinsights.models.WorkbookUpdateParameters; import java.util.Collections; import java.util.List; import java.util.Map; @@ -21,6 +18,18 @@ public final class WorkbookImpl implements Workbook, Workbook.Definition, Workbo private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager; + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + public String location() { return this.innerModel().location(); } @@ -34,12 +43,12 @@ public Map tags() { } } - public Kind kind() { + public SharedTypeKind kind() { return this.innerModel().kind(); } - public String displayName() { - return this.innerModel().displayName(); + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); } public String serializedData() { @@ -50,6 +59,14 @@ public String version() { return this.innerModel().version(); } + public String workbookId() { + return this.innerModel().workbookId(); + } + + public SharedTypeKind sharedTypeKind() { + return this.innerModel().sharedTypeKind(); + } + public String timeModified() { return this.innerModel().timeModified(); } @@ -71,37 +88,8 @@ public String userId() { return this.innerModel().userId(); } - public String sourceId() { - return this.innerModel().sourceId(); - } - - public String storageUri() { - return this.innerModel().storageUri(); - } - - public ManagedIdentityAutoGenerated identity() { - return this.innerModel().identity(); - } - - public Map etag() { - Map inner = this.innerModel().etag(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); + public String sourceResourceId() { + return this.innerModel().sourceResourceId(); } public Region region() { @@ -124,12 +112,6 @@ private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager private String resourceName; - private String createSourceId; - - private String updateSourceId; - - private WorkbookUpdateParameters updateWorkbookUpdateParameters; - public WorkbookImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; @@ -140,8 +122,7 @@ public Workbook create() { serviceManager .serviceClient() .getWorkbooks() - .createOrUpdateWithResponse( - resourceGroupName, resourceName, this.innerModel(), createSourceId, Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -151,7 +132,7 @@ public Workbook create(Context context) { serviceManager .serviceClient() .getWorkbooks() - .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), createSourceId, context) + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) .getValue(); return this; } @@ -160,12 +141,9 @@ public Workbook create(Context context) { this.innerObject = new WorkbookInner(); this.serviceManager = serviceManager; this.resourceName = name; - this.createSourceId = null; } public WorkbookImpl update() { - this.updateSourceId = null; - this.updateWorkbookUpdateParameters = new WorkbookUpdateParameters(); return this; } @@ -174,8 +152,7 @@ public Workbook apply() { serviceManager .serviceClient() .getWorkbooks() - .updateWithResponse( - resourceGroupName, resourceName, updateSourceId, updateWorkbookUpdateParameters, Context.NONE) + .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -185,8 +162,7 @@ public Workbook apply(Context context) { serviceManager .serviceClient() .getWorkbooks() - .updateWithResponse( - resourceGroupName, resourceName, updateSourceId, updateWorkbookUpdateParameters, context) + .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) .getValue(); return this; } @@ -231,38 +207,23 @@ public WorkbookImpl withRegion(String location) { } public WorkbookImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateWorkbookUpdateParameters.withTags(tags); - return this; - } + this.innerModel().withTags(tags); + return this; } - public WorkbookImpl withKind(Kind kind) { + public WorkbookImpl withKind(SharedTypeKind kind) { this.innerModel().withKind(kind); return this; } - public WorkbookImpl withDisplayName(String displayName) { - if (isInCreateMode()) { - this.innerModel().withDisplayName(displayName); - return this; - } else { - this.updateWorkbookUpdateParameters.withDisplayName(displayName); - return this; - } + public WorkbookImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; } public WorkbookImpl withSerializedData(String serializedData) { - if (isInCreateMode()) { - this.innerModel().withSerializedData(serializedData); - return this; - } else { - this.updateWorkbookUpdateParameters.withSerializedData(serializedData); - return this; - } + this.innerModel().withSerializedData(serializedData); + return this; } public WorkbookImpl withVersion(String version) { @@ -270,72 +231,33 @@ public WorkbookImpl withVersion(String version) { return this; } - public WorkbookImpl withCategory(String category) { - if (isInCreateMode()) { - this.innerModel().withCategory(category); - return this; - } else { - this.updateWorkbookUpdateParameters.withCategory(category); - return this; - } - } - - public WorkbookImpl withTagsPropertiesTags(List tagsPropertiesTags) { - if (isInCreateMode()) { - this.innerModel().withTagsPropertiesTags(tagsPropertiesTags); - return this; - } else { - this.updateWorkbookUpdateParameters.withTagsPropertiesTags(tagsPropertiesTags); - return this; - } - } - - public WorkbookImpl withSourceId(String sourceId) { - this.innerModel().withSourceId(sourceId); - return this; - } - - public WorkbookImpl withStorageUri(String storageUri) { - this.innerModel().withStorageUri(storageUri); + public WorkbookImpl withWorkbookId(String workbookId) { + this.innerModel().withWorkbookId(workbookId); return this; } - public WorkbookImpl withIdentity(ManagedIdentityAutoGenerated identity) { - this.innerModel().withIdentity(identity); + public WorkbookImpl withSharedTypeKind(SharedTypeKind sharedTypeKind) { + this.innerModel().withSharedTypeKind(sharedTypeKind); return this; } - public WorkbookImpl withEtag(Map etag) { - this.innerModel().withEtag(etag); - return this; - } - - public WorkbookImpl withName(String name) { - this.innerModel().withName(name); - return this; - } - - public WorkbookImpl withType(String type) { - this.innerModel().withType(type); + public WorkbookImpl withCategory(String category) { + this.innerModel().withCategory(category); return this; } - public WorkbookImpl withSourceIdParameter(String sourceId) { - this.createSourceId = sourceId; + public WorkbookImpl withTagsPropertiesTags(List tagsPropertiesTags) { + this.innerModel().withTagsPropertiesTags(tagsPropertiesTags); return this; } - public WorkbookImpl withKind(SharedTypeKind kind) { - this.updateWorkbookUpdateParameters.withKind(kind); + public WorkbookImpl withUserId(String userId) { + this.innerModel().withUserId(userId); return this; } - public WorkbookImpl sourceId(String sourceId) { - this.updateSourceId = sourceId; + public WorkbookImpl withSourceResourceId(String sourceResourceId) { + this.innerModel().withSourceResourceId(sourceResourceId); return this; } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksClientImpl.java index b6e479c8d9f19..081fbd6ab4f01 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksClientImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksClientImpl.java @@ -26,6 +26,7 @@ import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; @@ -34,8 +35,6 @@ import com.azure.resourcemanager.applicationinsights.fluent.WorkbooksClient; import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookInner; import com.azure.resourcemanager.applicationinsights.models.CategoryType; -import com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException; -import com.azure.resourcemanager.applicationinsights.models.WorkbookUpdateParameters; import com.azure.resourcemanager.applicationinsights.models.WorkbooksListResult; import java.util.List; import reactor.core.publisher.Mono; @@ -68,32 +67,17 @@ public final class WorkbooksClientImpl implements WorkbooksClient { @Host("{$host}") @ServiceInterface(name = "ApplicationInsightsM") private interface WorkbooksService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/workbooks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("category") CategoryType category, - @QueryParam("tags") String tags, - @QueryParam("canFetchContent") Boolean canFetchContent, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("category") CategoryType category, @QueryParam("tags") String tags, - @QueryParam("sourceId") String sourceId, @QueryParam("canFetchContent") Boolean canFetchContent, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -101,10 +85,10 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks" + "/{resourceName}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -116,10 +100,10 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks" + "/{resourceName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @ExpectedResponses({201, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -131,16 +115,15 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks" + "/{resourceName}") @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("sourceId") String sourceId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") WorkbookInner workbookProperties, @HeaderParam("Accept") String accept, @@ -148,268 +131,37 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks" + "/{resourceName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("sourceId") String sourceId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkbookUpdateParameters workbookUpdateParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, + @BodyParam("application/json") WorkbookInner workbookProperties, @HeaderParam("Accept") String accept, Context context); } - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - CategoryType category, List tags, Boolean canFetchContent) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (category == null) { - return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); - } - final String apiVersion = "2020-10-20"; - final String accept = "application/json"; - String tagsConverted = - JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - category, - tagsConverted, - canFetchContent, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 context The context to associate with this operation. - * @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 all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - CategoryType category, List tags, Boolean canFetchContent, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (category == null) { - return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); - } - final String apiVersion = "2020-10-20"; - final String accept = "application/json"; - String tagsConverted = - JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - category, - tagsConverted, - canFetchContent, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(CategoryType category, List tags, Boolean canFetchContent) { - return new PagedFlux<>( - () -> listSinglePageAsync(category, tags, canFetchContent), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(CategoryType category) { - final List tags = null; - final Boolean canFetchContent = null; - return new PagedFlux<>( - () -> listSinglePageAsync(category, tags, canFetchContent), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 context The context to associate with this operation. - * @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 all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - CategoryType category, List tags, Boolean canFetchContent, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(category, tags, canFetchContent, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(CategoryType category) { - final List tags = null; - final Boolean canFetchContent = null; - return new PagedIterable<>(listAsync(category, tags, canFetchContent)); - } - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 context The context to associate with this operation. - * @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 all private workbooks defined within a specified subscription and category. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - CategoryType category, List tags, Boolean canFetchContent, Context context) { - return new PagedIterable<>(listAsync(category, tags, canFetchContent, context)); - } - /** * Get all Workbooks defined within a specified resource group and category. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, CategoryType category, List tags, String sourceId, Boolean canFetchContent) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -429,7 +181,7 @@ private Mono> listByResourceGroupSinglePageAsync( if (category == null) { return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -443,7 +195,6 @@ private Mono> listByResourceGroupSinglePageAsync( resourceGroupName, category, tagsConverted, - sourceId, canFetchContent, apiVersion, accept, @@ -451,12 +202,7 @@ private Mono> listByResourceGroupSinglePageAsync( .>map( res -> new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -466,23 +212,17 @@ private Mono> listByResourceGroupSinglePageAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -502,7 +242,7 @@ private Mono> listByResourceGroupSinglePageAsync( if (category == null) { return Mono.error(new IllegalArgumentException("Parameter category is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -514,7 +254,6 @@ private Mono> listByResourceGroupSinglePageAsync( resourceGroupName, category, tagsConverted, - sourceId, canFetchContent, apiVersion, accept, @@ -522,12 +261,7 @@ private Mono> listByResourceGroupSinglePageAsync( .map( res -> new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } /** @@ -536,20 +270,18 @@ private Mono> listByResourceGroupSinglePageAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, CategoryType category, List tags, String sourceId, Boolean canFetchContent) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, sourceId, canFetchContent), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, canFetchContent)); } /** @@ -558,18 +290,16 @@ private PagedFlux listByResourceGroupAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, CategoryType category) { final List tags = null; - final String sourceId = null; final Boolean canFetchContent = null; return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, sourceId, canFetchContent), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, canFetchContent)); } /** @@ -578,28 +308,19 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNa * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { return new PagedFlux<>( - () -> - listByResourceGroupSinglePageAsync( - resourceGroupName, category, tags, sourceId, canFetchContent, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + () -> listByResourceGroupSinglePageAsync(resourceGroupName, category, tags, canFetchContent, context)); } /** @@ -608,17 +329,15 @@ private PagedFlux listByResourceGroupAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, CategoryType category) { final List tags = null; - final String sourceId = null; final Boolean canFetchContent = null; - return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, category, tags, sourceId, canFetchContent)); + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, category, tags, canFetchContent)); } /** @@ -627,25 +346,19 @@ public PagedIterable listByResourceGroup(String resourceGroupName * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, category, tags, sourceId, canFetchContent, context)); + listByResourceGroupAsync(resourceGroupName, category, tags, canFetchContent, context)); } /** @@ -654,7 +367,7 @@ public PagedIterable listByResourceGroup( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -680,7 +393,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -704,7 +417,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -730,7 +443,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -750,7 +463,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -773,7 +486,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -789,7 +502,7 @@ public WorkbookInner getByResourceGroup(String resourceGroupName, String resourc * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -805,7 +518,7 @@ public Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @@ -830,7 +543,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -854,7 +567,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @@ -880,7 +593,7 @@ private Mono> deleteWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -900,7 +613,7 @@ private Mono> deleteWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @@ -915,7 +628,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -930,7 +643,7 @@ public void delete(String resourceGroupName, String resourceName) { * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @@ -945,15 +658,14 @@ public Response deleteWithResponse(String resourceGroupName, String resour * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceName, WorkbookInner workbookProperties, String sourceId) { + String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -979,7 +691,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -990,7 +702,6 @@ private Mono> createOrUpdateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, workbookProperties, accept, @@ -1004,20 +715,15 @@ private Mono> createOrUpdateWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String resourceName, - WorkbookInner workbookProperties, - String sourceId, - Context context) { + String resourceGroupName, String resourceName, WorkbookInner workbookProperties, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1043,7 +749,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1052,7 +758,6 @@ private Mono> createOrUpdateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, workbookProperties, accept, @@ -1065,42 +770,15 @@ private Mono> createOrUpdateWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param sourceId Azure Resource Id that will fetch all linked 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 an Application Insights workbook definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String resourceName, WorkbookInner workbookProperties, String sourceId) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a new workbook. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { - final String sourceId = null; - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId) + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -1118,15 +796,14 @@ private Mono createOrUpdateAsync( * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkbookInner createOrUpdate( String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { - final String sourceId = null; - return createOrUpdateAsync(resourceGroupName, resourceName, workbookProperties, sourceId).block(); + return createOrUpdateAsync(resourceGroupName, resourceName, workbookProperties).block(); } /** @@ -1135,22 +812,16 @@ public WorkbookInner createOrUpdate( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @param workbookProperties Properties that need to be specified to create a new workbook. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( - String resourceGroupName, - String resourceName, - WorkbookInner workbookProperties, - String sourceId, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, sourceId, context) - .block(); + String resourceGroupName, String resourceName, WorkbookInner workbookProperties, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, context).block(); } /** @@ -1158,19 +829,15 @@ public Response createOrUpdateWithResponse( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @param workbookUpdateParameters Properties that need to be specified to create a new workbook. + * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, - String resourceName, - String sourceId, - WorkbookUpdateParameters workbookUpdateParameters) { + String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1190,10 +857,13 @@ private Mono> updateWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - if (workbookUpdateParameters != null) { - workbookUpdateParameters.validate(); + if (workbookProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter workbookProperties is required and cannot be null.")); + } else { + workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1204,9 +874,8 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, - workbookUpdateParameters, + workbookProperties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1217,21 +886,16 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @param workbookUpdateParameters Properties that need to be specified to create a new workbook. + * @param workbookProperties Properties that need to be specified to create a new workbook. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, - String resourceName, - String sourceId, - WorkbookUpdateParameters workbookUpdateParameters, - Context context) { + String resourceGroupName, String resourceName, WorkbookInner workbookProperties, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1251,10 +915,13 @@ private Mono> updateWithResponseAsync( if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - if (workbookUpdateParameters != null) { - workbookUpdateParameters.validate(); + if (workbookProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter workbookProperties is required and cannot be null.")); + } else { + workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2015-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1263,9 +930,8 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, resourceName, - sourceId, apiVersion, - workbookUpdateParameters, + workbookProperties, accept, context); } @@ -1275,45 +941,16 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @param workbookUpdateParameters Properties that need to be specified to create a new workbook. + * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String resourceGroupName, - String resourceName, - String sourceId, - WorkbookUpdateParameters workbookUpdateParameters) { - return updateWithResponseAsync(resourceGroupName, resourceName, sourceId, workbookUpdateParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a workbook that has already been added. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 an Application Insights workbook definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName) { - final String sourceId = null; - final WorkbookUpdateParameters workbookUpdateParameters = null; - return updateWithResponseAsync(resourceGroupName, resourceName, sourceId, workbookUpdateParameters) + String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + return updateWithResponseAsync(resourceGroupName, resourceName, workbookProperties) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -1329,16 +966,15 @@ private Mono updateAsync(String resourceGroupName, String resourc * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkbookInner update(String resourceGroupName, String resourceName) { - final String sourceId = null; - final WorkbookUpdateParameters workbookUpdateParameters = null; - return updateAsync(resourceGroupName, resourceName, sourceId, workbookUpdateParameters).block(); + public WorkbookInner update(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) { + return updateAsync(resourceGroupName, resourceName, workbookProperties).block(); } /** @@ -1346,167 +982,16 @@ public WorkbookInner update(String resourceGroupName, String resourceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @param workbookUpdateParameters Properties that need to be specified to create a new workbook. + * @param workbookProperties Properties that need to be specified to create a new workbook. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Application Insights workbook definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( - String resourceGroupName, - String resourceName, - String sourceId, - WorkbookUpdateParameters workbookUpdateParameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, resourceName, sourceId, workbookUpdateParameters, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @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 workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @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 workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @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 workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @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 workbook list result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + String resourceGroupName, String resourceName, WorkbookInner workbookProperties, Context context) { + return updateWithResponseAsync(resourceGroupName, resourceName, workbookProperties, context).block(); } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksImpl.java index 70fcf57d4d890..f6e390695bb3e 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbooksImpl.java @@ -31,33 +31,15 @@ public WorkbooksImpl( this.serviceManager = serviceManager; } - public PagedIterable list(CategoryType category) { - PagedIterable inner = this.serviceClient().list(category); - return Utils.mapPage(inner, inner1 -> new WorkbookImpl(inner1, this.manager())); - } - - public PagedIterable list( - CategoryType category, List tags, Boolean canFetchContent, Context context) { - PagedIterable inner = this.serviceClient().list(category, tags, canFetchContent, context); - return Utils.mapPage(inner, inner1 -> new WorkbookImpl(inner1, this.manager())); - } - public PagedIterable listByResourceGroup(String resourceGroupName, CategoryType category) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, category); return Utils.mapPage(inner, inner1 -> new WorkbookImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context) { + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context) { PagedIterable inner = - this - .serviceClient() - .listByResourceGroup(resourceGroupName, category, tags, sourceId, canFetchContent, context); + this.serviceClient().listByResourceGroup(resourceGroupName, category, tags, canFetchContent, context); return Utils.mapPage(inner, inner1 -> new WorkbookImpl(inner1, this.manager())); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ApplicationInsightsComponent.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ApplicationInsightsComponent.java index c61f6317c9607..b9bd70f90baaf 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ApplicationInsightsComponent.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ApplicationInsightsComponent.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.applicationinsights.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentInner; @@ -185,6 +186,21 @@ public interface ApplicationInsightsComponent { */ List privateLinkScopedResources(); + /** + * Gets the publicNetworkAccessForIngestion property: The network access type for accessing Application Insights + * ingestion. + * + * @return the publicNetworkAccessForIngestion value. + */ + PublicNetworkAccessType publicNetworkAccessForIngestion(); + + /** + * Gets the publicNetworkAccessForQuery property: The network access type for accessing Application Insights query. + * + * @return the publicNetworkAccessForQuery value. + */ + PublicNetworkAccessType publicNetworkAccessForQuery(); + /** * Gets the ingestionMode property: Indicates the flow of the ingestion. * @@ -283,6 +299,8 @@ interface WithCreate DefinitionStages.WithRetentionInDays, DefinitionStages.WithDisableIpMasking, DefinitionStages.WithImmediatePurgeDataOn30Days, + DefinitionStages.WithPublicNetworkAccessForIngestion, + DefinitionStages.WithPublicNetworkAccessForQuery, DefinitionStages.WithIngestionMode { /** * Executes the create request. @@ -398,6 +416,31 @@ interface WithImmediatePurgeDataOn30Days { */ WithCreate withImmediatePurgeDataOn30Days(Boolean immediatePurgeDataOn30Days); } + /** + * The stage of the ApplicationInsightsComponent definition allowing to specify publicNetworkAccessForIngestion. + */ + interface WithPublicNetworkAccessForIngestion { + /** + * Specifies the publicNetworkAccessForIngestion property: The network access type for accessing Application + * Insights ingestion.. + * + * @param publicNetworkAccessForIngestion The network access type for accessing Application Insights + * ingestion. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion); + } + /** The stage of the ApplicationInsightsComponent definition allowing to specify publicNetworkAccessForQuery. */ + interface WithPublicNetworkAccessForQuery { + /** + * Specifies the publicNetworkAccessForQuery property: The network access type for accessing Application + * Insights query.. + * + * @param publicNetworkAccessForQuery The network access type for accessing Application Insights query. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery); + } /** The stage of the ApplicationInsightsComponent definition allowing to specify ingestionMode. */ interface WithIngestionMode { /** @@ -460,4 +503,37 @@ interface WithTags { * @return the refreshed resource. */ ApplicationInsightsComponent refresh(Context context); + + /** + * Purges data in an Application Insights component by a set of user-defined filters. + * + *

In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch + * the execution of purge requests by sending a single command whose predicate includes all user identities that + * require purging. Use the in operator to specify multiple identities. You should run the query prior to using for + * a purge request to verify that the results are expected. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing operationId for a specific purge action. + */ + ComponentPurgeResponse purge(ComponentPurgeBody body); + + /** + * Purges data in an Application Insights component by a set of user-defined filters. + * + *

In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch + * the execution of purge requests by sending a single command whose predicate includes all user identities that + * require purging. Use the in operator to specify multiple identities. You should run the query prior to using for + * a purge request to verify that the results are expected. + * + * @param body Describes the body of a request to purge data in a single table of an Application Insights component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing operationId for a specific purge action. + */ + Response purgeWithResponse(ComponentPurgeBody body, Context context); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccounts.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccounts.java new file mode 100644 index 0000000000000..c4c2ff84a73cb --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccounts.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner; + +/** An immutable client-side representation of ComponentLinkedStorageAccounts. */ +public interface ComponentLinkedStorageAccounts { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the linkedStorageAccount property: Linked storage account resource ID. + * + * @return the linkedStorageAccount value. + */ + String linkedStorageAccount(); + + /** + * Gets the inner com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner + * object. + * + * @return the inner object. + */ + ComponentLinkedStorageAccountsInner innerModel(); + + /** The entirety of the ComponentLinkedStorageAccounts definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ComponentLinkedStorageAccounts definition stages. */ + interface DefinitionStages { + /** The first stage of the ComponentLinkedStorageAccounts definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ComponentLinkedStorageAccounts definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @return the next definition stage. + */ + WithCreate withExistingComponent(String resourceGroupName, String resourceName); + } + /** + * The stage of the ComponentLinkedStorageAccounts definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithLinkedStorageAccount { + /** + * Executes the create request. + * + * @return the created resource. + */ + ComponentLinkedStorageAccounts create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ComponentLinkedStorageAccounts create(Context context); + } + /** The stage of the ComponentLinkedStorageAccounts definition allowing to specify linkedStorageAccount. */ + interface WithLinkedStorageAccount { + /** + * Specifies the linkedStorageAccount property: Linked storage account resource ID. + * + * @param linkedStorageAccount Linked storage account resource ID. + * @return the next definition stage. + */ + WithCreate withLinkedStorageAccount(String linkedStorageAccount); + } + } + /** + * Begins update for the ComponentLinkedStorageAccounts resource. + * + * @return the stage of resource update. + */ + ComponentLinkedStorageAccounts.Update update(); + + /** The template for ComponentLinkedStorageAccounts update. */ + interface Update extends UpdateStages.WithLinkedStorageAccount { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ComponentLinkedStorageAccounts apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ComponentLinkedStorageAccounts apply(Context context); + } + /** The ComponentLinkedStorageAccounts update stages. */ + interface UpdateStages { + /** The stage of the ComponentLinkedStorageAccounts update allowing to specify linkedStorageAccount. */ + interface WithLinkedStorageAccount { + /** + * Specifies the linkedStorageAccount property: Linked storage account resource ID. + * + * @param linkedStorageAccount Linked storage account resource ID. + * @return the next definition stage. + */ + Update withLinkedStorageAccount(String linkedStorageAccount); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ComponentLinkedStorageAccounts refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ComponentLinkedStorageAccounts refresh(Context context); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccountsOperations.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccountsOperations.java new file mode 100644 index 0000000000000..3be3c995d8f0c --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccountsOperations.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ComponentLinkedStorageAccountsOperations. */ +public interface ComponentLinkedStorageAccountsOperations { + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + ComponentLinkedStorageAccounts get(String resourceGroupName, String resourceName, StorageType storageType); + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context); + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, StorageType storageType); + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param storageType The type of the Application Insights component data source for the linked storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String resourceName, StorageType storageType, Context context); + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + ComponentLinkedStorageAccounts getById(String id); + + /** + * Returns the current linked storage settings for an Application Insights component. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Application Insights component linked storage accounts. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete linked storage accounts for an Application Insights component. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ComponentLinkedStorageAccounts resource. + * + * @param name resource name. + * @return the first stage of the new ComponentLinkedStorageAccounts definition. + */ + ComponentLinkedStorageAccounts.DefinitionStages.Blank define(StorageType name); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccountsPatch.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccountsPatch.java new file mode 100644 index 0000000000000..e56637989d25d --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccountsPatch.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Application Insights component linked storage accounts patch. */ +@JsonFlatten +@Fluent +public class ComponentLinkedStorageAccountsPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentLinkedStorageAccountsPatch.class); + + /* + * Linked storage account resource ID + */ + @JsonProperty(value = "properties.linkedStorageAccount") + private String linkedStorageAccount; + + /** + * Get the linkedStorageAccount property: Linked storage account resource ID. + * + * @return the linkedStorageAccount value. + */ + public String linkedStorageAccount() { + return this.linkedStorageAccount; + } + + /** + * Set the linkedStorageAccount property: Linked storage account resource ID. + * + * @param linkedStorageAccount the linkedStorageAccount value to set. + * @return the ComponentLinkedStorageAccountsPatch object itself. + */ + public ComponentLinkedStorageAccountsPatch withLinkedStorageAccount(String linkedStorageAccount) { + this.linkedStorageAccount = linkedStorageAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ErrorDefinitionException.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ErrorDefinitionException.java deleted file mode 100644 index c60c13cb3f702..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ErrorDefinitionException.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.http.HttpResponse; -import com.azure.core.management.exception.ManagementException; - -/** Exception thrown for an invalid response with ErrorDefinition information. */ -public final class ErrorDefinitionException extends ManagementException { - /** - * Initializes a new instance of the ErrorDefinitionException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public ErrorDefinitionException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the ErrorDefinitionException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public ErrorDefinitionException(String message, HttpResponse response, ErrorDefinition value) { - super(message, response, value); - } - - @Override - public ErrorDefinition getValue() { - return (ErrorDefinition) super.getValue(); - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Kind.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Kind.java deleted file mode 100644 index b8c3649809be8..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Kind.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Kind. */ -public final class Kind extends ExpandableStringEnum { - /** Static value user for Kind. */ - public static final Kind USER = fromString("user"); - - /** Static value shared for Kind. */ - public static final Kind SHARED = fromString("shared"); - - /** - * Creates or finds a Kind from its string representation. - * - * @param name a name to look for. - * @return the corresponding Kind. - */ - @JsonCreator - public static Kind fromString(String name) { - return fromString(name, Kind.class); - } - - /** @return known Kind values. */ - public static Collection values() { - return values(Kind.class); - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/LiveTokenResponse.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/LiveTokenResponse.java new file mode 100644 index 0000000000000..bf1d295c9a418 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/LiveTokenResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.resourcemanager.applicationinsights.fluent.models.LiveTokenResponseInner; + +/** An immutable client-side representation of LiveTokenResponse. */ +public interface LiveTokenResponse { + /** + * Gets the liveToken property: JWT token for accessing live metrics stream data. + * + * @return the liveToken value. + */ + String liveToken(); + + /** + * Gets the inner com.azure.resourcemanager.applicationinsights.fluent.models.LiveTokenResponseInner object. + * + * @return the inner object. + */ + LiveTokenResponseInner innerModel(); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/LiveTokens.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/LiveTokens.java new file mode 100644 index 0000000000000..0cc3bfb472bf2 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/LiveTokens.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LiveTokens. */ +public interface LiveTokens { + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + LiveTokenResponse get(String resourceUri); + + /** + * **Gets an access token for live metrics stream data.**. + * + * @param resourceUri The identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a live token query. + */ + Response getWithResponse(String resourceUri, Context context); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentity.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentity.java deleted file mode 100644 index b403e8b0ac1b3..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentity.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Customer Managed Identity. */ -@Fluent -public class ManagedIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentity.class); - - /* - * Customer Managed Identity - */ - @JsonProperty(value = "userAssignedIdentities") - private UserAssignedIdentities userAssignedIdentities; - - /* - * The identity type. - */ - @JsonProperty(value = "type") - private ManagedIdentityType type; - - /** - * Get the userAssignedIdentities property: Customer Managed Identity. - * - * @return the userAssignedIdentities value. - */ - public UserAssignedIdentities userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: Customer Managed Identity. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedIdentity object itself. - */ - public ManagedIdentity withUserAssignedIdentities(UserAssignedIdentities userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ManagedIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the ManagedIdentity object itself. - */ - public ManagedIdentity withType(ManagedIdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities().validate(); - } - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentityAutoGenerated.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentityAutoGenerated.java deleted file mode 100644 index 203b06401a9f1..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentityAutoGenerated.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Customer Managed Identity. */ -@Fluent -public final class ManagedIdentityAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentityAutoGenerated.class); - - /* - * Customer Managed Identity - */ - @JsonProperty(value = "userAssignedIdentities") - private UserAssignedIdentitiesAutoGenerated userAssignedIdentities; - - /* - * The identity type. - */ - @JsonProperty(value = "type") - private ManagedIdentityType type; - - /** - * Get the userAssignedIdentities property: Customer Managed Identity. - * - * @return the userAssignedIdentities value. - */ - public UserAssignedIdentitiesAutoGenerated userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: Customer Managed Identity. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedIdentityAutoGenerated object itself. - */ - public ManagedIdentityAutoGenerated withUserAssignedIdentities( - UserAssignedIdentitiesAutoGenerated userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ManagedIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the ManagedIdentityAutoGenerated object itself. - */ - public ManagedIdentityAutoGenerated withType(ManagedIdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities().validate(); - } - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentityType.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentityType.java deleted file mode 100644 index f1bb018b7566a..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentityType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagedIdentityType. */ -public final class ManagedIdentityType extends ExpandableStringEnum { - /** Static value UserAssigned for ManagedIdentityType. */ - public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); - - /** Static value None for ManagedIdentityType. */ - public static final ManagedIdentityType NONE = fromString("None"); - - /** - * Creates or finds a ManagedIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedIdentityType. - */ - @JsonCreator - public static ManagedIdentityType fromString(String name) { - return fromString(name, ManagedIdentityType.class); - } - - /** @return known ManagedIdentityType values. */ - public static Collection values() { - return values(ManagedIdentityType.class); - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbook.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbook.java index 467ae1a30d363..10b285d2f7a83 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbook.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbook.java @@ -26,13 +26,6 @@ public interface MyWorkbook { */ Map tags(); - /** - * Gets the identity property: Identity used for BYOS. - * - * @return the identity value. - */ - ManagedIdentity identity(); - /** * Gets the id property: Azure resource Id. * @@ -54,19 +47,12 @@ public interface MyWorkbook { */ String type(); - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - Map etag(); - /** * Gets the kind property: The kind of workbook. Choices are user and shared. * * @return the kind value. */ - Kind kind(); + SharedTypeKind kind(); /** * Gets the displayName property: The user-defined name of the private workbook. @@ -128,13 +114,6 @@ public interface MyWorkbook { */ String sourceId(); - /** - * Gets the storageUri property: BYOS Storage Account URI. - * - * @return the storageUri value. - */ - String storageUri(); - /** * Gets the region of the resource. * @@ -202,19 +181,15 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, DefinitionStages.WithName, DefinitionStages.WithType, - DefinitionStages.WithEtag, DefinitionStages.WithKind, DefinitionStages.WithDisplayName, DefinitionStages.WithSerializedData, DefinitionStages.WithVersion, DefinitionStages.WithCategory, DefinitionStages.WithTagsPropertiesTags, - DefinitionStages.WithSourceId, - DefinitionStages.WithStorageUri, - DefinitionStages.WithSourceIdParameter { + DefinitionStages.WithSourceId { /** * Executes the create request. * @@ -240,16 +215,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the MyWorkbook definition allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: Identity used for BYOS. - * - * @param identity Identity used for BYOS. - * @return the next definition stage. - */ - WithCreate withIdentity(ManagedIdentity identity); - } /** The stage of the MyWorkbook definition allowing to specify name. */ interface WithName { /** @@ -270,16 +235,6 @@ interface WithType { */ WithCreate withType(String type); } - /** The stage of the MyWorkbook definition allowing to specify etag. */ - interface WithEtag { - /** - * Specifies the etag property: Resource etag. - * - * @param etag Resource etag. - * @return the next definition stage. - */ - WithCreate withEtag(Map etag); - } /** The stage of the MyWorkbook definition allowing to specify kind. */ interface WithKind { /** @@ -288,7 +243,7 @@ interface WithKind { * @param kind The kind of workbook. Choices are user and shared. * @return the next definition stage. */ - WithCreate withKind(Kind kind); + WithCreate withKind(SharedTypeKind kind); } /** The stage of the MyWorkbook definition allowing to specify displayName. */ interface WithDisplayName { @@ -356,26 +311,6 @@ interface WithSourceId { */ WithCreate withSourceId(String sourceId); } - /** The stage of the MyWorkbook definition allowing to specify storageUri. */ - interface WithStorageUri { - /** - * Specifies the storageUri property: BYOS Storage Account URI. - * - * @param storageUri BYOS Storage Account URI. - * @return the next definition stage. - */ - WithCreate withStorageUri(String storageUri); - } - /** The stage of the MyWorkbook definition allowing to specify sourceId. */ - interface WithSourceIdParameter { - /** - * Specifies the sourceId property: Azure Resource Id that will fetch all linked workbooks.. - * - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @return the next definition stage. - */ - WithCreate withSourceIdParameter(String sourceId); - } } /** * Begins update for the MyWorkbook resource. @@ -387,19 +322,15 @@ interface WithSourceIdParameter { /** The template for MyWorkbook update. */ interface Update extends UpdateStages.WithTags, - UpdateStages.WithIdentity, UpdateStages.WithName, UpdateStages.WithType, - UpdateStages.WithEtag, UpdateStages.WithKind, UpdateStages.WithDisplayName, UpdateStages.WithSerializedData, UpdateStages.WithVersion, UpdateStages.WithCategory, UpdateStages.WithTagsPropertiesTags, - UpdateStages.WithSourceId, - UpdateStages.WithStorageUri, - UpdateStages.WithsourceIdParameter { + UpdateStages.WithSourceId { /** * Executes the update request. * @@ -427,16 +358,6 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the MyWorkbook update allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: Identity used for BYOS. - * - * @param identity Identity used for BYOS. - * @return the next definition stage. - */ - Update withIdentity(ManagedIdentity identity); - } /** The stage of the MyWorkbook update allowing to specify name. */ interface WithName { /** @@ -457,16 +378,6 @@ interface WithType { */ Update withType(String type); } - /** The stage of the MyWorkbook update allowing to specify etag. */ - interface WithEtag { - /** - * Specifies the etag property: Resource etag. - * - * @param etag Resource etag. - * @return the next definition stage. - */ - Update withEtag(Map etag); - } /** The stage of the MyWorkbook update allowing to specify kind. */ interface WithKind { /** @@ -475,7 +386,7 @@ interface WithKind { * @param kind The kind of workbook. Choices are user and shared. * @return the next definition stage. */ - Update withKind(Kind kind); + Update withKind(SharedTypeKind kind); } /** The stage of the MyWorkbook update allowing to specify displayName. */ interface WithDisplayName { @@ -543,26 +454,6 @@ interface WithSourceId { */ Update withSourceId(String sourceId); } - /** The stage of the MyWorkbook update allowing to specify storageUri. */ - interface WithStorageUri { - /** - * Specifies the storageUri property: BYOS Storage Account URI. - * - * @param storageUri BYOS Storage Account URI. - * @return the next definition stage. - */ - Update withStorageUri(String storageUri); - } - /** The stage of the MyWorkbook update allowing to specify sourceId. */ - interface WithsourceIdParameter { - /** - * Specifies the sourceId property: Azure Resource Id that will fetch all linked workbooks.. - * - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @return the next definition stage. - */ - Update sourceIdParameter(String sourceId); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookResource.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookResource.java index 02d62b224afd0..92c419abaaaf4 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookResource.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookResource.java @@ -16,12 +16,6 @@ public class MyWorkbookResource extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(MyWorkbookResource.class); - /* - * Identity used for BYOS - */ - @JsonProperty(value = "identity") - private ManagedIdentity identity; - /* * Azure resource Id */ @@ -40,32 +34,6 @@ public class MyWorkbookResource extends Resource { @JsonProperty(value = "type") private String type; - /* - * Resource etag - */ - @JsonProperty(value = "etag") - private Map etag; - - /** - * Get the identity property: Identity used for BYOS. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Identity used for BYOS. - * - * @param identity the identity value to set. - * @return the MyWorkbookResource object itself. - */ - public MyWorkbookResource withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - /** * Get the id property: Azure resource Id. * @@ -126,26 +94,6 @@ public MyWorkbookResource withType(String type) { return this; } - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public Map etag() { - return this.etag; - } - - /** - * Set the etag property: Resource etag. - * - * @param etag the etag value to set. - * @return the MyWorkbookResource object itself. - */ - public MyWorkbookResource withEtag(Map etag) { - this.etag = etag; - return this; - } - /** {@inheritDoc} */ @Override public MyWorkbookResource withLocation(String location) { @@ -166,8 +114,5 @@ public MyWorkbookResource withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { - identity().validate(); - } } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooks.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooks.java index 1443a1487423e..fc49792d99977 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooks.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooks.java @@ -17,8 +17,7 @@ public interface MyWorkbooks { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ @@ -30,31 +29,23 @@ public interface MyWorkbooks { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified resource group and category. */ PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context); + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context); /** * Get all private workbooks defined within a specified subscription and category. * * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -69,8 +60,7 @@ PagedIterable listByResourceGroup( * false, only return summary content for workbooks. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all private workbooks defined within a specified subscription and category. */ @@ -82,8 +72,7 @@ PagedIterable listByResourceGroup( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -96,8 +85,7 @@ PagedIterable listByResourceGroup( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -109,8 +97,7 @@ PagedIterable listByResourceGroup( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void deleteByResourceGroup(String resourceGroupName, String resourceName); @@ -122,8 +109,7 @@ PagedIterable listByResourceGroup( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @@ -134,8 +120,7 @@ PagedIterable listByResourceGroup( * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -147,8 +132,7 @@ PagedIterable listByResourceGroup( * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single private workbook by its resourceName. */ @@ -159,8 +143,7 @@ PagedIterable listByResourceGroup( * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void deleteById(String id); @@ -171,8 +154,7 @@ PagedIterable listByResourceGroup( * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.ErrorDefinitionException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooksListResult.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooksListResult.java index 0f3efffaa11c9..31c72da4a1cd0 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooksListResult.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbooksListResult.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.applicationinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.applicationinsights.fluent.models.MyWorkbookInner; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -12,7 +12,7 @@ import java.util.List; /** Workbook list result. */ -@Fluent +@Immutable public final class MyWorkbooksListResult { @JsonIgnore private final ClientLogger logger = new ClientLogger(MyWorkbooksListResult.class); @@ -22,12 +22,6 @@ public final class MyWorkbooksListResult { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; - /* - * The nextLink property. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - /** * Get the value property: An array of private workbooks. * @@ -37,26 +31,6 @@ public List value() { return this.value; } - /** - * Get the nextLink property: The nextLink property. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The nextLink property. - * - * @param nextLink the nextLink value to set. - * @return the MyWorkbooksListResult object itself. - */ - public MyWorkbooksListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationDisplay.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationDisplay.java index eda089677310a..0cc18ba08e1c5 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationDisplay.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationDisplay.java @@ -15,7 +15,7 @@ public final class OperationDisplay { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); /* - * Service provider: Microsoft.Insights + * Service provider: Microsoft.Cdn */ @JsonProperty(value = "provider") private String provider; @@ -33,7 +33,7 @@ public final class OperationDisplay { private String operation; /** - * Get the provider property: Service provider: Microsoft.Insights. + * Get the provider property: Service provider: Microsoft.Cdn. * * @return the provider value. */ @@ -42,7 +42,7 @@ public String provider() { } /** - * Set the provider property: Service provider: Microsoft.Insights. + * Set the provider property: Service provider: Microsoft.Cdn. * * @param provider the provider value to set. * @return the OperationDisplay object itself. diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationInfo.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationInfo.java new file mode 100644 index 0000000000000..56f66943c92fc --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationInfo.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information about an operation. */ +@Fluent +public final class OperationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInfo.class); + + /* + * Name of the provider + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Name of the resource type + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Name of the operation + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Name of the provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Name of the provider. + * + * @param provider the provider value to set. + * @return the OperationInfo object itself. + */ + public OperationInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Name of the resource type. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Name of the resource type. + * + * @param resource the resource value to set. + * @return the OperationInfo object itself. + */ + public OperationInfo withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Name of the operation. + * + * @param operation the operation value to set. + * @return the OperationInfo object itself. + */ + public OperationInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationInfo object itself. + */ + public OperationInfo withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationListResult.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationListResult.java index 5476588c1d5aa..51d74223ac2cb 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationListResult.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationListResult.java @@ -12,16 +12,15 @@ import java.util.List; /** - * Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the - * next set of results. + * Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of + * results. */ @Fluent public final class OperationListResult { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); /* - * List of Workbook operations supported by the Microsoft.Insights resource - * provider. + * List of CDN operations supported by the CDN resource provider. */ @JsonProperty(value = "value") private List value; @@ -33,7 +32,7 @@ public final class OperationListResult { private String nextLink; /** - * Get the value property: List of Workbook operations supported by the Microsoft.Insights resource provider. + * Get the value property: List of CDN operations supported by the CDN resource provider. * * @return the value value. */ @@ -42,7 +41,7 @@ public List value() { } /** - * Set the value property: List of Workbook operations supported by the Microsoft.Insights resource provider. + * Set the value property: List of CDN operations supported by the CDN resource provider. * * @param value the value value to set. * @return the OperationListResult object itself. diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationLive.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationLive.java new file mode 100644 index 0000000000000..5d2dc8443702c --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationLive.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.resourcemanager.applicationinsights.fluent.models.OperationLiveInner; + +/** An immutable client-side representation of OperationLive. */ +public interface OperationLive { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display name of the operation. + * + * @return the display value. + */ + OperationInfo display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.applicationinsights.fluent.models.OperationLiveInner object. + * + * @return the inner object. + */ + OperationLiveInner innerModel(); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Operations.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Operations.java index a439727d633cc..ebf826b064f46 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Operations.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ PagedIterable list(); @@ -25,7 +25,27 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Azure Workbooks operations. + * @return result of the request to list CDN operations. */ PagedIterable list(Context context); + + /** + * List the available operations supported by the resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + PagedIterable list(); + + /** + * List the available operations supported by the resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation. + */ + PagedIterable list(Context context); } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationsListResult.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationsListResult.java new file mode 100644 index 0000000000000..102764e116c81 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/OperationsListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.applicationinsights.fluent.models.OperationLiveInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List Operations operation. */ +@Fluent +public final class OperationsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsListResult.class); + + /* + * A collection of operations + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of operations. + * + * @param value the value value to set. + * @return the OperationsListResult object itself. + */ + public OperationsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationsListResult object itself. + */ + public OperationsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/PublicNetworkAccessType.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/PublicNetworkAccessType.java new file mode 100644 index 0000000000000..7fc35561feaeb --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/PublicNetworkAccessType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccessType. */ +public final class PublicNetworkAccessType extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccessType. */ + public static final PublicNetworkAccessType ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccessType. */ + public static final PublicNetworkAccessType DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccessType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccessType. + */ + @JsonCreator + public static PublicNetworkAccessType fromString(String name) { + return fromString(name, PublicNetworkAccessType.class); + } + + /** @return known PublicNetworkAccessType values. */ + public static Collection values() { + return values(PublicNetworkAccessType.class); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/StorageType.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/StorageType.java new file mode 100644 index 0000000000000..6818dc2d3a1f5 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/StorageType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageType. */ +public final class StorageType extends ExpandableStringEnum { + /** Static value ServiceProfiler for StorageType. */ + public static final StorageType SERVICE_PROFILER = fromString("ServiceProfiler"); + + /** + * Creates or finds a StorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageType. + */ + @JsonCreator + public static StorageType fromString(String name) { + return fromString(name, StorageType.class); + } + + /** @return known StorageType values. */ + public static Collection values() { + return values(StorageType.class); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentities.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentities.java deleted file mode 100644 index 82e27e7779c6e..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentities.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Customer Managed Identity. */ -@Immutable -public final class UserAssignedIdentities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentities.class); - - /* - * The principal ID of resource identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant ID of resource. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentitiesAutoGenerated.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentitiesAutoGenerated.java deleted file mode 100644 index 9ef3948e54cd2..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentitiesAutoGenerated.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Customer Managed Identity. */ -@Immutable -public final class UserAssignedIdentitiesAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentitiesAutoGenerated.class); - - /* - * The principal ID of resource identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant ID of resource. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The client ID of resource. - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the clientId property: The client ID of resource. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbook.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbook.java index f14d90736b93c..851841d31e1c2 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbook.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbook.java @@ -12,6 +12,27 @@ /** An immutable client-side representation of Workbook. */ public interface Workbook { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + /** * Gets the location property: The geo-location where the resource lives. * @@ -31,14 +52,14 @@ public interface Workbook { * * @return the kind value. */ - Kind kind(); + SharedTypeKind kind(); /** - * Gets the displayName property: The user-defined name (display name) of the workbook. + * Gets the namePropertiesName property: The user-defined name of the workbook. * - * @return the displayName value. + * @return the namePropertiesName value. */ - String displayName(); + String namePropertiesName(); /** * Gets the serializedData property: Configuration of this particular workbook. Configuration data is a string @@ -49,12 +70,28 @@ public interface Workbook { String serializedData(); /** - * Gets the version property: Workbook version. + * Gets the version property: 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. */ String version(); + /** + * Gets the workbookId property: Internally assigned unique id of the workbook definition. + * + * @return the workbookId value. + */ + String workbookId(); + + /** + * Gets the sharedTypeKind property: 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. + * + * @return the sharedTypeKind value. + */ + SharedTypeKind sharedTypeKind(); + /** * Gets the timeModified property: Date and time in UTC of the last modification that was made to this workbook * definition. @@ -85,53 +122,11 @@ public interface Workbook { String userId(); /** - * Gets the sourceId property: ResourceId for a source resource. + * Gets the sourceResourceId property: Optional resourceId for a source resource. * - * @return the sourceId value. + * @return the sourceResourceId value. */ - String sourceId(); - - /** - * Gets the storageUri property: BYOS Storage Account URI. - * - * @return the storageUri value. - */ - String storageUri(); - - /** - * Gets the identity property: Identity used for BYOS. - * - * @return the identity value. - */ - ManagedIdentityAutoGenerated identity(); - - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - Map etag(); - - /** - * Gets the id property: Azure resource Id. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: Azure resource name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: Azure resource type. - * - * @return the type value. - */ - String type(); + String sourceResourceId(); /** * Gets the region of the resource. @@ -201,18 +196,15 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithKind, - DefinitionStages.WithDisplayName, + DefinitionStages.WithNamePropertiesName, DefinitionStages.WithSerializedData, DefinitionStages.WithVersion, + DefinitionStages.WithWorkbookId, + DefinitionStages.WithSharedTypeKind, DefinitionStages.WithCategory, DefinitionStages.WithTagsPropertiesTags, - DefinitionStages.WithSourceId, - DefinitionStages.WithStorageUri, - DefinitionStages.WithIdentity, - DefinitionStages.WithEtag, - DefinitionStages.WithName, - DefinitionStages.WithType, - DefinitionStages.WithSourceIdParameter { + DefinitionStages.WithUserId, + DefinitionStages.WithSourceResourceId { /** * Executes the create request. * @@ -246,17 +238,17 @@ interface WithKind { * @param kind The kind of workbook. Choices are user and shared. * @return the next definition stage. */ - WithCreate withKind(Kind kind); + WithCreate withKind(SharedTypeKind kind); } - /** The stage of the Workbook definition allowing to specify displayName. */ - interface WithDisplayName { + /** The stage of the Workbook definition allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { /** - * Specifies the displayName property: The user-defined name (display name) of the workbook.. + * Specifies the namePropertiesName property: The user-defined name of the workbook.. * - * @param displayName The user-defined name (display name) of the workbook. + * @param namePropertiesName The user-defined name of the workbook. * @return the next definition stage. */ - WithCreate withDisplayName(String displayName); + WithCreate withNamePropertiesName(String namePropertiesName); } /** The stage of the Workbook definition allowing to specify serializedData. */ interface WithSerializedData { @@ -273,13 +265,37 @@ interface WithSerializedData { /** The stage of the Workbook definition allowing to specify version. */ interface WithVersion { /** - * Specifies the version property: Workbook version. + * Specifies the version property: This instance's version of the data model. This can change as new + * features are added that can be marked workbook.. * - * @param version Workbook version. + * @param version This instance's version of the data model. This can change as new features are added that + * can be marked workbook. * @return the next definition stage. */ WithCreate withVersion(String version); } + /** The stage of the Workbook definition allowing to specify workbookId. */ + interface WithWorkbookId { + /** + * Specifies the workbookId property: Internally assigned unique id of the workbook definition.. + * + * @param workbookId Internally assigned unique id of the workbook definition. + * @return the next definition stage. + */ + WithCreate withWorkbookId(String workbookId); + } + /** The stage of the Workbook definition allowing to specify sharedTypeKind. */ + interface WithSharedTypeKind { + /** + * Specifies the sharedTypeKind property: 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.. + * + * @param sharedTypeKind 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. + * @return the next definition stage. + */ + WithCreate withSharedTypeKind(SharedTypeKind sharedTypeKind); + } /** The stage of the Workbook definition allowing to specify category. */ interface WithCategory { /** @@ -301,75 +317,25 @@ interface WithTagsPropertiesTags { */ WithCreate withTagsPropertiesTags(List tagsPropertiesTags); } - /** The stage of the Workbook definition allowing to specify sourceId. */ - interface WithSourceId { - /** - * Specifies the sourceId property: ResourceId for a source resource.. - * - * @param sourceId ResourceId for a source resource. - * @return the next definition stage. - */ - WithCreate withSourceId(String sourceId); - } - /** The stage of the Workbook definition allowing to specify storageUri. */ - interface WithStorageUri { - /** - * Specifies the storageUri property: BYOS Storage Account URI. - * - * @param storageUri BYOS Storage Account URI. - * @return the next definition stage. - */ - WithCreate withStorageUri(String storageUri); - } - /** The stage of the Workbook definition allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: Identity used for BYOS. - * - * @param identity Identity used for BYOS. - * @return the next definition stage. - */ - WithCreate withIdentity(ManagedIdentityAutoGenerated identity); - } - /** The stage of the Workbook definition allowing to specify etag. */ - interface WithEtag { - /** - * Specifies the etag property: Resource etag. - * - * @param etag Resource etag. - * @return the next definition stage. - */ - WithCreate withEtag(Map etag); - } - /** The stage of the Workbook definition allowing to specify name. */ - interface WithName { + /** The stage of the Workbook definition allowing to specify userId. */ + interface WithUserId { /** - * Specifies the name property: Azure resource name. + * Specifies the userId property: Unique user id of the specific user that owns this workbook.. * - * @param name Azure resource name. + * @param userId Unique user id of the specific user that owns this workbook. * @return the next definition stage. */ - WithCreate withName(String name); + WithCreate withUserId(String userId); } - /** The stage of the Workbook definition allowing to specify type. */ - interface WithType { + /** The stage of the Workbook definition allowing to specify sourceResourceId. */ + interface WithSourceResourceId { /** - * Specifies the type property: Azure resource type. + * Specifies the sourceResourceId property: Optional resourceId for a source resource.. * - * @param type Azure resource type. + * @param sourceResourceId Optional resourceId for a source resource. * @return the next definition stage. */ - WithCreate withType(String type); - } - /** The stage of the Workbook definition allowing to specify sourceId. */ - interface WithSourceIdParameter { - /** - * Specifies the sourceId property: Azure Resource Id that will fetch all linked workbooks.. - * - * @param sourceId Azure Resource Id that will fetch all linked workbooks. - * @return the next definition stage. - */ - WithCreate withSourceIdParameter(String sourceId); + WithCreate withSourceResourceId(String sourceResourceId); } } /** @@ -383,11 +349,15 @@ interface WithSourceIdParameter { interface Update extends UpdateStages.WithTags, UpdateStages.WithKind, - UpdateStages.WithDisplayName, + UpdateStages.WithNamePropertiesName, UpdateStages.WithSerializedData, + UpdateStages.WithVersion, + UpdateStages.WithWorkbookId, + UpdateStages.WithSharedTypeKind, UpdateStages.WithCategory, UpdateStages.WithTagsPropertiesTags, - UpdateStages.WithsourceId { + UpdateStages.WithUserId, + UpdateStages.WithSourceResourceId { /** * Executes the update request. * @@ -408,7 +378,7 @@ interface UpdateStages { /** The stage of the Workbook update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Resource tags. + * Specifies the tags property: Resource tags.. * * @param tags Resource tags. * @return the next definition stage. @@ -425,15 +395,15 @@ interface WithKind { */ Update withKind(SharedTypeKind kind); } - /** The stage of the Workbook update allowing to specify displayName. */ - interface WithDisplayName { + /** The stage of the Workbook update allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { /** - * Specifies the displayName property: The user-defined name (display name) of the workbook.. + * Specifies the namePropertiesName property: The user-defined name of the workbook.. * - * @param displayName The user-defined name (display name) of the workbook. + * @param namePropertiesName The user-defined name of the workbook. * @return the next definition stage. */ - Update withDisplayName(String displayName); + Update withNamePropertiesName(String namePropertiesName); } /** The stage of the Workbook update allowing to specify serializedData. */ interface WithSerializedData { @@ -447,6 +417,40 @@ interface WithSerializedData { */ Update withSerializedData(String serializedData); } + /** The stage of the Workbook update allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: This instance's version of the data model. This can change as new + * features are added that can be marked workbook.. + * + * @param version This instance's version of the data model. This can change as new features are added that + * can be marked workbook. + * @return the next definition stage. + */ + Update withVersion(String version); + } + /** The stage of the Workbook update allowing to specify workbookId. */ + interface WithWorkbookId { + /** + * Specifies the workbookId property: Internally assigned unique id of the workbook definition.. + * + * @param workbookId Internally assigned unique id of the workbook definition. + * @return the next definition stage. + */ + Update withWorkbookId(String workbookId); + } + /** The stage of the Workbook update allowing to specify sharedTypeKind. */ + interface WithSharedTypeKind { + /** + * Specifies the sharedTypeKind property: 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.. + * + * @param sharedTypeKind 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. + * @return the next definition stage. + */ + Update withSharedTypeKind(SharedTypeKind sharedTypeKind); + } /** The stage of the Workbook update allowing to specify category. */ interface WithCategory { /** @@ -468,15 +472,25 @@ interface WithTagsPropertiesTags { */ Update withTagsPropertiesTags(List tagsPropertiesTags); } - /** The stage of the Workbook update allowing to specify sourceId. */ - interface WithsourceId { + /** The stage of the Workbook update allowing to specify userId. */ + interface WithUserId { + /** + * Specifies the userId property: Unique user id of the specific user that owns this workbook.. + * + * @param userId Unique user id of the specific user that owns this workbook. + * @return the next definition stage. + */ + Update withUserId(String userId); + } + /** The stage of the Workbook update allowing to specify sourceResourceId. */ + interface WithSourceResourceId { /** - * Specifies the sourceId property: Azure Resource Id that will fetch all linked workbooks.. + * Specifies the sourceResourceId property: Optional resourceId for a source resource.. * - * @param sourceId Azure Resource Id that will fetch all linked workbooks. + * @param sourceResourceId Optional resourceId for a source resource. * @return the next definition stage. */ - Update sourceId(String sourceId); + Update withSourceResourceId(String sourceResourceId); } } /** diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookError.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookError.java deleted file mode 100644 index e8b1f09d928a6..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookError.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Error response. */ -@Fluent -public final class WorkbookError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookError.class); - - /* - * The error details. - */ - @JsonProperty(value = "error") - private ErrorDefinition error; - - /** - * Get the error property: The error details. - * - * @return the error value. - */ - public ErrorDefinition error() { - return this.error; - } - - /** - * Set the error property: The error details. - * - * @param error the error value to set. - * @return the WorkbookError object itself. - */ - public WorkbookError withError(ErrorDefinition error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (error() != null) { - error().validate(); - } - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorException.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorException.java deleted file mode 100644 index c4451f91ad985..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorException.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.exception.HttpResponseException; -import com.azure.core.http.HttpResponse; - -/** Exception thrown for an invalid response with WorkbookError information. */ -public final class WorkbookErrorException extends HttpResponseException { - /** - * 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(String message, HttpResponse 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 value the deserialized response value. - */ - public WorkbookErrorException(String message, HttpResponse response, WorkbookError value) { - super(message, response, value); - } - - @Override - public WorkbookError getValue() { - return (WorkbookError) super.getValue(); - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookResource.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookResource.java new file mode 100644 index 0000000000000..824f4b51c4136 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookResource.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.applicationinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** An azure resource object. */ +@Immutable +public class WorkbookResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookResource.class); + + /** {@inheritDoc} */ + @Override + public WorkbookResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkbookResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookUpdateParameters.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookUpdateParameters.java deleted file mode 100644 index 3200915b3a988..0000000000000 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookUpdateParameters.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.applicationinsights.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The parameters that can be provided when updating workbook properties properties. */ -@JsonFlatten -@Fluent -public class WorkbookUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookUpdateParameters.class); - - /* - * The kind of workbook. Choices are user and shared. - */ - @JsonProperty(value = "kind") - private SharedTypeKind kind; - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * The user-defined name (display name) of the workbook. - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * Configuration of this particular workbook. Configuration data is a - * string containing valid JSON - */ - @JsonProperty(value = "properties.serializedData") - private String serializedData; - - /* - * Workbook category, as defined by the user at creation time. - */ - @JsonProperty(value = "properties.category") - private String category; - - /* - * A list of 0 or more tags that are associated with this workbook - * definition - */ - @JsonProperty(value = "properties.tags") - private List tagsPropertiesTags; - - /** - * Get the kind property: The kind of workbook. Choices are user and shared. - * - * @return the kind value. - */ - public SharedTypeKind kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of workbook. Choices are user and shared. - * - * @param kind the kind value to set. - * @return the WorkbookUpdateParameters object itself. - */ - public WorkbookUpdateParameters withKind(SharedTypeKind kind) { - this.kind = kind; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the WorkbookUpdateParameters object itself. - */ - public WorkbookUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the displayName property: The user-defined name (display name) of the workbook. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The user-defined name (display name) of the workbook. - * - * @param displayName the displayName value to set. - * @return the WorkbookUpdateParameters object itself. - */ - public WorkbookUpdateParameters withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the serializedData property: Configuration of this particular workbook. Configuration data is a string - * containing valid JSON. - * - * @return the serializedData value. - */ - public String serializedData() { - return this.serializedData; - } - - /** - * Set the serializedData property: Configuration of this particular workbook. Configuration data is a string - * containing valid JSON. - * - * @param serializedData the serializedData value to set. - * @return the WorkbookUpdateParameters object itself. - */ - public WorkbookUpdateParameters withSerializedData(String serializedData) { - this.serializedData = serializedData; - return this; - } - - /** - * Get the category property: Workbook category, as defined by the user at creation time. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: Workbook category, as defined by the user at creation time. - * - * @param category the category value to set. - * @return the WorkbookUpdateParameters object itself. - */ - public WorkbookUpdateParameters withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the tagsPropertiesTags property: A list of 0 or more tags that are associated with this workbook definition. - * - * @return the tagsPropertiesTags value. - */ - public List tagsPropertiesTags() { - return this.tagsPropertiesTags; - } - - /** - * Set the tagsPropertiesTags property: A list of 0 or more tags that are associated with this workbook definition. - * - * @param tagsPropertiesTags the tagsPropertiesTags value to set. - * @return the WorkbookUpdateParameters object itself. - */ - public WorkbookUpdateParameters withTagsPropertiesTags(List tagsPropertiesTags) { - this.tagsPropertiesTags = tagsPropertiesTags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbooks.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbooks.java index 1cf00eacd504b..2699b2efd5705 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbooks.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Workbooks.java @@ -11,42 +11,13 @@ /** Resource collection API of Workbooks. */ public interface Workbooks { - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private workbooks defined within a specified subscription and category. - */ - PagedIterable list(CategoryType category); - - /** - * Get all private workbooks defined within a specified subscription and category. - * - * @param category Category of workbook to return. - * @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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private workbooks defined within a specified subscription and category. - */ - PagedIterable list(CategoryType category, List tags, Boolean canFetchContent, Context context); - /** * Get all Workbooks defined within a specified resource group and category. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ @@ -58,23 +29,16 @@ public interface Workbooks { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param category Category of workbook to return. * @param tags Tags presents on each workbook returned. - * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Workbooks defined within a specified resource group and category. */ PagedIterable listByResourceGroup( - String resourceGroupName, - CategoryType category, - List tags, - String sourceId, - Boolean canFetchContent, - Context context); + String resourceGroupName, CategoryType category, List tags, Boolean canFetchContent, Context context); /** * Get a single workbook by its resourceName. @@ -82,8 +46,7 @@ PagedIterable listByResourceGroup( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -96,8 +59,7 @@ PagedIterable listByResourceGroup( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -109,8 +71,7 @@ PagedIterable listByResourceGroup( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the Application Insights component resource. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void deleteByResourceGroup(String resourceGroupName, String resourceName); @@ -122,8 +83,7 @@ PagedIterable listByResourceGroup( * @param resourceName The name of the Application Insights component resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @@ -134,8 +94,7 @@ PagedIterable listByResourceGroup( * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -147,8 +106,7 @@ PagedIterable listByResourceGroup( * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single workbook by its resourceName. */ @@ -159,8 +117,7 @@ PagedIterable listByResourceGroup( * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void deleteById(String id); @@ -171,8 +128,7 @@ PagedIterable listByResourceGroup( * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorException thrown if the request is - * rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbooksListResult.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbooksListResult.java index 325e51719c7d9..d808d5672a6f9 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbooksListResult.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbooksListResult.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.applicationinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookInner; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -12,7 +12,7 @@ import java.util.List; /** Workbook list result. */ -@Fluent +@Immutable public final class WorkbooksListResult { @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbooksListResult.class); @@ -22,12 +22,6 @@ public final class WorkbooksListResult { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; - /* - * The nextLink property. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - /** * Get the value property: An array of workbooks. * @@ -37,26 +31,6 @@ public List value() { return this.value; } - /** - * Get the nextLink property: The nextLink property. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The nextLink property. - * - * @param nextLink the nextLink value to set. - * @return the WorkbooksListResult object itself. - */ - public WorkbooksListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. *