diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md index fc476f67b51b6..5df23fdf7af5f 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/CHANGELOG.md @@ -1,7 +1,198 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2021-12-13) +- 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-2021-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +* `models.ManagedIdentityAutoGenerated` was removed + +* `models.ManagedIdentityType` was removed + +* `models.WorkbookError` was removed + +* `models.UserAssignedIdentitiesAutoGenerated` was removed + +* `models.UserAssignedIdentities` was removed + +* `models.ManagedIdentity` was removed + +* `models.WorkbookErrorException` was removed + +#### `models.MyWorkbook` was modified + +* `models.ManagedIdentity identity()` -> `models.MyWorkbookManagedIdentity identity()` + +#### `models.MyWorkbookResource` was modified + +* `withIdentity(models.ManagedIdentity)` was removed +* `models.ManagedIdentity identity()` -> `models.MyWorkbookManagedIdentity identity()` + +#### `models.Workbook$Definition` was modified + +* `withEtag(java.util.Map)` was removed +* `withIdentity(models.ManagedIdentityAutoGenerated)` was removed +* `withName(java.lang.String)` was removed +* `withType(java.lang.String)` was removed + +#### `models.Workbook$Update` was modified + +* `sourceId(java.lang.String)` was removed + +#### `models.Workbook` was modified + +* `models.ManagedIdentityAutoGenerated identity()` -> `models.WorkbookResourceIdentity identity()` +* `java.lang.String timeModified()` -> `java.time.OffsetDateTime timeModified()` +* `java.util.Map etag()` -> `java.lang.String etag()` + +#### `models.MyWorkbook$Update` was modified + +* `withName(java.lang.String)` was removed +* `withIdentity(models.ManagedIdentity)` was removed +* `sourceIdParameter(java.lang.String)` was removed +* `withType(java.lang.String)` was removed + +#### `models.MyWorkbook$Definition` was modified + +* `withIdentity(models.ManagedIdentity)` was removed + +### Features Added + +* `models.WorkbookTemplateLocalizedGallery` was added + +* `models.ComponentLinkedStorageAccounts` was added + +* `models.ComponentLinkedStorageAccounts$Update` was added + +* `models.ComponentLinkedStorageAccounts$DefinitionStages` was added + +* `models.LiveTokenResponse` was added + +* `models.WorkbookErrorDefinitionException` was added + +* `models.WorkbookTemplateUpdateParameters` was added + +* `models.WorkbookResource` was added + +* `models.MyWorkbookManagedIdentityType` was added + +* `models.MyWorkbookUserAssignedIdentities` was added + +* `models.WorkbookErrorDefinition` was added + +* `models.ComponentLinkedStorageAccountsOperations` was added + +* `models.WorkbookTemplate$Definition` was added + +* `models.WorkbookTemplate$Update` was added + +* `models.WorkbookResourceIdentity` was added + +* `models.UserAssignedIdentity` was added + +* `models.MyWorkbookManagedIdentity` was added + +* `models.LiveTokens` was added + +* `models.WorkbookTemplate$UpdateStages` was added + +* `models.WorkbookTemplate$DefinitionStages` was added + +* `models.ComponentLinkedStorageAccountsPatch` was added + +* `models.ManagedServiceIdentity` was added + +* `models.WorkbookTemplate` was added + +* `models.StorageType` was added + +* `models.WorkbookTemplateGallery` was added + +* `models.PublicNetworkAccessType` was added + +* `models.WorkbookTemplatesListResult` was added + +* `models.WorkbookTemplates` was added + +* `models.ComponentLinkedStorageAccounts$Definition` was added + +* `models.ComponentLinkedStorageAccounts$UpdateStages` was added + +* `models.WorkbookTemplateResource` was added + +* `models.ManagedServiceIdentityType` was added + +#### `models.WorkbookUpdateParameters` was modified + +* `withRevision(java.lang.String)` was added +* `revision()` was added +* `withDescription(java.lang.String)` was added +* `description()` was added + +#### `models.ApplicationInsightsComponent` was modified + +* `publicNetworkAccessForIngestion()` was added +* `purgeWithResponse(models.ComponentPurgeBody,com.azure.core.util.Context)` was added +* `purge(models.ComponentPurgeBody)` was added +* `publicNetworkAccessForQuery()` was added + +#### `models.ApplicationInsightsComponent$Definition` was modified + +* `withPublicNetworkAccessForQuery(models.PublicNetworkAccessType)` was added +* `withPublicNetworkAccessForIngestion(models.PublicNetworkAccessType)` was added + +#### `models.Workbooks` was modified + +* `revisionsList(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `revisionsList(java.lang.String,java.lang.String)` was added +* `revisionGet(java.lang.String,java.lang.String,java.lang.String)` was added +* `revisionGetWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.MyWorkbook` was modified + +* `systemData()` was added + +#### `models.MyWorkbookResource` was modified + +* `withIdentity(models.MyWorkbookManagedIdentity)` was added + +#### `models.Workbook$Definition` was modified + +* `withEtag(java.lang.String)` was added +* `withDescription(java.lang.String)` was added +* `withIdentity(models.WorkbookResourceIdentity)` was added + +#### `models.Workbook$Update` was modified + +* `withDescription(java.lang.String)` was added +* `withRevision(java.lang.String)` was added +* `withSourceId(java.lang.String)` was added + +#### `ApplicationInsightsManager` was modified + +* `liveTokens()` was added +* `workbookTemplates()` was added +* `componentLinkedStorageAccountsOperations()` was added + +#### `models.Workbook` was modified + +* `description()` was added +* `systemData()` was added +* `revision()` was added + +#### `ApplicationInsightsManager$Configurable` was modified + +* `withScope(java.lang.String)` was added + +#### `models.MyWorkbook$Update` was modified + +* `withIdentity(models.MyWorkbookManagedIdentity)` was added +* `withSourceIdParameter(java.lang.String)` was added + +#### `models.MyWorkbook$Definition` was modified + +* `withIdentity(models.MyWorkbookManagedIdentity)` was added ## 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 a81755a5f6f36..58ebfa1093198 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-2021-11-01. 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}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md new file mode 100644 index 0000000000000..19b4a74d4fa7e --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/SAMPLE.md @@ -0,0 +1,2809 @@ +# Code snippets and samples + + +## AnalyticsItems + +- [Delete](#analyticsitems_delete) +- [Get](#analyticsitems_get) +- [List](#analyticsitems_list) +- [Put](#analyticsitems_put) + +## Annotations + +- [Create](#annotations_create) +- [Delete](#annotations_delete) +- [Get](#annotations_get) +- [List](#annotations_list) + +## ApiKeys + +- [Create](#apikeys_create) +- [Delete](#apikeys_delete) +- [Get](#apikeys_get) +- [List](#apikeys_list) + +## ComponentAvailableFeatures + +- [Get](#componentavailablefeatures_get) + +## ComponentCurrentBillingFeatures + +- [Get](#componentcurrentbillingfeatures_get) +- [Update](#componentcurrentbillingfeatures_update) + +## ComponentFeatureCapabilities + +- [Get](#componentfeaturecapabilities_get) + +## ComponentLinkedStorageAccountsOperation + +- [CreateAndUpdate](#componentlinkedstorageaccountsoperation_createandupdate) +- [Delete](#componentlinkedstorageaccountsoperation_delete) +- [Get](#componentlinkedstorageaccountsoperation_get) +- [Update](#componentlinkedstorageaccountsoperation_update) + +## ComponentQuotaStatus + +- [Get](#componentquotastatus_get) + +## Components + +- [CreateOrUpdate](#components_createorupdate) +- [Delete](#components_delete) +- [GetByResourceGroup](#components_getbyresourcegroup) +- [GetPurgeStatus](#components_getpurgestatus) +- [List](#components_list) +- [ListByResourceGroup](#components_listbyresourcegroup) +- [Purge](#components_purge) +- [UpdateTags](#components_updatetags) + +## ExportConfigurations + +- [Create](#exportconfigurations_create) +- [Delete](#exportconfigurations_delete) +- [Get](#exportconfigurations_get) +- [List](#exportconfigurations_list) +- [Update](#exportconfigurations_update) + +## Favorites + +- [Add](#favorites_add) +- [Delete](#favorites_delete) +- [Get](#favorites_get) +- [List](#favorites_list) +- [Update](#favorites_update) + +## LiveToken + +- [Get](#livetoken_get) + +## MyWorkbooks + +- [CreateOrUpdate](#myworkbooks_createorupdate) +- [Delete](#myworkbooks_delete) +- [GetByResourceGroup](#myworkbooks_getbyresourcegroup) +- [List](#myworkbooks_list) +- [ListByResourceGroup](#myworkbooks_listbyresourcegroup) +- [Update](#myworkbooks_update) + +## ProactiveDetectionConfigurations + +- [Get](#proactivedetectionconfigurations_get) +- [List](#proactivedetectionconfigurations_list) +- [Update](#proactivedetectionconfigurations_update) + +## WebTestLocations + +- [List](#webtestlocations_list) + +## WebTests + +- [CreateOrUpdate](#webtests_createorupdate) +- [Delete](#webtests_delete) +- [GetByResourceGroup](#webtests_getbyresourcegroup) +- [List](#webtests_list) +- [ListByComponent](#webtests_listbycomponent) +- [ListByResourceGroup](#webtests_listbyresourcegroup) +- [UpdateTags](#webtests_updatetags) + +## WorkItemConfigurations + +- [Create](#workitemconfigurations_create) +- [Delete](#workitemconfigurations_delete) +- [GetDefault](#workitemconfigurations_getdefault) +- [GetItem](#workitemconfigurations_getitem) +- [List](#workitemconfigurations_list) +- [UpdateItem](#workitemconfigurations_updateitem) + +## WorkbookTemplates + +- [CreateOrUpdate](#workbooktemplates_createorupdate) +- [Delete](#workbooktemplates_delete) +- [GetByResourceGroup](#workbooktemplates_getbyresourcegroup) +- [ListByResourceGroup](#workbooktemplates_listbyresourcegroup) +- [Update](#workbooktemplates_update) + +## Workbooks + +- [CreateOrUpdate](#workbooks_createorupdate) +- [Delete](#workbooks_delete) +- [GetByResourceGroup](#workbooks_getbyresourcegroup) +- [List](#workbooks_list) +- [ListByResourceGroup](#workbooks_listbyresourcegroup) +- [RevisionGet](#workbooks_revisionget) +- [RevisionsList](#workbooks_revisionslist) +- [Update](#workbooks_update) +### AnalyticsItems_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; + +/** Samples for AnalyticsItems Delete. */ +public final class AnalyticsItemsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemDelete.json + */ + /** + * Sample code: AnalyticsItemDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .deleteWithResponse( + "my-resource-group", + "my-component", + ItemScopePath.ANALYTICS_ITEMS, + "3466c160-4a10-4df8-afdf-0007f3f6dee5", + null, + Context.NONE); + } +} +``` + +### AnalyticsItems_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; + +/** Samples for AnalyticsItems Get. */ +public final class AnalyticsItemsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemGet.json + */ + /** + * Sample code: AnalyticsItemGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .getWithResponse( + "my-resource-group", + "my-component", + ItemScopePath.ANALYTICS_ITEMS, + "3466c160-4a10-4df8-afdf-0007f3f6dee5", + null, + Context.NONE); + } +} +``` + +### AnalyticsItems_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; + +/** Samples for AnalyticsItems List. */ +public final class AnalyticsItemsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemList.json + */ + /** + * Sample code: AnalyticsItemList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .listWithResponse( + "my-resource-group", "my-component", ItemScopePath.ANALYTICS_ITEMS, null, null, null, Context.NONE); + } +} +``` + +### AnalyticsItems_Put + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentAnalyticsItemInner; +import com.azure.resourcemanager.applicationinsights.models.ItemScope; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; +import com.azure.resourcemanager.applicationinsights.models.ItemType; + +/** Samples for AnalyticsItems Put. */ +public final class AnalyticsItemsPutSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemPut.json + */ + /** + * Sample code: AnalyticsItemPut. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemPut( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .putWithResponse( + "my-resource-group", + "my-component", + ItemScopePath.ANALYTICS_ITEMS, + new ApplicationInsightsComponentAnalyticsItemInner() + .withName("Exceptions - New in the last 24 hours") + .withContent( + "let newExceptionsTimeRange = 1d;\n" + + "let timeRangeToCheckBefore = 7d;\n" + + "exceptions\n" + + "| where timestamp < ago(timeRangeToCheckBefore)\n" + + "| summarize count() by problemId\n" + + "| join kind= rightanti (\n" + + "exceptions\n" + + "| where timestamp >= ago(newExceptionsTimeRange)\n" + + "| extend stack = tostring(details[0].rawStack)\n" + + "| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp)," + + " any(stack) by problemId \n" + + ") on problemId \n" + + "| order by count_ desc\n") + .withScope(ItemScope.SHARED) + .withType(ItemType.QUERY), + null, + Context.NONE); + } +} +``` + +### Annotations_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.AnnotationInner; +import java.time.OffsetDateTime; + +/** Samples for Annotations Create. */ +public final class AnnotationsCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsCreate.json + */ + /** + * Sample code: AnnotationsCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .createWithResponse( + "my-resource-group", + "my-component", + new AnnotationInner() + .withAnnotationName("TestAnnotation") + .withCategory("Text") + .withEventTime(OffsetDateTime.parse("2018-01-31T13:41:38.657Z")) + .withId("444e2c08-274a-4bbb-a89e-d77bb720f44a") + .withProperties("{\"Comments\":\"Testing\",\"Label\":\"Success\"}"), + Context.NONE); + } +} +``` + +### Annotations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Annotations Delete. */ +public final class AnnotationsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsDelete.json + */ + /** + * Sample code: AnnotationsDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .deleteWithResponse( + "my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", Context.NONE); + } +} +``` + +### Annotations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Annotations Get. */ +public final class AnnotationsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsGet.json + */ + /** + * Sample code: AnnotationsGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .getWithResponse("my-resource-group", "my-component", "444e2c08-274a-4bbb-a89e-d77bb720f44a", Context.NONE); + } +} +``` + +### Annotations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Annotations List. */ +public final class AnnotationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsList.json + */ + /** + * Sample code: AnnotationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .list( + "my-resource-group", + "my-component", + "2018-02-05T00%3A30%3A00.000Z", + "2018-02-06T00%3A33A00.000Z", + Context.NONE); + } +} +``` + +### ApiKeys_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApiKeyRequest; +import java.util.Arrays; + +/** Samples for ApiKeys Create. */ +public final class ApiKeysCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysCreate.json + */ + /** + * Sample code: APIKeyCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeyCreate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .apiKeys() + .createWithResponse( + "my-resource-group", + "my-component", + new ApiKeyRequest() + .withName("test2") + .withLinkedReadProperties( + Arrays + .asList( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api", + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")) + .withLinkedWriteProperties( + Arrays + .asList( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/annotations")), + Context.NONE); + } +} +``` + +### ApiKeys_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ApiKeys Delete. */ +public final class ApiKeysDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysDelete.json + */ + /** + * Sample code: APIKeyDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeyDelete(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .apiKeys() + .deleteWithResponse( + "my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", Context.NONE); + } +} +``` + +### ApiKeys_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ApiKeys Get. */ +public final class ApiKeysGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysGet.json + */ + /** + * Sample code: APIKeysGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeysGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .apiKeys() + .getWithResponse("my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", Context.NONE); + } +} +``` + +### ApiKeys_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApiKeys List. */ +public final class ApiKeysListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysList.json + */ + /** + * Sample code: APIKeysList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeysList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.apiKeys().list("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### ComponentAvailableFeatures_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ComponentAvailableFeatures Get. */ +public final class ComponentAvailableFeaturesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AvailableBillingFeaturesGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentAvailableFeatures().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### ComponentCurrentBillingFeatures_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ComponentCurrentBillingFeatures Get. */ +public final class ComponentCurrentBillingFeaturesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentCurrentBillingFeatures().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### ComponentCurrentBillingFeatures_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentBillingFeaturesInner; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap; +import java.util.Arrays; + +/** Samples for ComponentCurrentBillingFeatures Update. */ +public final class ComponentCurrentBillingFeaturesUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesUpdate.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentCurrentBillingFeatures() + .updateWithResponse( + "my-resource-group", + "my-component", + new ApplicationInsightsComponentBillingFeaturesInner() + .withDataVolumeCap( + new ApplicationInsightsComponentDataVolumeCap() + .withCap(100.0f) + .withStopSendNotificationWhenHitCap(true)) + .withCurrentBillingFeatures(Arrays.asList("Basic", "Application Insights Enterprise")), + Context.NONE); + } +} +``` + +### ComponentFeatureCapabilities_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ComponentFeatureCapabilities Get. */ +public final class ComponentFeatureCapabilitiesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FeatureCapabilitiesGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentFeatureCapabilities().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### ComponentLinkedStorageAccountsOperation_CreateAndUpdate + +```java +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation CreateAndUpdate. */ +public final class ComponentLinkedStorageAccountsOperationCreateAndUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsCreateAndUpdate.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsCreateAndUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsCreateAndUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentLinkedStorageAccountsOperations() + .define(StorageType.SERVICE_PROFILER) + .withExistingComponent("someResourceGroupName", "myComponent") + .withLinkedStorageAccount( + "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname") + .create(); + } +} +``` + +### ComponentLinkedStorageAccountsOperation_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation Delete. */ +public final class ComponentLinkedStorageAccountsOperationDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsDelete.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentLinkedStorageAccountsOperations() + .deleteWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER, Context.NONE); + } +} +``` + +### ComponentLinkedStorageAccountsOperation_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation Get. */ +public final class ComponentLinkedStorageAccountsOperationGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsGet.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentLinkedStorageAccountsOperations() + .getWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER, Context.NONE); + } +} +``` + +### ComponentLinkedStorageAccountsOperation_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccounts; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation Update. */ +public final class ComponentLinkedStorageAccountsOperationUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsUpdate.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + ComponentLinkedStorageAccounts resource = + manager + .componentLinkedStorageAccountsOperations() + .getWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER, Context.NONE) + .getValue(); + resource + .update() + .withLinkedStorageAccount( + "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname") + .apply(); + } +} +``` + +### ComponentQuotaStatus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ComponentQuotaStatus Get. */ +public final class ComponentQuotaStatusGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/QuotaStatusGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentQuotaStatus().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### Components_CreateOrUpdate + +```java +import com.azure.resourcemanager.applicationinsights.models.ApplicationType; +import com.azure.resourcemanager.applicationinsights.models.FlowType; +import com.azure.resourcemanager.applicationinsights.models.RequestSource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Components CreateOrUpdate. */ +public final class ComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsCreate.json + */ + /** + * Sample code: ComponentCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .define("my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind("web") + .withApplicationType(ApplicationType.WEB) + .withFlowType(FlowType.BLUEFIELD) + .withRequestSource(RequestSource.REST) + .create(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsUpdate.json + */ + /** + * Sample code: ComponentUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .define("my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind("web") + .withTags(mapOf("ApplicationGatewayType", "Internal-Only", "BillingEntity", "Self")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Components_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Components Delete. */ +public final class ComponentsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsDelete.json + */ + /** + * Sample code: ComponentsDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentsDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().deleteWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### Components_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Components GetByResourceGroup. */ +public final class ComponentsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsGet.json + */ + /** + * Sample code: ComponentGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().getByResourceGroupWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### Components_GetPurgeStatus + +```java +import com.azure.core.util.Context; + +/** Samples for Components GetPurgeStatus. */ +public final class ComponentsGetPurgeStatusSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsPurgeStatus.json + */ + /** + * Sample code: ComponentPurge. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentPurge( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .getPurgeStatusWithResponse( + "OIAutoRest5123", "aztest5048", "purge-970318e7-b859-4edb-8903-83b1b54d0b74", Context.NONE); + } +} +``` + +### Components_List + +```java +import com.azure.core.util.Context; + +/** Samples for Components List. */ +public final class ComponentsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsList.json + */ + /** + * Sample code: ComponentsList.json. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentsListJson( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().list(Context.NONE); + } +} +``` + +### Components_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Components ListByResourceGroup. */ +public final class ComponentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsListByResourceGroup.json + */ + /** + * Sample code: ComponentListByResourceGroup. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentListByResourceGroup( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().listByResourceGroup("my-resource-group", Context.NONE); + } +} +``` + +### Components_Purge + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ComponentPurgeBody; +import com.azure.resourcemanager.applicationinsights.models.ComponentPurgeBodyFilters; +import java.util.Arrays; + +/** Samples for Components Purge. */ +public final class ComponentsPurgeSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsPurge.json + */ + /** + * Sample code: ComponentPurge. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentPurge( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .purgeWithResponse( + "OIAutoRest5123", + "aztest5048", + new ComponentPurgeBody() + .withTable("Heartbeat") + .withFilters( + Arrays + .asList( + new ComponentPurgeBodyFilters() + .withColumn("TimeGenerated") + .withOperator(">") + .withValue("2017-09-01T00:00:00"))), + Context.NONE); + } +} +``` + +### Components_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponent; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Components UpdateTags. */ +public final class ComponentsUpdateTagsSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsUpdateTagsOnly.json + */ + /** + * Sample code: ComponentUpdateTagsOnly. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentUpdateTagsOnly( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + ApplicationInsightsComponent resource = + manager + .components() + .getByResourceGroupWithResponse("my-resource-group", "my-component", Context.NONE) + .getValue(); + resource + .update() + .withTags( + mapOf( + "ApplicationGatewayType", + "Internal-Only", + "BillingEntity", + "Self", + "Color", + "AzureBlue", + "CustomField_01", + "Custom text in some random field named randomly", + "NodeType", + "Edge")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ExportConfigurations_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentExportRequest; + +/** Samples for ExportConfigurations Create. */ +public final class ExportConfigurationsCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsPost.json + */ + /** + * Sample code: ExportConfigurationPost. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationPost( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .createWithResponse( + "my-resource-group", + "my-component", + new ApplicationInsightsComponentExportRequest() + .withRecordTypes( + "Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd," + + " PerformanceCounters, Availability") + .withDestinationType("Blob") + .withDestinationAddress( + "https://mystorageblob.blob.core.windows.net/testexport?sv=2015-04-05&sr=c&sig=token") + .withIsEnabled("true") + .withNotificationQueueEnabled("false") + .withNotificationQueueUri("") + .withDestinationStorageSubscriptionId("subid") + .withDestinationStorageLocationId("eastus") + .withDestinationAccountId( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"), + Context.NONE); + } +} +``` + +### ExportConfigurations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ExportConfigurations Delete. */ +public final class ExportConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationDelete.json + */ + /** + * Sample code: ExportConfigurationDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .deleteWithResponse("my-resource-group", "my-component", "uGOoki0jQsyEs3IdQ83Q4QsNr4=", Context.NONE); + } +} +``` + +### ExportConfigurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExportConfigurations Get. */ +public final class ExportConfigurationsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationGet.json + */ + /** + * Sample code: ExportConfigurationGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .getWithResponse("my-resource-group", "my-component", "uGOoki0jQsyEs3IdQ83Q4QsNr4=", Context.NONE); + } +} +``` + +### ExportConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExportConfigurations List. */ +public final class ExportConfigurationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsList.json + */ + /** + * Sample code: ExportConfigurationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.exportConfigurations().listWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### ExportConfigurations_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentExportRequest; + +/** Samples for ExportConfigurations Update. */ +public final class ExportConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationUpdate.json + */ + /** + * Sample code: ExportConfigurationUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .updateWithResponse( + "my-resource-group", + "my-component", + "uGOoki0jQsyEs3IdQ83Q4QsNr4=", + new ApplicationInsightsComponentExportRequest() + .withRecordTypes( + "Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd," + + " PerformanceCounters, Availability") + .withDestinationType("Blob") + .withDestinationAddress( + "https://mystorageblob.blob.core.windows.net/fchentest?sv=2015-04-05&sr=c&sig=token") + .withIsEnabled("true") + .withNotificationQueueEnabled("false") + .withNotificationQueueUri("") + .withDestinationStorageSubscriptionId("subid") + .withDestinationStorageLocationId("eastus") + .withDestinationAccountId( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"), + Context.NONE); + } +} +``` + +### Favorites_Add + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentFavoriteInner; +import com.azure.resourcemanager.applicationinsights.models.FavoriteType; +import java.util.Arrays; + +/** Samples for Favorites Add. */ +public final class FavoritesAddSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteAdd.json + */ + /** + * Sample code: FavoriteAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteAdd(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .addWithResponse( + "my-resource-group", + "my-ai-component", + "deadb33f-8bee-4d3b-a059-9be8dac93960", + new ApplicationInsightsComponentFavoriteInner() + .withName("Blah Blah Blah") + .withConfig( + "{\"MEDataModelRawJSON\":\"{\\n" + + " \\\"version\\\": \\\"1.4.1\\\",\\n" + + " \\\"isCustomDataModel\\\": true,\\n" + + " \\\"items\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\n" + + " \\\"chartType\\\": \\\"Area\\\",\\n" + + " \\\"chartHeight\\\": 4,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"preview/requests/count\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Sum\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": false,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"aggregation\\\": \\\"Sum\\\",\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"fail\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\n" + + " \\\"chartType\\\": \\\"Area\\\",\\n" + + " \\\"chartHeight\\\": 2,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"preview/requests/duration\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Avg\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-j1\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": false,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"aggregation\\\": \\\"Avg\\\",\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"greenHues\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\n" + + " \\\"chartType\\\": \\\"Bar\\\",\\n" + + " \\\"chartHeight\\\": 4,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"preview/requests/duration\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Avg\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": false,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"aggregation\\\": \\\"Avg\\\",\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"magentaHues\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\n" + + " \\\"grouping\\\": {\\n" + + " \\\"kind\\\": \\\"ByDimension\\\",\\n" + + " \\\"dimension\\\": \\\"context.application.version\\\"\\n" + + " },\\n" + + " \\\"chartType\\\": \\\"Grid\\\",\\n" + + " \\\"chartHeight\\\": 1,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"basicException.count\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Sum\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-g0\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"requestFailed.count\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Sum\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-f0s2\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": true,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"blueHues\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"currentFilter\\\": {\\n" + + " \\\"eventTypes\\\": [\\n" + + " 1,\\n" + + " 2\\n" + + " ],\\n" + + " \\\"typeFacets\\\": {},\\n" + + " \\\"isPermissive\\\": false\\n" + + " },\\n" + + " \\\"timeContext\\\": {\\n" + + " \\\"durationMs\\\": 75600000,\\n" + + " \\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\n" + + " \\\"createdTime\\\": \\\"2018-01-31T23:54:26.280Z\\\",\\n" + + " \\\"isInitialTime\\\": false,\\n" + + " \\\"grain\\\": 1,\\n" + + " \\\"useDashboardTimeRange\\\": false\\n" + + " },\\n" + + " \\\"jsonUri\\\": \\\"Favorite_BlankChart\\\",\\n" + + " \\\"timeSource\\\": 0\\n" + + "}\"}") + .withVersion("ME") + .withFavoriteType(FavoriteType.SHARED) + .withTags(Arrays.asList("TagSample01", "TagSample02")) + .withIsGeneratedFromTemplate(false), + Context.NONE); + } +} +``` + +### Favorites_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Favorites Delete. */ +public final class FavoritesDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteDelete.json + */ + /** + * Sample code: FavoriteList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .deleteWithResponse( + "my-resource-group", "my-ai-component", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} +``` + +### Favorites_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Favorites Get. */ +public final class FavoritesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteGet.json + */ + /** + * Sample code: FavoriteGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .getWithResponse( + "my-resource-group", "my-ai-component", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} +``` + +### Favorites_List + +```java +import com.azure.core.util.Context; + +/** Samples for Favorites List. */ +public final class FavoritesListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoritesList.json + */ + /** + * Sample code: FavoritesList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoritesList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .listWithResponse("my-resource-group", "my-ai-component", null, null, null, null, Context.NONE); + } +} +``` + +### Favorites_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentFavoriteInner; +import com.azure.resourcemanager.applicationinsights.models.FavoriteType; +import java.util.Arrays; + +/** Samples for Favorites Update. */ +public final class FavoritesUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteUpdate.json + */ + /** + * Sample code: FavoriteList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .updateWithResponse( + "my-resource-group", + "my-ai-component", + "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", + new ApplicationInsightsComponentFavoriteInner() + .withName("Derek Changed This") + .withConfig( + "{\"MEDataModelRawJSON\":\"{\\\"version\\\": \\\"1.4.1\\\",\\\"isCustomDataModel\\\":" + + " true,\\\"items\\\": [{\\\"id\\\":" + + " \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\\"chartType\\\":" + + " \\\"Area\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"preview/requests/count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Sum\\\",\\\"percentage\\\":" + + " false,\\\"palette\\\": \\\"fail\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"},{\\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\\"chartType\\\":" + + " \\\"Area\\\",\\\"chartHeight\\\": 2,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-j1\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\":" + + " false,\\\"palette\\\": \\\"greenHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"},{\\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\\"chartType\\\":" + + " \\\"Bar\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\":" + + " false,\\\"palette\\\": \\\"magentaHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"},{\\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\\"grouping\\\":" + + " {\\\"kind\\\": \\\"ByDimension\\\",\\\"dimension\\\":" + + " \\\"context.application.version\\\"},\\\"chartType\\\":" + + " \\\"Grid\\\",\\\"chartHeight\\\": 1,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"basicException.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-g0\\\"},{\\\"id\\\":" + + " \\\"requestFailed.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-f0s2\\\"}],\\\"priorPeriod\\\": true,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"percentage\\\": false,\\\"palette\\\":" + + " \\\"blueHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"}],\\\"currentFilter\\\": {\\\"eventTypes\\\": [1,2],\\\"typeFacets\\\":" + + " {},\\\"isPermissive\\\": false},\\\"timeContext\\\": {\\\"durationMs\\\":" + + " 75600000,\\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\\"createdTime\\\":" + + " \\\"2018-01-31T23:54:26.280Z\\\",\\\"isInitialTime\\\": false,\\\"grain\\\":" + + " 1,\\\"useDashboardTimeRange\\\": false},\\\"jsonUri\\\":" + + " \\\"Favorite_BlankChart\\\",\\\"timeSource\\\": 0}\"}") + .withVersion("ME") + .withFavoriteType(FavoriteType.SHARED) + .withTags(Arrays.asList("TagSample01", "TagSample02", "TagSample03")) + .withIsGeneratedFromTemplate(false), + Context.NONE); + } +} +``` + +### LiveToken_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LiveToken Get. */ +public final class LiveTokenGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-06-02-preview/examples/LiveTokenGet.json + */ + /** + * Sample code: Get live token for resource. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void getLiveTokenForResource( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .liveTokens() + .getWithResponse( + "subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/FabrikamFiberApp/providers/microsoft.insights/components/CustomAvailabilityTest/providers/microsoft.insights/generatelivetoken", + Context.NONE); + } +} +``` + +### MyWorkbooks_CreateOrUpdate + +```java +import com.azure.resourcemanager.applicationinsights.models.Kind; + +/** Samples for MyWorkbooks CreateOrUpdate. */ +public final class MyWorkbooksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookAdd.json + */ + /** + * Sample code: WorkbookAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookAdd(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .define("deadb33f-8bee-4d3b-a059-9be8dac93960") + .withRegion("west us") + .withExistingResourceGroup("my-resource-group") + .withName("deadb33f-8bee-4d3b-a059-9be8dac93960") + .withKind(Kind.USER) + .withDisplayName("Blah Blah Blah") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r" + + "\\n" + + "---\\r" + + "\\n" + + "\\r" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\r" + + "\\n" + + "\\r" + + "\\n" + + "\\r" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below each" + + " section to configure it or add more" + + " sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}") + .withCategory("workbook") + .withSourceId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens") + .create(); + } +} +``` + +### MyWorkbooks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for MyWorkbooks Delete. */ +public final class MyWorkbooksDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookDelete.json + */ + /** + * Sample code: WorkbookDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .deleteWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} +``` + +### MyWorkbooks_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for MyWorkbooks GetByResourceGroup. */ +public final class MyWorkbooksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookGet.json + */ + /** + * Sample code: WorkbookGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} +``` + +### MyWorkbooks_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for MyWorkbooks List. */ +public final class MyWorkbooksListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.json + */ + /** + * Sample code: WorkbooksList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.myWorkbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList2.json + */ + /** + * Sample code: WorkbooksList2. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList2( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.myWorkbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } +} +``` + +### MyWorkbooks_ListByResourceGroup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for MyWorkbooks ListByResourceGroup. */ +public final class MyWorkbooksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.json + */ + /** + * Sample code: WorkbooksList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .listByResourceGroup("my-resource-group", CategoryType.WORKBOOK, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList2.json + */ + /** + * Sample code: WorkbooksList2. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList2( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .listByResourceGroup("my-resource-group", CategoryType.WORKBOOK, null, null, null, Context.NONE); + } +} +``` + +### MyWorkbooks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.Kind; +import com.azure.resourcemanager.applicationinsights.models.MyWorkbook; + +/** Samples for MyWorkbooks Update. */ +public final class MyWorkbooksUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookUpdate.json + */ + /** + * Sample code: WorkbookUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + MyWorkbook resource = + manager + .myWorkbooks() + .getByResourceGroupWithResponse( + "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE) + .getValue(); + resource + .update() + .withKind(Kind.USER) + .withDisplayName("Blah Blah Blah") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r" + + "\\n" + + "---\\r" + + "\\n" + + "\\r" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\r" + + "\\n" + + "\\r" + + "\\n" + + "\\r" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below each" + + " section to configure it or add more" + + " sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}") + .withVersion("ME") + .withCategory("workbook") + .withSourceId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens") + .apply(); + } +} +``` + +### ProactiveDetectionConfigurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProactiveDetectionConfigurations Get. */ +public final class ProactiveDetectionConfigurationsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationGet.json + */ + /** + * Sample code: ProactiveDetectionConfigurationGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void proactiveDetectionConfigurationGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .proactiveDetectionConfigurations() + .getWithResponse("my-resource-group", "my-component", "slowpageloadtime", Context.NONE); + } +} +``` + +### ProactiveDetectionConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ProactiveDetectionConfigurations List. */ +public final class ProactiveDetectionConfigurationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationsList.json + */ + /** + * Sample code: ProactiveDetectionConfigurationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void proactiveDetectionConfigurationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.proactiveDetectionConfigurations().listWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### ProactiveDetectionConfigurations_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentProactiveDetectionConfigurationInner; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; +import java.util.Arrays; + +/** Samples for ProactiveDetectionConfigurations Update. */ +public final class ProactiveDetectionConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationUpdate.json + */ + /** + * Sample code: ProactiveDetectionConfigurationUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void proactiveDetectionConfigurationUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .proactiveDetectionConfigurations() + .updateWithResponse( + "my-resource-group", + "my-component", + "slowpageloadtime", + new ApplicationInsightsComponentProactiveDetectionConfigurationInner() + .withName("slowpageloadtime") + .withEnabled(true) + .withSendEmailsToSubscriptionOwners(true) + .withCustomEmails(Arrays.asList("foo@microsoft.com", "foo2@microsoft.com")) + .withRuleDefinitions( + new ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions() + .withName("slowpageloadtime") + .withDisplayName("Slow page load time") + .withDescription("Smart Detection rules notify you of performance anomaly issues.") + .withHelpUrl( + "https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics") + .withIsHidden(false) + .withIsEnabledByDefault(true) + .withIsInPreview(false) + .withSupportsEmailNotifications(true)), + Context.NONE); + } +} +``` + +### WebTestLocations_List + +```java +import com.azure.core.util.Context; + +/** Samples for WebTestLocations List. */ +public final class WebTestLocationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestLocationsList.json + */ + /** + * Sample code: WebTestLocationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestLocationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTestLocations().list("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### WebTests_CreateOrUpdate + +```java +import com.azure.resourcemanager.applicationinsights.models.WebTestGeolocation; +import com.azure.resourcemanager.applicationinsights.models.WebTestKind; +import com.azure.resourcemanager.applicationinsights.models.WebTestPropertiesConfiguration; +import java.util.Arrays; + +/** Samples for WebTests CreateOrUpdate. */ +public final class WebTestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestCreate.json + */ + /** + * Sample code: webTestCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestCreate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .webTests() + .define("my-webtest-my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind(WebTestKind.PING) + .withSyntheticMonitorId("my-webtest-my-component") + .withWebTestName("my-webtest-my-component") + .withDescription("Ping web test alert for mytestwebapp") + .withEnabled(true) + .withFrequency(900) + .withTimeout(120) + .withWebTestKind(WebTestKind.PING) + .withRetryEnabled(true) + .withLocations(Arrays.asList(new WebTestGeolocation().withLocation("us-fl-mia-edge"))) + .withConfiguration( + new WebTestPropertiesConfiguration() + .withWebTest( + "")) + .create(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestUpdate.json + */ + /** + * Sample code: webTestUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestUpdate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .webTests() + .define("my-webtest-my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind(WebTestKind.PING) + .withSyntheticMonitorId("my-webtest-my-component") + .withWebTestName("my-webtest-my-component") + .withFrequency(600) + .withTimeout(30) + .withWebTestKind(WebTestKind.PING) + .withLocations( + Arrays + .asList( + new WebTestGeolocation().withLocation("us-fl-mia-edge"), + new WebTestGeolocation().withLocation("apac-hk-hkn-azr"))) + .withConfiguration( + new WebTestPropertiesConfiguration() + .withWebTest( + "")) + .create(); + } +} +``` + +### WebTests_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WebTests Delete. */ +public final class WebTestsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestDelete.json + */ + /** + * Sample code: webTestDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestDelete(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().deleteWithResponse("my-resource-group", "my-webtest-01-mywebservice", Context.NONE); + } +} +``` + +### WebTests_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for WebTests GetByResourceGroup. */ +public final class WebTestsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestGet.json + */ + /** + * Sample code: webTestGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .webTests() + .getByResourceGroupWithResponse("my-resource-group", "my-webtest-01-mywebservice", Context.NONE); + } +} +``` + +### WebTests_List + +```java +import com.azure.core.util.Context; + +/** Samples for WebTests List. */ +public final class WebTestsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestList.json + */ + /** + * Sample code: webTestList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().list(Context.NONE); + } +} +``` + +### WebTests_ListByComponent + +```java +import com.azure.core.util.Context; + +/** Samples for WebTests ListByComponent. */ +public final class WebTestsListByComponentSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByComponent.json + */ + /** + * Sample code: webTestListByComponent. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestListByComponent( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().listByComponent("my-component", "my-resource-group", Context.NONE); + } +} +``` + +### WebTests_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for WebTests ListByResourceGroup. */ +public final class WebTestsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByResourceGroup.json + */ + /** + * Sample code: webTestListByResourceGroup. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestListByResourceGroup( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().listByResourceGroup("my-resource-group", Context.NONE); + } +} +``` + +### WebTests_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WebTest; +import java.util.HashMap; +import java.util.Map; + +/** Samples for WebTests UpdateTags. */ +public final class WebTestsUpdateTagsSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestUpdateTagsOnly.json + */ + /** + * Sample code: webTestUpdateTags. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestUpdateTags( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + WebTest resource = + manager + .webTests() + .getByResourceGroupWithResponse("my-resource-group", "my-webtest-my-component", Context.NONE) + .getValue(); + resource + .update() + .withTags( + mapOf( + "Color", + "AzureBlue", + "CustomField-01", + "This is a random value", + "SystemType", + "A08", + "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component", + "Resource", + "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp", + "Resource")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### WorkItemConfigurations_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WorkItemCreateConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for WorkItemConfigurations Create. */ +public final class WorkItemConfigurationsCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigCreate.json + */ + /** + * Sample code: WorkItemConfigurationsCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .createWithResponse( + "my-resource-group", + "my-component", + new WorkItemCreateConfiguration() + .withConnectorId("d334e2a4-6733-488e-8645-a9fdc1694f41") + .withConnectorDataConfiguration( + "{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}") + .withValidateOnly(true) + .withWorkItemProperties(mapOf()), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### WorkItemConfigurations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations Delete. */ +public final class WorkItemConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDelete.json + */ + /** + * Sample code: WorkItemConfigurationDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .deleteWithResponse("my-resource-group", "my-component", "Visual Studio Team Services", Context.NONE); + } +} +``` + +### WorkItemConfigurations_GetDefault + +```java +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations GetDefault. */ +public final class WorkItemConfigurationsGetDefaultSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDefaultGet.json + */ + /** + * Sample code: WorkItemConfigurationsGetDefault. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsGetDefault( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workItemConfigurations().getDefaultWithResponse("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### WorkItemConfigurations_GetItem + +```java +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations GetItem. */ +public final class WorkItemConfigurationsGetItemSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigGet.json + */ + /** + * Sample code: WorkItemConfigurationsGetDefault. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsGetDefault( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .getItemWithResponse("my-resource-group", "my-component", "Visual Studio Team Services", Context.NONE); + } +} +``` + +### WorkItemConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations List. */ +public final class WorkItemConfigurationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigsGet.json + */ + /** + * Sample code: WorkItemConfigurationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workItemConfigurations().list("my-resource-group", "my-component", Context.NONE); + } +} +``` + +### WorkItemConfigurations_UpdateItem + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WorkItemCreateConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for WorkItemConfigurations UpdateItem. */ +public final class WorkItemConfigurationsUpdateItemSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigUpdate.json + */ + /** + * Sample code: WorkItemConfigurationsCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .updateItemWithResponse( + "my-resource-group", + "my-component", + "Visual Studio Team Services", + new WorkItemCreateConfiguration() + .withConnectorId("d334e2a4-6733-488e-8645-a9fdc1694f41") + .withConnectorDataConfiguration( + "{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}") + .withValidateOnly(true) + .withWorkItemProperties(mapOf()), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### WorkbookTemplates_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateGallery; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for WorkbookTemplates CreateOrUpdate. */ +public final class WorkbookTemplatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateAdd.json + */ + /** + * Sample code: WorkbookTemplateAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateAdd( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) throws IOException { + manager + .workbookTemplates() + .define("testtemplate2") + .withRegion("west us") + .withExistingResourceGroup("my-resource-group") + .withPriority(1) + .withAuthor("Contoso") + .withTemplateData( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json\",\"items\":[{\"name\":\"text" + + " - 2\",\"type\":1,\"content\":{\"json\":\"## New workbook\\n" + + "---\\n" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\n" + + "\\n" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below" + + " each section to configure it or add more sections.\"}},{\"name\":\"query -" + + " 2\",\"type\":3,\"content\":{\"exportToExcelOptions\":\"visible\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"queryType\":0,\"resourceType\":\"microsoft.operationalinsights/workspaces\",\"size\":1,\"version\":\"KqlItem/1.0\"}}],\"styleSettings\":{},\"version\":\"Notebook/1.0\"}", + Object.class, + SerializerEncoding.JSON)) + .withGalleries( + Arrays + .asList( + new WorkbookTemplateGallery() + .withName("Simple Template") + .withCategory("Failures") + .withType("tsg") + .withOrder(100) + .withResourceType("microsoft.insights/components"))) + .create(); + } +} +``` + +### WorkbookTemplates_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WorkbookTemplates Delete. */ +public final class WorkbookTemplatesDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateDelete.json + */ + /** + * Sample code: WorkbookTemplateDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbookTemplates().deleteWithResponse("my-resource-group", "my-template-resource", Context.NONE); + } +} +``` + +### WorkbookTemplates_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for WorkbookTemplates GetByResourceGroup. */ +public final class WorkbookTemplatesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateGet.json + */ + /** + * Sample code: WorkbookTemplateGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbookTemplates() + .getByResourceGroupWithResponse("my-resource-group", "my-resource-name", Context.NONE); + } +} +``` + +### WorkbookTemplates_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for WorkbookTemplates ListByResourceGroup. */ +public final class WorkbookTemplatesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplatesList.json + */ + /** + * Sample code: WorkbookTemplatesList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplatesList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbookTemplates().listByResourceGroup("my-resource-group", Context.NONE); + } +} +``` + +### WorkbookTemplates_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplate; + +/** Samples for WorkbookTemplates Update. */ +public final class WorkbookTemplatesUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateUpdate.json + */ + /** + * Sample code: WorkbookTemplateUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + WorkbookTemplate resource = + manager + .workbookTemplates() + .getByResourceGroupWithResponse("my-resource-group", "my-template-resource", Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Workbooks_CreateOrUpdate + +```java +import com.azure.resourcemanager.applicationinsights.models.Kind; +import com.azure.resourcemanager.applicationinsights.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.applicationinsights.models.UserAssignedIdentity; +import com.azure.resourcemanager.applicationinsights.models.WorkbookResourceIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Workbooks CreateOrUpdate. */ +public final class WorkbooksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookManagedAdd.json + */ + /** + * Sample code: WorkbookManagedAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookManagedAdd( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .define("deadb33f-5e0d-4064-8ebb-1a4ed0313eb2") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("hidden-title", "tttt")) + .withIdentity( + new WorkbookResourceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .withKind(Kind.SHARED) + .withEtag("\"4a00f78d-0000-0700-0000-5f8f616c1000\"") + .withDisplayName("tttt") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":{\"json\":\"test\"},\"name\":\"text -" + + " 0\"}],\"isLocked\":false,\"fallbackResourceIds\":[\"/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup\"]}") + .withVersion("Notebook/1.0") + .withCategory("workbook") + .withTagsPropertiesTags(Arrays.asList()) + .withStorageUri( + "/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/MyGroup/providers/Microsoft.Storage/storageAccounts/testStorage/blobServices/default/containers/testContainer") + .withDescription("Sample workbook") + .withSourceIdParameter("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/MyGroup") + .create(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookAdd.json + */ + /** + * Sample code: WorkbookAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookAdd(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .define("deadb33f-8bee-4d3b-a059-9be8dac93960") + .withRegion("west us") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("TagSample01", "sample01", "TagSample02", "sample02")) + .withKind(Kind.SHARED) + .withDisplayName("tttt") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r" + + "\\n" + + "---\\r" + + "\\n" + + "\\r" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\r" + + "\\n" + + "\\r" + + "\\n" + + "\\r" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below each" + + " section to configure it or add more" + + " sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}") + .withCategory("workbook") + .withDescription("Sample workbook") + .withSourceIdParameter("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/MyGroup") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Workbooks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Workbooks Delete. */ +public final class WorkbooksDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookDelete.json + */ + /** + * Sample code: WorkbookDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .deleteWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} +``` + +### Workbooks_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Workbooks GetByResourceGroup. */ +public final class WorkbooksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookGet1.json + */ + /** + * Sample code: WorkbookGet1. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookGet1(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookManagedGet.json + */ + /** + * Sample code: WorkbookManagedGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookManagedGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookGet.json + */ + /** + * Sample code: WorkbookGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} +``` + +### Workbooks_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for Workbooks List. */ +public final class WorkbooksListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksManagedList.json + */ + /** + * Sample code: WorkbooksManagedList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksManagedList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksListSub.json + */ + /** + * Sample code: WorkbooksListSub. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksListSub( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksList2.json + */ + /** + * Sample code: WorkbooksList2. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList2( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } +} +``` + +### Workbooks_ListByResourceGroup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for Workbooks ListByResourceGroup. */ +public final class WorkbooksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksList.json + */ + /** + * Sample code: WorkbooksList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .listByResourceGroup( + "my-resource-group", + CategoryType.WORKBOOK, + null, + "/subscriptions/ad2f1a83-caac-4e21-9d2a-9ca3f87105e2/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/MyTestApp-CodeLens1", + null, + Context.NONE); + } +} +``` + +### Workbooks_RevisionGet + +```java +import com.azure.core.util.Context; + +/** Samples for Workbooks RevisionGet. */ +public final class WorkbooksRevisionGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookRevisionGet.json + */ + /** + * Sample code: WorkbookRevisionGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookRevisionGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .revisionGetWithResponse( + "my-resource-group", + "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", + "1e2f8435b98248febee70c64ac22e1ab", + Context.NONE); + } +} +``` + +### Workbooks_RevisionsList + +```java +import com.azure.core.util.Context; + +/** Samples for Workbooks RevisionsList. */ +public final class WorkbooksRevisionsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookRevisionsList.json + */ + /** + * Sample code: WorkbookRevisionsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookRevisionsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().revisionsList("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} +``` + +### Workbooks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.Workbook; + +/** Samples for Workbooks Update. */ +public final class WorkbooksUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookUpdate.json + */ + /** + * Sample code: WorkbookUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + Workbook resource = + manager + .workbooks() + .getByResourceGroupWithResponse( + "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE) + .getValue(); + resource + .update() + .withSourceId( + "/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/MyTestApp-CodeLens1") + .apply(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookManagedUpdate.json + */ + /** + * Sample code: WorkbookManagedUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookManagedUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + Workbook resource = + manager + .workbooks() + .getByResourceGroupWithResponse( + "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE) + .getValue(); + resource + .update() + .withSourceId("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/MyGroup") + .apply(); + } +} +``` + diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml index 0c93bec865ab2..c85ca1a94956c 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml @@ -1,58 +1,81 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-applicationinsights - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-applicationinsights + 1.0.0-beta.2 + 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. - https://github.com/Azure/azure-sdk-for-java + 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-2021-11-01. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true false - - - - com.azure - azure-core - 1.23.1 - - - com.azure - azure-core-management - 1.4.4 - - + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-management + 1.4.4 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + 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..fb335a56f2b64 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 @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -28,16 +29,19 @@ 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; import com.azure.resourcemanager.applicationinsights.implementation.WebTestLocationsImpl; import com.azure.resourcemanager.applicationinsights.implementation.WebTestsImpl; import com.azure.resourcemanager.applicationinsights.implementation.WorkItemConfigurationsImpl; +import com.azure.resourcemanager.applicationinsights.implementation.WorkbookTemplatesImpl; import com.azure.resourcemanager.applicationinsights.implementation.WorkbooksImpl; import com.azure.resourcemanager.applicationinsights.models.AnalyticsItems; import com.azure.resourcemanager.applicationinsights.models.Annotations; @@ -45,26 +49,30 @@ 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; import com.azure.resourcemanager.applicationinsights.models.WebTestLocations; import com.azure.resourcemanager.applicationinsights.models.WebTests; import com.azure.resourcemanager.applicationinsights.models.WorkItemConfigurations; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplates; import com.azure.resourcemanager.applicationinsights.models.Workbooks; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** 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 +90,6 @@ public final class ApplicationInsightsManager { private ProactiveDetectionConfigurations proactiveDetectionConfigurations; - private Components components; - private WorkItemConfigurations workItemConfigurations; private Favorites favorites; @@ -92,11 +98,19 @@ public final class ApplicationInsightsManager { private WebTests webTests; + private AnalyticsItems analyticsItems; + + private WorkbookTemplates workbookTemplates; + private MyWorkbooks myWorkbooks; private Workbooks workbooks; - private Operations operations; + private Components components; + + private ComponentLinkedStorageAccountsOperations componentLinkedStorageAccountsOperations; + + private LiveTokens liveTokens; private final ApplicationInsightsManagementClient clientObject; @@ -141,6 +155,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -180,6 +195,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -222,7 +248,7 @@ public ApplicationInsightsManager authenticate(TokenCredential credential, Azure .append("-") .append("com.azure.resourcemanager.applicationinsights") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -236,20 +262,33 @@ public ApplicationInsightsManager authenticate(TokenCredential credential, Azure userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -261,12 +300,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 +376,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,6 +409,22 @@ public WebTests webTests() { return webTests; } + /** @return Resource collection API of AnalyticsItems. */ + public AnalyticsItems analyticsItems() { + if (this.analyticsItems == null) { + this.analyticsItems = new AnalyticsItemsImpl(clientObject.getAnalyticsItems(), this); + } + return analyticsItems; + } + + /** @return Resource collection API of WorkbookTemplates. */ + public WorkbookTemplates workbookTemplates() { + if (this.workbookTemplates == null) { + this.workbookTemplates = new WorkbookTemplatesImpl(clientObject.getWorkbookTemplates(), this); + } + return workbookTemplates; + } + /** @return Resource collection API of MyWorkbooks. */ public MyWorkbooks myWorkbooks() { if (this.myWorkbooks == null) { @@ -394,12 +441,30 @@ 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 Components. */ + public Components components() { + if (this.components == null) { + this.components = new ComponentsImpl(clientObject.getComponents(), this); } - return operations; + 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..5b4984d43ad4e 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. * @@ -135,6 +128,20 @@ public interface ApplicationInsightsManagementClient { */ WebTestsClient getWebTests(); + /** + * Gets the AnalyticsItemsClient object to access its operations. + * + * @return the AnalyticsItemsClient object. + */ + AnalyticsItemsClient getAnalyticsItems(); + + /** + * Gets the WorkbookTemplatesClient object to access its operations. + * + * @return the WorkbookTemplatesClient object. + */ + WorkbookTemplatesClient getWorkbookTemplates(); + /** * Gets the MyWorkbooksClient object to access its operations. * @@ -150,9 +157,23 @@ public interface ApplicationInsightsManagementClient { WorkbooksClient getWorkbooks(); /** - * Gets the OperationsClient object to access its operations. + * Gets the ComponentsClient object to access its operations. * - * @return the OperationsClient object. + * @return the ComponentsClient object. */ - OperationsClient getOperations(); + 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/OperationsClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/OperationsClient.java index cf11e5eb39881..c56a42ad2600d 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 @@ -17,7 +17,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,7 +29,7 @@ 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); diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbookTemplatesClient.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbookTemplatesClient.java new file mode 100644 index 0000000000000..b78ea25bcae81 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/WorkbookTemplatesClient.java @@ -0,0 +1,161 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookTemplateInner; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateUpdateParameters; + +/** An instance of this class provides access to all the operations defined in WorkbookTemplatesClient. */ +public interface WorkbookTemplatesClient { + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a single workbook template by its 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 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 template by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkbookTemplateInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Get a single workbook template by its 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 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 a single workbook template by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Delete a workbook template. + * + * @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.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); + + /** + * Delete a workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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.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, Context context); + + /** + * Create a new workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties Properties that need to be specified to create a new workbook. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkbookTemplateInner createOrUpdate( + String resourceGroupName, String resourceName, WorkbookTemplateInner workbookTemplateProperties); + + /** + * Create a new workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties 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.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 template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String resourceName, + WorkbookTemplateInner workbookTemplateProperties, + Context context); + + /** + * Updates a workbook template 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 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 template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkbookTemplateInner update(String resourceGroupName, String resourceName); + + /** + * Updates a workbook template 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 workbookTemplateUpdateParameters Properties that need to be specified to patch a workbook template. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String resourceName, + WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters, + 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..3770a22fdcd63 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 @@ -21,8 +21,8 @@ public interface WorkbooksClient { * * @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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -38,8 +38,8 @@ public interface WorkbooksClient { * 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -53,8 +53,8 @@ PagedIterable list( * @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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -72,8 +72,8 @@ PagedIterable list( * 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -92,8 +92,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +107,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +122,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +136,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +151,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -168,8 +168,8 @@ Response getByResourceGroupWithResponse( * @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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -187,8 +187,8 @@ 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. * @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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -204,8 +204,8 @@ Response createOrUpdateWithResponse( * @param workbookUpdateParameters 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -216,4 +216,65 @@ Response updateWithResponse( String sourceId, WorkbookUpdateParameters workbookUpdateParameters, Context context); + + /** + * Get the revisions for the workbook defined by its 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 com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the + * request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable revisionsList(String resourceGroupName, String resourceName); + + /** + * Get the revisions for the workbook defined by its 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the + * request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable revisionsList(String resourceGroupName, String resourceName, Context context); + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkbookInner revisionGet(String resourceGroupName, String resourceName, String revisionId); + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response revisionGetWithResponse( + String resourceGroupName, String resourceName, String revisionId, 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..f7cb867215a1c 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 @@ -5,13 +5,13 @@ package com.azure.resourcemanager.applicationinsights.fluent.models; 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.ApplicationType; import com.azure.resourcemanager.applicationinsights.models.ComponentsResource; 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; @@ -20,9 +20,8 @@ import java.util.Map; /** An Application Insights component definition. */ -@JsonFlatten @Fluent -public class ApplicationInsightsComponentInner extends ComponentsResource { +public final class ApplicationInsightsComponentInner extends ComponentsResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationInsightsComponentInner.class); /* @@ -34,126 +33,10 @@ public class ApplicationInsightsComponentInner extends ComponentsResource { private String kind; /* - * The unique ID of your application. This field mirrors the 'Name' field - * and cannot be changed. + * Properties that define an Application Insights component resource. */ - @JsonProperty(value = "properties.ApplicationId", access = JsonProperty.Access.WRITE_ONLY) - private String applicationId; - - /* - * Application Insights Unique ID for your Application. - */ - @JsonProperty(value = "properties.AppId", access = JsonProperty.Access.WRITE_ONLY) - private String appId; - - /* - * Type of application being monitored. - */ - @JsonProperty(value = "properties.Application_Type") - private ApplicationType applicationType; - - /* - * Used by the Application Insights system to determine what kind of flow - * this component was created by. This is to be set to 'Bluefield' when - * creating/updating a component via the REST API. - */ - @JsonProperty(value = "properties.Flow_Type") - private FlowType flowType; - - /* - * Describes what tool created this Application Insights component. - * Customers using this API should set this to the default 'rest'. - */ - @JsonProperty(value = "properties.Request_Source") - private RequestSource requestSource; - - /* - * Application Insights Instrumentation key. A read-only value that - * applications can use to identify the destination for all telemetry sent - * to Azure Application Insights. This value will be supplied upon - * construction of each new Application Insights component. - */ - @JsonProperty(value = "properties.InstrumentationKey", access = JsonProperty.Access.WRITE_ONLY) - private String instrumentationKey; - - /* - * Creation Date for the Application Insights component, in ISO 8601 - * format. - */ - @JsonProperty(value = "properties.CreationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /* - * Azure Tenant Id. - */ - @JsonProperty(value = "properties.TenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The unique application ID created when a new application is added to - * HockeyApp, used for communications with HockeyApp. - */ - @JsonProperty(value = "properties.HockeyAppId") - private String hockeyAppId; - - /* - * Token used to authenticate communications with between Application - * Insights and HockeyApp. - */ - @JsonProperty(value = "properties.HockeyAppToken", access = JsonProperty.Access.WRITE_ONLY) - private String hockeyAppToken; - - /* - * Current state of this component: whether or not is has been provisioned - * within the resource group it is defined. Users cannot change this value - * but are able to read from it. Values will include Succeeded, Deploying, - * Canceled, and Failed. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Percentage of the data produced by the application being monitored that - * is being sampled for Application Insights telemetry. - */ - @JsonProperty(value = "properties.SamplingPercentage") - private Double samplingPercentage; - - /* - * Application Insights component connection string. - */ - @JsonProperty(value = "properties.ConnectionString", access = JsonProperty.Access.WRITE_ONLY) - private String connectionString; - - /* - * Retention period in days. - */ - @JsonProperty(value = "properties.RetentionInDays") - private Integer retentionInDays; - - /* - * Disable IP masking. - */ - @JsonProperty(value = "properties.DisableIpMasking") - private Boolean disableIpMasking; - - /* - * Purge data immediately after 30 days. - */ - @JsonProperty(value = "properties.ImmediatePurgeDataOn30Days") - private Boolean immediatePurgeDataOn30Days; - - /* - * List of linked private link scope resources. - */ - @JsonProperty(value = "properties.PrivateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) - private List privateLinkScopedResources; - - /* - * Indicates the flow of the ingestion. - */ - @JsonProperty(value = "properties.IngestionMode") - private IngestionMode ingestionMode; + @JsonProperty(value = "properties") + private ApplicationInsightsComponentProperties innerProperties; /** * Get the kind property: The kind of application that this component refers to, used to customize UI. This value is @@ -177,6 +60,29 @@ public ApplicationInsightsComponentInner withKind(String kind) { return this; } + /** + * Get the innerProperties property: Properties that define an Application Insights component resource. + * + * @return the innerProperties value. + */ + private ApplicationInsightsComponentProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ApplicationInsightsComponentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationInsightsComponentInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the applicationId property: The unique ID of your application. This field mirrors the 'Name' field and cannot * be changed. @@ -184,7 +90,7 @@ public ApplicationInsightsComponentInner withKind(String kind) { * @return the applicationId value. */ public String applicationId() { - return this.applicationId; + return this.innerProperties() == null ? null : this.innerProperties().applicationId(); } /** @@ -193,7 +99,7 @@ public String applicationId() { * @return the appId value. */ public String appId() { - return this.appId; + return this.innerProperties() == null ? null : this.innerProperties().appId(); } /** @@ -202,7 +108,7 @@ public String appId() { * @return the applicationType value. */ public ApplicationType applicationType() { - return this.applicationType; + return this.innerProperties() == null ? null : this.innerProperties().applicationType(); } /** @@ -212,7 +118,10 @@ public ApplicationType applicationType() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withApplicationType(ApplicationType applicationType) { - this.applicationType = applicationType; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withApplicationType(applicationType); return this; } @@ -223,7 +132,7 @@ public ApplicationInsightsComponentInner withApplicationType(ApplicationType app * @return the flowType value. */ public FlowType flowType() { - return this.flowType; + return this.innerProperties() == null ? null : this.innerProperties().flowType(); } /** @@ -234,7 +143,10 @@ public FlowType flowType() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withFlowType(FlowType flowType) { - this.flowType = flowType; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withFlowType(flowType); return this; } @@ -245,7 +157,7 @@ public ApplicationInsightsComponentInner withFlowType(FlowType flowType) { * @return the requestSource value. */ public RequestSource requestSource() { - return this.requestSource; + return this.innerProperties() == null ? null : this.innerProperties().requestSource(); } /** @@ -256,7 +168,10 @@ public RequestSource requestSource() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withRequestSource(RequestSource requestSource) { - this.requestSource = requestSource; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withRequestSource(requestSource); return this; } @@ -268,7 +183,7 @@ public ApplicationInsightsComponentInner withRequestSource(RequestSource request * @return the instrumentationKey value. */ public String instrumentationKey() { - return this.instrumentationKey; + return this.innerProperties() == null ? null : this.innerProperties().instrumentationKey(); } /** @@ -277,7 +192,7 @@ public String instrumentationKey() { * @return the creationDate value. */ public OffsetDateTime creationDate() { - return this.creationDate; + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); } /** @@ -286,7 +201,7 @@ public OffsetDateTime creationDate() { * @return the tenantId value. */ public String tenantId() { - return this.tenantId; + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); } /** @@ -296,7 +211,7 @@ public String tenantId() { * @return the hockeyAppId value. */ public String hockeyAppId() { - return this.hockeyAppId; + return this.innerProperties() == null ? null : this.innerProperties().hockeyAppId(); } /** @@ -307,7 +222,10 @@ public String hockeyAppId() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withHockeyAppId(String hockeyAppId) { - this.hockeyAppId = hockeyAppId; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withHockeyAppId(hockeyAppId); return this; } @@ -318,7 +236,7 @@ public ApplicationInsightsComponentInner withHockeyAppId(String hockeyAppId) { * @return the hockeyAppToken value. */ public String hockeyAppToken() { - return this.hockeyAppToken; + return this.innerProperties() == null ? null : this.innerProperties().hockeyAppToken(); } /** @@ -329,7 +247,7 @@ public String hockeyAppToken() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -339,7 +257,7 @@ public String provisioningState() { * @return the samplingPercentage value. */ public Double samplingPercentage() { - return this.samplingPercentage; + return this.innerProperties() == null ? null : this.innerProperties().samplingPercentage(); } /** @@ -350,7 +268,10 @@ public Double samplingPercentage() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withSamplingPercentage(Double samplingPercentage) { - this.samplingPercentage = samplingPercentage; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withSamplingPercentage(samplingPercentage); return this; } @@ -360,7 +281,7 @@ public ApplicationInsightsComponentInner withSamplingPercentage(Double samplingP * @return the connectionString value. */ public String connectionString() { - return this.connectionString; + return this.innerProperties() == null ? null : this.innerProperties().connectionString(); } /** @@ -369,7 +290,7 @@ public String connectionString() { * @return the retentionInDays value. */ public Integer retentionInDays() { - return this.retentionInDays; + return this.innerProperties() == null ? null : this.innerProperties().retentionInDays(); } /** @@ -379,7 +300,10 @@ public Integer retentionInDays() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withRetentionInDays(retentionInDays); return this; } @@ -389,7 +313,7 @@ public ApplicationInsightsComponentInner withRetentionInDays(Integer retentionIn * @return the disableIpMasking value. */ public Boolean disableIpMasking() { - return this.disableIpMasking; + return this.innerProperties() == null ? null : this.innerProperties().disableIpMasking(); } /** @@ -399,7 +323,10 @@ public Boolean disableIpMasking() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withDisableIpMasking(Boolean disableIpMasking) { - this.disableIpMasking = disableIpMasking; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withDisableIpMasking(disableIpMasking); return this; } @@ -409,7 +336,7 @@ public ApplicationInsightsComponentInner withDisableIpMasking(Boolean disableIpM * @return the immediatePurgeDataOn30Days value. */ public Boolean immediatePurgeDataOn30Days() { - return this.immediatePurgeDataOn30Days; + return this.innerProperties() == null ? null : this.innerProperties().immediatePurgeDataOn30Days(); } /** @@ -419,7 +346,10 @@ public Boolean immediatePurgeDataOn30Days() { * @return the ApplicationInsightsComponentInner object itself. */ public ApplicationInsightsComponentInner withImmediatePurgeDataOn30Days(Boolean immediatePurgeDataOn30Days) { - this.immediatePurgeDataOn30Days = immediatePurgeDataOn30Days; + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withImmediatePurgeDataOn30Days(immediatePurgeDataOn30Days); return this; } @@ -429,40 +359,79 @@ public ApplicationInsightsComponentInner withImmediatePurgeDataOn30Days(Boolean * @return the privateLinkScopedResources value. */ public List privateLinkScopedResources() { - return this.privateLinkScopedResources; + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopedResources(); } /** - * Get the ingestionMode property: Indicates the flow of the ingestion. + * Get the publicNetworkAccessForIngestion property: The network access type for accessing Application Insights + * ingestion. * - * @return the ingestionMode value. + * @return the publicNetworkAccessForIngestion value. */ - public IngestionMode ingestionMode() { - return this.ingestionMode; + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccessForIngestion(); } /** - * Set the ingestionMode property: Indicates the flow of the ingestion. + * Set the publicNetworkAccessForIngestion property: The network access type for accessing Application Insights + * ingestion. * - * @param ingestionMode the ingestionMode value to set. + * @param publicNetworkAccessForIngestion the publicNetworkAccessForIngestion value to set. * @return the ApplicationInsightsComponentInner object itself. */ - public ApplicationInsightsComponentInner withIngestionMode(IngestionMode ingestionMode) { - this.ingestionMode = ingestionMode; + public ApplicationInsightsComponentInner withPublicNetworkAccessForIngestion( + PublicNetworkAccessType publicNetworkAccessForIngestion) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withPublicNetworkAccessForIngestion(publicNetworkAccessForIngestion); return this; } - /** {@inheritDoc} */ - @Override - public ApplicationInsightsComponentInner withLocation(String location) { - super.withLocation(location); + /** + * Get the publicNetworkAccessForQuery property: The network access type for accessing Application Insights query. + * + * @return the publicNetworkAccessForQuery value. + */ + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withPublicNetworkAccessForQuery(publicNetworkAccessForQuery); return this; } - /** {@inheritDoc} */ - @Override - public ApplicationInsightsComponentInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the ingestionMode property: Indicates the flow of the ingestion. + * + * @return the ingestionMode value. + */ + public IngestionMode ingestionMode() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionMode(); + } + + /** + * Set the ingestionMode property: Indicates the flow of the ingestion. + * + * @param ingestionMode the ingestionMode value to set. + * @return the ApplicationInsightsComponentInner object itself. + */ + public ApplicationInsightsComponentInner withIngestionMode(IngestionMode ingestionMode) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationInsightsComponentProperties(); + } + this.innerProperties().withIngestionMode(ingestionMode); return this; } @@ -480,8 +449,8 @@ public void validate() { new IllegalArgumentException( "Missing required property kind in model ApplicationInsightsComponentInner")); } - if (privateLinkScopedResources() != null) { - privateLinkScopedResources().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentProperties.java new file mode 100644 index 0000000000000..a2c31f62359db --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ApplicationInsightsComponentProperties.java @@ -0,0 +1,494 @@ +// 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.ApplicationType; +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; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties that define an Application Insights component resource. */ +@Fluent +public final class ApplicationInsightsComponentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationInsightsComponentProperties.class); + + /* + * The unique ID of your application. This field mirrors the 'Name' field + * and cannot be changed. + */ + @JsonProperty(value = "ApplicationId", access = JsonProperty.Access.WRITE_ONLY) + private String applicationId; + + /* + * Application Insights Unique ID for your Application. + */ + @JsonProperty(value = "AppId", access = JsonProperty.Access.WRITE_ONLY) + private String appId; + + /* + * Type of application being monitored. + */ + @JsonProperty(value = "Application_Type", required = true) + private ApplicationType applicationType; + + /* + * Used by the Application Insights system to determine what kind of flow + * this component was created by. This is to be set to 'Bluefield' when + * creating/updating a component via the REST API. + */ + @JsonProperty(value = "Flow_Type") + private FlowType flowType; + + /* + * Describes what tool created this Application Insights component. + * Customers using this API should set this to the default 'rest'. + */ + @JsonProperty(value = "Request_Source") + private RequestSource requestSource; + + /* + * Application Insights Instrumentation key. A read-only value that + * applications can use to identify the destination for all telemetry sent + * to Azure Application Insights. This value will be supplied upon + * construction of each new Application Insights component. + */ + @JsonProperty(value = "InstrumentationKey", access = JsonProperty.Access.WRITE_ONLY) + private String instrumentationKey; + + /* + * Creation Date for the Application Insights component, in ISO 8601 + * format. + */ + @JsonProperty(value = "CreationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Azure Tenant Id. + */ + @JsonProperty(value = "TenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The unique application ID created when a new application is added to + * HockeyApp, used for communications with HockeyApp. + */ + @JsonProperty(value = "HockeyAppId") + private String hockeyAppId; + + /* + * Token used to authenticate communications with between Application + * Insights and HockeyApp. + */ + @JsonProperty(value = "HockeyAppToken", access = JsonProperty.Access.WRITE_ONLY) + private String hockeyAppToken; + + /* + * Current state of this component: whether or not is has been provisioned + * within the resource group it is defined. Users cannot change this value + * but are able to read from it. Values will include Succeeded, Deploying, + * Canceled, and Failed. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Percentage of the data produced by the application being monitored that + * is being sampled for Application Insights telemetry. + */ + @JsonProperty(value = "SamplingPercentage") + private Double samplingPercentage; + + /* + * Application Insights component connection string. + */ + @JsonProperty(value = "ConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String connectionString; + + /* + * Retention period in days. + */ + @JsonProperty(value = "RetentionInDays") + private Integer retentionInDays; + + /* + * Disable IP masking. + */ + @JsonProperty(value = "DisableIpMasking") + private Boolean disableIpMasking; + + /* + * Purge data immediately after 30 days. + */ + @JsonProperty(value = "ImmediatePurgeDataOn30Days") + private Boolean immediatePurgeDataOn30Days; + + /* + * List of linked private link scope resources. + */ + @JsonProperty(value = "PrivateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) + private List privateLinkScopedResources; + + /* + * The network access type for accessing Application Insights ingestion. + */ + @JsonProperty(value = "publicNetworkAccessForIngestion") + private PublicNetworkAccessType publicNetworkAccessForIngestion; + + /* + * The network access type for accessing Application Insights query. + */ + @JsonProperty(value = "publicNetworkAccessForQuery") + private PublicNetworkAccessType publicNetworkAccessForQuery; + + /* + * Indicates the flow of the ingestion. + */ + @JsonProperty(value = "IngestionMode") + private IngestionMode ingestionMode; + + /** + * Get the applicationId property: The unique ID of your application. This field mirrors the 'Name' field and cannot + * be changed. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Get the appId property: Application Insights Unique ID for your Application. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Get the applicationType property: Type of application being monitored. + * + * @return the applicationType value. + */ + public ApplicationType applicationType() { + return this.applicationType; + } + + /** + * Set the applicationType property: Type of application being monitored. + * + * @param applicationType the applicationType value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withApplicationType(ApplicationType applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get the flowType property: Used by the Application Insights system to determine what kind of flow this component + * was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. + * + * @return the flowType value. + */ + public FlowType flowType() { + return this.flowType; + } + + /** + * Set the flowType property: Used by the Application Insights system to determine what kind of flow this component + * was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. + * + * @param flowType the flowType value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withFlowType(FlowType flowType) { + this.flowType = flowType; + return this; + } + + /** + * Get the requestSource property: Describes what tool created this Application Insights component. Customers using + * this API should set this to the default 'rest'. + * + * @return the requestSource value. + */ + public RequestSource requestSource() { + return this.requestSource; + } + + /** + * Set the requestSource property: Describes what tool created this Application Insights component. Customers using + * this API should set this to the default 'rest'. + * + * @param requestSource the requestSource value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withRequestSource(RequestSource requestSource) { + this.requestSource = requestSource; + return this; + } + + /** + * Get the instrumentationKey property: Application Insights Instrumentation key. A read-only value that + * applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value + * will be supplied upon construction of each new Application Insights component. + * + * @return the instrumentationKey value. + */ + public String instrumentationKey() { + return this.instrumentationKey; + } + + /** + * Get the creationDate property: Creation Date for the Application Insights component, in ISO 8601 format. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the tenantId property: Azure Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the hockeyAppId property: The unique application ID created when a new application is added to HockeyApp, + * used for communications with HockeyApp. + * + * @return the hockeyAppId value. + */ + public String hockeyAppId() { + return this.hockeyAppId; + } + + /** + * Set the hockeyAppId property: The unique application ID created when a new application is added to HockeyApp, + * used for communications with HockeyApp. + * + * @param hockeyAppId the hockeyAppId value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withHockeyAppId(String hockeyAppId) { + this.hockeyAppId = hockeyAppId; + return this; + } + + /** + * Get the hockeyAppToken property: Token used to authenticate communications with between Application Insights and + * HockeyApp. + * + * @return the hockeyAppToken value. + */ + public String hockeyAppToken() { + return this.hockeyAppToken; + } + + /** + * Get the provisioningState property: Current state of this component: whether or not is has been provisioned + * within the resource group it is defined. Users cannot change this value but are able to read from it. Values will + * include Succeeded, Deploying, Canceled, and Failed. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the samplingPercentage property: Percentage of the data produced by the application being monitored that is + * being sampled for Application Insights telemetry. + * + * @return the samplingPercentage value. + */ + public Double samplingPercentage() { + return this.samplingPercentage; + } + + /** + * Set the samplingPercentage property: Percentage of the data produced by the application being monitored that is + * being sampled for Application Insights telemetry. + * + * @param samplingPercentage the samplingPercentage value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withSamplingPercentage(Double samplingPercentage) { + this.samplingPercentage = samplingPercentage; + return this; + } + + /** + * Get the connectionString property: Application Insights component connection string. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Get the retentionInDays property: Retention period in days. + * + * @return the retentionInDays value. + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the retentionInDays property: Retention period in days. + * + * @param retentionInDays the retentionInDays value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + + /** + * Get the disableIpMasking property: Disable IP masking. + * + * @return the disableIpMasking value. + */ + public Boolean disableIpMasking() { + return this.disableIpMasking; + } + + /** + * Set the disableIpMasking property: Disable IP masking. + * + * @param disableIpMasking the disableIpMasking value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withDisableIpMasking(Boolean disableIpMasking) { + this.disableIpMasking = disableIpMasking; + return this; + } + + /** + * Get the immediatePurgeDataOn30Days property: Purge data immediately after 30 days. + * + * @return the immediatePurgeDataOn30Days value. + */ + public Boolean immediatePurgeDataOn30Days() { + return this.immediatePurgeDataOn30Days; + } + + /** + * Set the immediatePurgeDataOn30Days property: Purge data immediately after 30 days. + * + * @param immediatePurgeDataOn30Days the immediatePurgeDataOn30Days value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withImmediatePurgeDataOn30Days(Boolean immediatePurgeDataOn30Days) { + this.immediatePurgeDataOn30Days = immediatePurgeDataOn30Days; + return this; + } + + /** + * Get the privateLinkScopedResources property: List of linked private link scope resources. + * + * @return the privateLinkScopedResources value. + */ + 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 ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties 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 ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withPublicNetworkAccessForQuery( + PublicNetworkAccessType publicNetworkAccessForQuery) { + this.publicNetworkAccessForQuery = publicNetworkAccessForQuery; + return this; + } + + /** + * Get the ingestionMode property: Indicates the flow of the ingestion. + * + * @return the ingestionMode value. + */ + public IngestionMode ingestionMode() { + return this.ingestionMode; + } + + /** + * Set the ingestionMode property: Indicates the flow of the ingestion. + * + * @param ingestionMode the ingestionMode value to set. + * @return the ApplicationInsightsComponentProperties object itself. + */ + public ApplicationInsightsComponentProperties withIngestionMode(IngestionMode ingestionMode) { + this.ingestionMode = ingestionMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationType in model ApplicationInsightsComponentProperties")); + } + if (privateLinkScopedResources() != null) { + privateLinkScopedResources().forEach(e -> e.validate()); + } + } +} 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..3c03751128c10 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/ComponentLinkedStorageAccountsInner.java @@ -0,0 +1,66 @@ +// 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.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. */ +@Fluent +public final class ComponentLinkedStorageAccountsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentLinkedStorageAccountsInner.class); + + /* + * The properties of the linked storage accounts. + */ + @JsonProperty(value = "properties") + private LinkedStorageAccountsProperties innerProperties; + + /** + * Get the innerProperties property: The properties of the linked storage accounts. + * + * @return the innerProperties value. + */ + private LinkedStorageAccountsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the linkedStorageAccount property: Linked storage account resource ID. + * + * @return the linkedStorageAccount value. + */ + public String linkedStorageAccount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LinkedStorageAccountsProperties(); + } + this.innerProperties().withLinkedStorageAccount(linkedStorageAccount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LinkedStorageAccountsProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LinkedStorageAccountsProperties.java new file mode 100644 index 0000000000000..d5cbc7b4628fd --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LinkedStorageAccountsProperties.java @@ -0,0 +1,50 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Application Insights component linked storage account. */ +@Fluent +public final class LinkedStorageAccountsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedStorageAccountsProperties.class); + + /* + * Linked storage account resource ID + */ + @JsonProperty(value = "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 LinkedStorageAccountsProperties object itself. + */ + public LinkedStorageAccountsProperties 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/fluent/models/LiveTokenResponseInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LiveTokenResponseInner.java new file mode 100644 index 0000000000000..19d5a6f6a5312 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/LiveTokenResponseInner.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.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; + +/** The response to a live token query. */ +@Immutable +public final class LiveTokenResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveTokenResponseInner.class); + + /* + * JWT token for accessing live metrics stream data. + */ + @JsonProperty(value = "liveToken", access = JsonProperty.Access.WRITE_ONLY) + private String liveToken; + + /** + * Get the liveToken property: JWT token for accessing live metrics stream data. + * + * @return the liveToken value. + */ + public String liveToken() { + return this.liveToken; + } + + /** + * 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/fluent/models/MyWorkbookInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookInner.java index f475ac944cceb..067723284c9db 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 @@ -5,10 +5,10 @@ package com.azure.resourcemanager.applicationinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SystemData; 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.MyWorkbookManagedIdentity; import com.azure.resourcemanager.applicationinsights.models.MyWorkbookResource; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,9 +16,8 @@ import java.util.Map; /** An Application Insights private workbook definition. */ -@JsonFlatten @Fluent -public class MyWorkbookInner extends MyWorkbookResource { +public final class MyWorkbookInner extends MyWorkbookResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(MyWorkbookInner.class); /* @@ -28,62 +27,16 @@ public class MyWorkbookInner extends MyWorkbookResource { private Kind kind; /* - * The user-defined name of the private workbook. + * Metadata describing a workbook for an Azure resource. */ - @JsonProperty(value = "properties.displayName") - private String displayName; + @JsonProperty(value = "properties") + private MyWorkbookProperties innerProperties; /* - * Configuration of this particular private workbook. Configuration data is - * a string containing valid JSON + * Metadata pertaining to creation and last modification of the resource. */ - @JsonProperty(value = "properties.serializedData") - private String serializedData; - - /* - * This instance's version of the data model. This can change as new - * features are added that can be marked private workbook. - */ - @JsonProperty(value = "properties.version") - private String version; - - /* - * Date and time in UTC of the last modification that was made to this - * private workbook definition. - */ - @JsonProperty(value = "properties.timeModified", access = JsonProperty.Access.WRITE_ONLY) - private String timeModified; - - /* - * Workbook category, as defined by the user at creation time. - */ - @JsonProperty(value = "properties.category") - private String category; - - /* - * A list of 0 or more tags that are associated with this private workbook - * definition - */ - @JsonProperty(value = "properties.tags") - private List tagsPropertiesTags; - - /* - * Unique user id of the specific user that owns this private workbook. - */ - @JsonProperty(value = "properties.userId", access = JsonProperty.Access.WRITE_ONLY) - private String userId; - - /* - * Optional resourceId for a source resource. - */ - @JsonProperty(value = "properties.sourceId") - private String sourceId; - - /* - * BYOS Storage Account URI - */ - @JsonProperty(value = "properties.storageUri") - private String storageUri; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** * Get the kind property: The kind of workbook. Choices are user and shared. @@ -105,13 +58,80 @@ public MyWorkbookInner withKind(Kind kind) { return this; } + /** + * Get the innerProperties property: Metadata describing a workbook for an Azure resource. + * + * @return the innerProperties value. + */ + private MyWorkbookProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public MyWorkbookInner withIdentity(MyWorkbookManagedIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** {@inheritDoc} */ + @Override + public MyWorkbookInner withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public MyWorkbookInner withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MyWorkbookInner withType(String type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public MyWorkbookInner withEtag(Map etag) { + super.withEtag(etag); + return this; + } + + /** {@inheritDoc} */ + @Override + public MyWorkbookInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MyWorkbookInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the displayName property: The user-defined name of the private workbook. * * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -121,7 +141,10 @@ public String displayName() { * @return the MyWorkbookInner object itself. */ public MyWorkbookInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new MyWorkbookProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -132,7 +155,7 @@ public MyWorkbookInner withDisplayName(String displayName) { * @return the serializedData value. */ public String serializedData() { - return this.serializedData; + return this.innerProperties() == null ? null : this.innerProperties().serializedData(); } /** @@ -143,7 +166,10 @@ public String serializedData() { * @return the MyWorkbookInner object itself. */ public MyWorkbookInner withSerializedData(String serializedData) { - this.serializedData = serializedData; + if (this.innerProperties() == null) { + this.innerProperties = new MyWorkbookProperties(); + } + this.innerProperties().withSerializedData(serializedData); return this; } @@ -154,7 +180,7 @@ public MyWorkbookInner withSerializedData(String serializedData) { * @return the version value. */ public String version() { - return this.version; + return this.innerProperties() == null ? null : this.innerProperties().version(); } /** @@ -165,7 +191,10 @@ public String version() { * @return the MyWorkbookInner object itself. */ public MyWorkbookInner withVersion(String version) { - this.version = version; + if (this.innerProperties() == null) { + this.innerProperties = new MyWorkbookProperties(); + } + this.innerProperties().withVersion(version); return this; } @@ -176,7 +205,7 @@ public MyWorkbookInner withVersion(String version) { * @return the timeModified value. */ public String timeModified() { - return this.timeModified; + return this.innerProperties() == null ? null : this.innerProperties().timeModified(); } /** @@ -185,7 +214,7 @@ public String timeModified() { * @return the category value. */ public String category() { - return this.category; + return this.innerProperties() == null ? null : this.innerProperties().category(); } /** @@ -195,29 +224,33 @@ public String category() { * @return the MyWorkbookInner object itself. */ public MyWorkbookInner withCategory(String category) { - this.category = category; + if (this.innerProperties() == null) { + this.innerProperties = new MyWorkbookProperties(); + } + this.innerProperties().withCategory(category); return this; } /** - * Get the tagsPropertiesTags property: A list of 0 or more tags that are associated with this private workbook - * definition. + * Get the tags property: A list of 0 or more tags that are associated with this private workbook definition. * - * @return the tagsPropertiesTags value. + * @return the tags value. */ public List tagsPropertiesTags() { - return this.tagsPropertiesTags; + return this.innerProperties() == null ? null : this.innerProperties().tags(); } /** - * Set the tagsPropertiesTags property: A list of 0 or more tags that are associated with this private workbook - * definition. + * Set the tags property: A list of 0 or more tags that are associated with this private workbook definition. * - * @param tagsPropertiesTags the tagsPropertiesTags value to set. + * @param tags the tags value to set. * @return the MyWorkbookInner object itself. */ - public MyWorkbookInner withTagsPropertiesTags(List tagsPropertiesTags) { - this.tagsPropertiesTags = tagsPropertiesTags; + public MyWorkbookInner withTagsPropertiesTags(List tags) { + if (this.innerProperties() == null) { + this.innerProperties = new MyWorkbookProperties(); + } + this.innerProperties().withTags(tags); return this; } @@ -227,7 +260,7 @@ public MyWorkbookInner withTagsPropertiesTags(List tagsPropertiesTags) { * @return the userId value. */ public String userId() { - return this.userId; + return this.innerProperties() == null ? null : this.innerProperties().userId(); } /** @@ -236,7 +269,7 @@ public String userId() { * @return the sourceId value. */ public String sourceId() { - return this.sourceId; + return this.innerProperties() == null ? null : this.innerProperties().sourceId(); } /** @@ -246,7 +279,10 @@ public String sourceId() { * @return the MyWorkbookInner object itself. */ public MyWorkbookInner withSourceId(String sourceId) { - this.sourceId = sourceId; + if (this.innerProperties() == null) { + this.innerProperties = new MyWorkbookProperties(); + } + this.innerProperties().withSourceId(sourceId); return this; } @@ -256,7 +292,7 @@ public MyWorkbookInner withSourceId(String sourceId) { * @return the storageUri value. */ public String storageUri() { - return this.storageUri; + return this.innerProperties() == null ? null : this.innerProperties().storageUri(); } /** @@ -266,56 +302,10 @@ public String storageUri() { * @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) { - super.withId(id); - return this; - } - - /** {@inheritDoc} */ - @Override - public MyWorkbookInner withName(String name) { - super.withName(name); - return this; - } - - /** {@inheritDoc} */ - @Override - public MyWorkbookInner withType(String type) { - super.withType(type); - return this; - } - - /** {@inheritDoc} */ - @Override - public MyWorkbookInner withEtag(Map etag) { - super.withEtag(etag); - return this; - } - - /** {@inheritDoc} */ - @Override - public MyWorkbookInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public MyWorkbookInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new MyWorkbookProperties(); + } + this.innerProperties().withStorageUri(storageUri); return this; } @@ -327,5 +317,8 @@ public MyWorkbookInner withTags(Map tags) { @Override public void validate() { super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookProperties.java new file mode 100644 index 0000000000000..5b07673a01fc5 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/MyWorkbookProperties.java @@ -0,0 +1,263 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties that contain a private workbook. */ +@Fluent +public final class MyWorkbookProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MyWorkbookProperties.class); + + /* + * The user-defined name of the private workbook. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Configuration of this particular private workbook. Configuration data is + * a string containing valid JSON + */ + @JsonProperty(value = "serializedData", required = true) + private String serializedData; + + /* + * This instance's version of the data model. This can change as new + * features are added that can be marked private workbook. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Date and time in UTC of the last modification that was made to this + * private workbook definition. + */ + @JsonProperty(value = "timeModified", access = JsonProperty.Access.WRITE_ONLY) + private String timeModified; + + /* + * Workbook category, as defined by the user at creation time. + */ + @JsonProperty(value = "category", required = true) + private String category; + + /* + * A list of 0 or more tags that are associated with this private workbook + * definition + */ + @JsonProperty(value = "tags") + private List tags; + + /* + * Unique user id of the specific user that owns this private workbook. + */ + @JsonProperty(value = "userId", access = JsonProperty.Access.WRITE_ONLY) + private String userId; + + /* + * Optional resourceId for a source resource. + */ + @JsonProperty(value = "sourceId") + private String sourceId; + + /* + * BYOS Storage Account URI + */ + @JsonProperty(value = "storageUri") + private String storageUri; + + /** + * Get the displayName property: The user-defined name of the private workbook. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The user-defined name of the private workbook. + * + * @param displayName the displayName value to set. + * @return the MyWorkbookProperties object itself. + */ + public MyWorkbookProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the serializedData property: Configuration of this particular private 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 private workbook. Configuration data is a + * string containing valid JSON. + * + * @param serializedData the serializedData value to set. + * @return the MyWorkbookProperties object itself. + */ + public MyWorkbookProperties withSerializedData(String serializedData) { + this.serializedData = serializedData; + return this; + } + + /** + * Get the version property: This instance's version of the data model. This can change as new features are added + * that can be marked private workbook. + * + * @return the version value. + */ + public String version() { + return this.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 private workbook. + * + * @param version the version value to set. + * @return the MyWorkbookProperties object itself. + */ + public MyWorkbookProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the timeModified property: Date and time in UTC of the last modification that was made to this private + * workbook definition. + * + * @return the timeModified value. + */ + public String timeModified() { + return this.timeModified; + } + + /** + * 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 MyWorkbookProperties object itself. + */ + public MyWorkbookProperties withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the tags property: A list of 0 or more tags that are associated with this private workbook definition. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of 0 or more tags that are associated with this private workbook definition. + * + * @param tags the tags value to set. + * @return the MyWorkbookProperties object itself. + */ + public MyWorkbookProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the userId property: Unique user id of the specific user that owns this private workbook. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Get the sourceId property: Optional resourceId for a source resource. + * + * @return the sourceId value. + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set the sourceId property: Optional resourceId for a source resource. + * + * @param sourceId the sourceId value to set. + * @return the MyWorkbookProperties object itself. + */ + public MyWorkbookProperties 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. + * + * @param storageUri the storageUri value to set. + * @return the MyWorkbookProperties object itself. + */ + public MyWorkbookProperties withStorageUri(String storageUri) { + this.storageUri = storageUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model MyWorkbookProperties")); + } + if (serializedData() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serializedData in model MyWorkbookProperties")); + } + if (category() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property category in model MyWorkbookProperties")); + } + } +} 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/WebTestInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WebTestInner.java index 46f91d3baadc8..4c466545f0fa7 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WebTestInner.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WebTestInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.applicationinsights.fluent.models; 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.WebTestGeolocation; import com.azure.resourcemanager.applicationinsights.models.WebTestKind; @@ -17,9 +16,8 @@ import java.util.Map; /** An Application Insights web test definition. */ -@JsonFlatten @Fluent -public class WebTestInner extends WebtestsResource { +public final class WebTestInner extends WebtestsResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(WebTestInner.class); /* @@ -30,76 +28,10 @@ public class WebTestInner extends WebtestsResource { private WebTestKind kind; /* - * Unique ID of this WebTest. This is typically the same value as the Name - * field. - */ - @JsonProperty(value = "properties.SyntheticMonitorId") - private String syntheticMonitorId; - - /* - * User defined name if this WebTest. - */ - @JsonProperty(value = "properties.Name") - private String webTestName; - - /* - * Purpose/user defined descriptive test for this WebTest. - */ - @JsonProperty(value = "properties.Description") - private String description; - - /* - * Is the test actively being monitored. - */ - @JsonProperty(value = "properties.Enabled") - private Boolean enabled; - - /* - * Interval in seconds between test runs for this WebTest. Default value is - * 300. - */ - @JsonProperty(value = "properties.Frequency") - private Integer frequency; - - /* - * Seconds until this WebTest will timeout and fail. Default value is 30. - */ - @JsonProperty(value = "properties.Timeout") - private Integer timeout; - - /* - * The kind of web test this is, valid choices are ping and multistep. + * Metadata describing a web test for an Azure resource. */ - @JsonProperty(value = "properties.Kind") - private WebTestKind webTestKind; - - /* - * Allow for retries should this WebTest fail. - */ - @JsonProperty(value = "properties.RetryEnabled") - private Boolean retryEnabled; - - /* - * A list of where to physically run the tests from to give global coverage - * for accessibility of your application. - */ - @JsonProperty(value = "properties.Locations") - private List locations; - - /* - * An XML configuration specification for a WebTest. - */ - @JsonProperty(value = "properties.Configuration") - private WebTestPropertiesConfiguration configuration; - - /* - * Current state of this component, whether or not is has been provisioned - * within the resource group it is defined. Users cannot change this value - * but are able to read from it. Values will include Succeeded, Deploying, - * Canceled, and Failed. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + @JsonProperty(value = "properties") + private WebTestProperties innerProperties; /** * Get the kind property: The kind of web test that this web test watches. Choices are ping and multistep. @@ -121,6 +53,29 @@ public WebTestInner withKind(WebTestKind kind) { return this; } + /** + * Get the innerProperties property: Metadata describing a web test for an Azure resource. + * + * @return the innerProperties value. + */ + private WebTestProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public WebTestInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WebTestInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the syntheticMonitorId property: Unique ID of this WebTest. This is typically the same value as the Name * field. @@ -128,7 +83,7 @@ public WebTestInner withKind(WebTestKind kind) { * @return the syntheticMonitorId value. */ public String syntheticMonitorId() { - return this.syntheticMonitorId; + return this.innerProperties() == null ? null : this.innerProperties().syntheticMonitorId(); } /** @@ -139,7 +94,10 @@ public String syntheticMonitorId() { * @return the WebTestInner object itself. */ public WebTestInner withSyntheticMonitorId(String syntheticMonitorId) { - this.syntheticMonitorId = syntheticMonitorId; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withSyntheticMonitorId(syntheticMonitorId); return this; } @@ -149,7 +107,7 @@ public WebTestInner withSyntheticMonitorId(String syntheticMonitorId) { * @return the webTestName value. */ public String webTestName() { - return this.webTestName; + return this.innerProperties() == null ? null : this.innerProperties().webTestName(); } /** @@ -159,7 +117,10 @@ public String webTestName() { * @return the WebTestInner object itself. */ public WebTestInner withWebTestName(String webTestName) { - this.webTestName = webTestName; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withWebTestName(webTestName); return this; } @@ -169,7 +130,7 @@ public WebTestInner withWebTestName(String webTestName) { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -179,7 +140,10 @@ public String description() { * @return the WebTestInner object itself. */ public WebTestInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -189,7 +153,7 @@ public WebTestInner withDescription(String description) { * @return the enabled value. */ public Boolean enabled() { - return this.enabled; + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** @@ -199,7 +163,10 @@ public Boolean enabled() { * @return the WebTestInner object itself. */ public WebTestInner withEnabled(Boolean enabled) { - this.enabled = enabled; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withEnabled(enabled); return this; } @@ -209,7 +176,7 @@ public WebTestInner withEnabled(Boolean enabled) { * @return the frequency value. */ public Integer frequency() { - return this.frequency; + return this.innerProperties() == null ? null : this.innerProperties().frequency(); } /** @@ -219,7 +186,10 @@ public Integer frequency() { * @return the WebTestInner object itself. */ public WebTestInner withFrequency(Integer frequency) { - this.frequency = frequency; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withFrequency(frequency); return this; } @@ -229,7 +199,7 @@ public WebTestInner withFrequency(Integer frequency) { * @return the timeout value. */ public Integer timeout() { - return this.timeout; + return this.innerProperties() == null ? null : this.innerProperties().timeout(); } /** @@ -239,7 +209,10 @@ public Integer timeout() { * @return the WebTestInner object itself. */ public WebTestInner withTimeout(Integer timeout) { - this.timeout = timeout; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withTimeout(timeout); return this; } @@ -249,7 +222,7 @@ public WebTestInner withTimeout(Integer timeout) { * @return the webTestKind value. */ public WebTestKind webTestKind() { - return this.webTestKind; + return this.innerProperties() == null ? null : this.innerProperties().webTestKind(); } /** @@ -259,7 +232,10 @@ public WebTestKind webTestKind() { * @return the WebTestInner object itself. */ public WebTestInner withWebTestKind(WebTestKind webTestKind) { - this.webTestKind = webTestKind; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withWebTestKind(webTestKind); return this; } @@ -269,7 +245,7 @@ public WebTestInner withWebTestKind(WebTestKind webTestKind) { * @return the retryEnabled value. */ public Boolean retryEnabled() { - return this.retryEnabled; + return this.innerProperties() == null ? null : this.innerProperties().retryEnabled(); } /** @@ -279,7 +255,10 @@ public Boolean retryEnabled() { * @return the WebTestInner object itself. */ public WebTestInner withRetryEnabled(Boolean retryEnabled) { - this.retryEnabled = retryEnabled; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withRetryEnabled(retryEnabled); return this; } @@ -290,7 +269,7 @@ public WebTestInner withRetryEnabled(Boolean retryEnabled) { * @return the locations value. */ public List locations() { - return this.locations; + return this.innerProperties() == null ? null : this.innerProperties().locations(); } /** @@ -301,7 +280,10 @@ public List locations() { * @return the WebTestInner object itself. */ public WebTestInner withLocations(List locations) { - this.locations = locations; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withLocations(locations); return this; } @@ -311,7 +293,7 @@ public WebTestInner withLocations(List locations) { * @return the configuration value. */ public WebTestPropertiesConfiguration configuration() { - return this.configuration; + return this.innerProperties() == null ? null : this.innerProperties().configuration(); } /** @@ -321,7 +303,10 @@ public WebTestPropertiesConfiguration configuration() { * @return the WebTestInner object itself. */ public WebTestInner withConfiguration(WebTestPropertiesConfiguration configuration) { - this.configuration = configuration; + if (this.innerProperties() == null) { + this.innerProperties = new WebTestProperties(); + } + this.innerProperties().withConfiguration(configuration); return this; } @@ -333,21 +318,7 @@ public WebTestInner withConfiguration(WebTestPropertiesConfiguration configurati * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public WebTestInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public WebTestInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -358,11 +329,8 @@ public WebTestInner withTags(Map tags) { @Override public void validate() { super.validate(); - if (locations() != null) { - locations().forEach(e -> e.validate()); - } - if (configuration() != null) { - configuration().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WebTestProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WebTestProperties.java new file mode 100644 index 0000000000000..24830c518cf8c --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WebTestProperties.java @@ -0,0 +1,341 @@ +// 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.WebTestGeolocation; +import com.azure.resourcemanager.applicationinsights.models.WebTestKind; +import com.azure.resourcemanager.applicationinsights.models.WebTestPropertiesConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metadata describing a web test for an Azure resource. */ +@Fluent +public final class WebTestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebTestProperties.class); + + /* + * Unique ID of this WebTest. This is typically the same value as the Name + * field. + */ + @JsonProperty(value = "SyntheticMonitorId", required = true) + private String syntheticMonitorId; + + /* + * User defined name if this WebTest. + */ + @JsonProperty(value = "Name", required = true) + private String webTestName; + + /* + * Purpose/user defined descriptive test for this WebTest. + */ + @JsonProperty(value = "Description") + private String description; + + /* + * Is the test actively being monitored. + */ + @JsonProperty(value = "Enabled") + private Boolean enabled; + + /* + * Interval in seconds between test runs for this WebTest. Default value is + * 300. + */ + @JsonProperty(value = "Frequency") + private Integer frequency; + + /* + * Seconds until this WebTest will timeout and fail. Default value is 30. + */ + @JsonProperty(value = "Timeout") + private Integer timeout; + + /* + * The kind of web test this is, valid choices are ping and multistep. + */ + @JsonProperty(value = "Kind", required = true) + private WebTestKind webTestKind; + + /* + * Allow for retries should this WebTest fail. + */ + @JsonProperty(value = "RetryEnabled") + private Boolean retryEnabled; + + /* + * A list of where to physically run the tests from to give global coverage + * for accessibility of your application. + */ + @JsonProperty(value = "Locations", required = true) + private List locations; + + /* + * An XML configuration specification for a WebTest. + */ + @JsonProperty(value = "Configuration") + private WebTestPropertiesConfiguration configuration; + + /* + * Current state of this component, whether or not is has been provisioned + * within the resource group it is defined. Users cannot change this value + * but are able to read from it. Values will include Succeeded, Deploying, + * Canceled, and Failed. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the syntheticMonitorId property: Unique ID of this WebTest. This is typically the same value as the Name + * field. + * + * @return the syntheticMonitorId value. + */ + public String syntheticMonitorId() { + return this.syntheticMonitorId; + } + + /** + * Set the syntheticMonitorId property: Unique ID of this WebTest. This is typically the same value as the Name + * field. + * + * @param syntheticMonitorId the syntheticMonitorId value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withSyntheticMonitorId(String syntheticMonitorId) { + this.syntheticMonitorId = syntheticMonitorId; + return this; + } + + /** + * Get the webTestName property: User defined name if this WebTest. + * + * @return the webTestName value. + */ + public String webTestName() { + return this.webTestName; + } + + /** + * Set the webTestName property: User defined name if this WebTest. + * + * @param webTestName the webTestName value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withWebTestName(String webTestName) { + this.webTestName = webTestName; + return this; + } + + /** + * Get the description property: Purpose/user defined descriptive test for this WebTest. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Purpose/user defined descriptive test for this WebTest. + * + * @param description the description value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the enabled property: Is the test actively being monitored. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Is the test actively being monitored. + * + * @param enabled the enabled value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the frequency property: Interval in seconds between test runs for this WebTest. Default value is 300. + * + * @return the frequency value. + */ + public Integer frequency() { + return this.frequency; + } + + /** + * Set the frequency property: Interval in seconds between test runs for this WebTest. Default value is 300. + * + * @param frequency the frequency value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withFrequency(Integer frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get the timeout property: Seconds until this WebTest will timeout and fail. Default value is 30. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Seconds until this WebTest will timeout and fail. Default value is 30. + * + * @param timeout the timeout value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the webTestKind property: The kind of web test this is, valid choices are ping and multistep. + * + * @return the webTestKind value. + */ + public WebTestKind webTestKind() { + return this.webTestKind; + } + + /** + * Set the webTestKind property: The kind of web test this is, valid choices are ping and multistep. + * + * @param webTestKind the webTestKind value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withWebTestKind(WebTestKind webTestKind) { + this.webTestKind = webTestKind; + return this; + } + + /** + * Get the retryEnabled property: Allow for retries should this WebTest fail. + * + * @return the retryEnabled value. + */ + public Boolean retryEnabled() { + return this.retryEnabled; + } + + /** + * Set the retryEnabled property: Allow for retries should this WebTest fail. + * + * @param retryEnabled the retryEnabled value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withRetryEnabled(Boolean retryEnabled) { + this.retryEnabled = retryEnabled; + return this; + } + + /** + * Get the locations property: A list of where to physically run the tests from to give global coverage for + * accessibility of your application. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: A list of where to physically run the tests from to give global coverage for + * accessibility of your application. + * + * @param locations the locations value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the configuration property: An XML configuration specification for a WebTest. + * + * @return the configuration value. + */ + public WebTestPropertiesConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: An XML configuration specification for a WebTest. + * + * @param configuration the configuration value to set. + * @return the WebTestProperties object itself. + */ + public WebTestProperties withConfiguration(WebTestPropertiesConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the provisioningState property: Current state of this component, whether or not is has been provisioned + * within the resource group it is defined. Users cannot change this value but are able to read from it. Values will + * include Succeeded, Deploying, Canceled, and Failed. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (syntheticMonitorId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property syntheticMonitorId in model WebTestProperties")); + } + if (webTestName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property webTestName in model WebTestProperties")); + } + if (webTestKind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property webTestKind in model WebTestProperties")); + } + if (locations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property locations in model WebTestProperties")); + } else { + locations().forEach(e -> e.validate()); + } + if (configuration() != null) { + configuration().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..3026a123f9af8 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 @@ -5,132 +5,84 @@ package com.azure.resourcemanager.applicationinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; 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.WorkbookResource; +import com.azure.resourcemanager.applicationinsights.models.WorkbookResourceIdentity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; /** An Application Insights workbook definition. */ -@JsonFlatten @Fluent -public class WorkbookInner extends Resource { +public final class WorkbookInner extends WorkbookResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookInner.class); /* - * The kind of workbook. Choices are user and shared. + * Metadata describing a workbook for an Azure resource. */ - @JsonProperty(value = "kind") - private Kind kind; + @JsonProperty(value = "properties") + private WorkbookProperties innerProperties; /* - * The user-defined name (display name) of the workbook. + * Metadata pertaining to creation and last modification of the resource. */ - @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 version - */ - @JsonProperty(value = "properties.version") - private String version; - - /* - * Date and time in UTC of the last modification that was made to this - * workbook definition. - */ - @JsonProperty(value = "properties.timeModified", access = JsonProperty.Access.WRITE_ONLY) - private String timeModified; - - /* - * Workbook category, as defined by the user at creation time. - */ - @JsonProperty(value = "properties.category") - private String category; - - /* - * A list of 0 or more tags that are associated with this workbook - * definition - */ - @JsonProperty(value = "properties.tags") - private List tagsPropertiesTags; - - /* - * Unique user id of the specific user that owns this workbook. - */ - @JsonProperty(value = "properties.userId", access = JsonProperty.Access.WRITE_ONLY) - 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 - */ - @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 = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the kind property: The kind of workbook. Choices are user and shared. + * Get the innerProperties property: Metadata describing a workbook for an Azure resource. * - * @return the kind value. + * @return the innerProperties value. */ - public Kind kind() { - return this.kind; + private WorkbookProperties innerProperties() { + return this.innerProperties; } /** - * Set the kind property: The kind of workbook. Choices are user and shared. + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @param kind the kind value to set. - * @return the WorkbookInner object itself. + * @return the systemData value. */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public WorkbookInner withIdentity(WorkbookResourceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** {@inheritDoc} */ + @Override public WorkbookInner withKind(Kind kind) { - this.kind = kind; + super.withKind(kind); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkbookInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkbookInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkbookInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -140,7 +92,7 @@ public WorkbookInner withKind(Kind kind) { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -150,7 +102,10 @@ public String displayName() { * @return the WorkbookInner object itself. */ public WorkbookInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -161,7 +116,7 @@ public WorkbookInner withDisplayName(String displayName) { * @return the serializedData value. */ public String serializedData() { - return this.serializedData; + return this.innerProperties() == null ? null : this.innerProperties().serializedData(); } /** @@ -172,27 +127,35 @@ public String serializedData() { * @return the WorkbookInner object itself. */ public WorkbookInner withSerializedData(String serializedData) { - this.serializedData = serializedData; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withSerializedData(serializedData); return this; } /** - * Get the version property: Workbook version. + * Get the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in + * serializedData. * * @return the version value. */ public String version() { - return this.version; + return this.innerProperties() == null ? null : this.innerProperties().version(); } /** - * Set the version property: Workbook version. + * Set the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in + * serializedData. * * @param version the version value to set. * @return the WorkbookInner object itself. */ public WorkbookInner withVersion(String version) { - this.version = version; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withVersion(version); return this; } @@ -202,8 +165,8 @@ public WorkbookInner withVersion(String version) { * * @return the timeModified value. */ - public String timeModified() { - return this.timeModified; + public OffsetDateTime timeModified() { + return this.innerProperties() == null ? null : this.innerProperties().timeModified(); } /** @@ -212,7 +175,7 @@ public String timeModified() { * @return the category value. */ public String category() { - return this.category; + return this.innerProperties() == null ? null : this.innerProperties().category(); } /** @@ -222,27 +185,33 @@ public String category() { * @return the WorkbookInner object itself. */ public WorkbookInner withCategory(String category) { - this.category = category; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withCategory(category); return this; } /** - * Get the tagsPropertiesTags property: A list of 0 or more tags that are associated with this workbook definition. + * Get the tags property: Being deprecated, please use the other tags field. * - * @return the tagsPropertiesTags value. + * @return the tags value. */ public List tagsPropertiesTags() { - return this.tagsPropertiesTags; + return this.innerProperties() == null ? null : this.innerProperties().tags(); } /** - * Set the tagsPropertiesTags property: A list of 0 or more tags that are associated with this workbook definition. + * Set the tags property: Being deprecated, please use the other tags field. * - * @param tagsPropertiesTags the tagsPropertiesTags value to set. + * @param tags the tags value to set. * @return the WorkbookInner object itself. */ - public WorkbookInner withTagsPropertiesTags(List tagsPropertiesTags) { - this.tagsPropertiesTags = tagsPropertiesTags; + public WorkbookInner withTagsPropertiesTags(List tags) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withTags(tags); return this; } @@ -252,7 +221,7 @@ public WorkbookInner withTagsPropertiesTags(List tagsPropertiesTags) { * @return the userId value. */ public String userId() { - return this.userId; + return this.innerProperties() == null ? null : this.innerProperties().userId(); } /** @@ -261,7 +230,7 @@ public String userId() { * @return the sourceId value. */ public String sourceId() { - return this.sourceId; + return this.innerProperties() == null ? null : this.innerProperties().sourceId(); } /** @@ -271,142 +240,66 @@ public String sourceId() { * @return the WorkbookInner object itself. */ public WorkbookInner withSourceId(String sourceId) { - this.sourceId = sourceId; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withSourceId(sourceId); return this; } /** - * Get the storageUri property: BYOS Storage Account URI. + * Get the storageUri property: The resourceId to the storage account when bring your own storage is used. * * @return the storageUri value. */ public String storageUri() { - return this.storageUri; + return this.innerProperties() == null ? null : this.innerProperties().storageUri(); } /** - * Set the storageUri property: BYOS Storage Account URI. + * Set the storageUri property: The resourceId to the storage account when bring your own storage is used. * * @param storageUri the storageUri value to set. * @return the WorkbookInner object itself. */ public WorkbookInner withStorageUri(String storageUri) { - this.storageUri = storageUri; - return this; - } - - /** - * Get the identity property: Identity used for BYOS. - * - * @return the identity value. - */ - public ManagedIdentityAutoGenerated identity() { - return this.identity; - } - - /** - * Set the identity property: Identity used for BYOS. - * - * @param identity the identity 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; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withStorageUri(storageUri); return this; } /** - * Get the name property: Azure resource name. + * Get the description property: The description of the workbook. * - * @return the name value. + * @return the description value. */ - public String name() { - return this.name; + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** - * Set the name property: Azure resource name. + * Set the description property: The description of the workbook. * - * @param name the name value to set. + * @param description the description value to set. * @return the WorkbookInner object itself. */ - public WorkbookInner withName(String name) { - this.name = name; + public WorkbookInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookProperties(); + } + this.innerProperties().withDescription(description); return this; } /** - * Get the type property: Azure resource type. + * Get the revision property: The unique revision id for this workbook definition. * - * @return the type value. + * @return the revision 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; - return this; - } - - /** {@inheritDoc} */ - @Override - public WorkbookInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public WorkbookInner withTags(Map tags) { - super.withTags(tags); - return this; + public String revision() { + return this.innerProperties() == null ? null : this.innerProperties().revision(); } /** @@ -414,9 +307,11 @@ 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(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookProperties.java new file mode 100644 index 0000000000000..85aa81e35ba8f --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookProperties.java @@ -0,0 +1,304 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties that contain a workbook. */ +@Fluent +public final class WorkbookProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookProperties.class); + + /* + * The user-defined name (display name) of the workbook. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Configuration of this particular workbook. Configuration data is a + * string containing valid JSON + */ + @JsonProperty(value = "serializedData", required = true) + private String serializedData; + + /* + * Workbook schema version format, like 'Notebook/1.0', which should match + * the workbook in serializedData + */ + @JsonProperty(value = "version") + private String version; + + /* + * Date and time in UTC of the last modification that was made to this + * workbook definition. + */ + @JsonProperty(value = "timeModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeModified; + + /* + * Workbook category, as defined by the user at creation time. + */ + @JsonProperty(value = "category", required = true) + private String category; + + /* + * Being deprecated, please use the other tags field + */ + @JsonProperty(value = "tags") + private List tags; + + /* + * Unique user id of the specific user that owns this workbook. + */ + @JsonProperty(value = "userId", access = JsonProperty.Access.WRITE_ONLY) + private String userId; + + /* + * ResourceId for a source resource. + */ + @JsonProperty(value = "sourceId") + private String sourceId; + + /* + * The resourceId to the storage account when bring your own storage is + * used + */ + @JsonProperty(value = "storageUri") + private String storageUri; + + /* + * The description of the workbook. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The unique revision id for this workbook definition + */ + @JsonProperty(value = "revision", access = JsonProperty.Access.WRITE_ONLY) + private String revision; + + /** + * 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 WorkbookProperties object itself. + */ + public WorkbookProperties 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 WorkbookProperties object itself. + */ + public WorkbookProperties withSerializedData(String serializedData) { + this.serializedData = serializedData; + return this; + } + + /** + * Get the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in + * serializedData. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook in + * serializedData. + * + * @param version the version value to set. + * @return the WorkbookProperties object itself. + */ + public WorkbookProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the timeModified property: Date and time in UTC of the last modification that was made to this workbook + * definition. + * + * @return the timeModified value. + */ + public OffsetDateTime timeModified() { + return this.timeModified; + } + + /** + * 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 WorkbookProperties object itself. + */ + public WorkbookProperties withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the tags property: Being deprecated, please use the other tags field. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Being deprecated, please use the other tags field. + * + * @param tags the tags value to set. + * @return the WorkbookProperties object itself. + */ + public WorkbookProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the userId property: Unique user id of the specific user that owns this workbook. + * + * @return the userId value. + */ + public String userId() { + return this.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 WorkbookProperties object itself. + */ + public WorkbookProperties withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get the storageUri property: The resourceId to the storage account when bring your own storage is used. + * + * @return the storageUri value. + */ + public String storageUri() { + return this.storageUri; + } + + /** + * Set the storageUri property: The resourceId to the storage account when bring your own storage is used. + * + * @param storageUri the storageUri value to set. + * @return the WorkbookProperties object itself. + */ + public WorkbookProperties withStorageUri(String storageUri) { + this.storageUri = storageUri; + return this; + } + + /** + * Get the description property: The description of the workbook. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the workbook. + * + * @param description the description value to set. + * @return the WorkbookProperties object itself. + */ + public WorkbookProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the revision property: The unique revision id for this workbook definition. + * + * @return the revision value. + */ + public String revision() { + return this.revision; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property displayName in model WorkbookProperties")); + } + if (serializedData() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serializedData in model WorkbookProperties")); + } + if (category() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property category in model WorkbookProperties")); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookPropertiesUpdateParameters.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..6ca2ca99a0f3d --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookPropertiesUpdateParameters.java @@ -0,0 +1,185 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties that contain a workbook for PATCH operation. */ +@Fluent +public final class WorkbookPropertiesUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookPropertiesUpdateParameters.class); + + /* + * The user-defined name (display name) of the workbook. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Configuration of this particular workbook. Configuration data is a + * string containing valid JSON + */ + @JsonProperty(value = "serializedData") + private String serializedData; + + /* + * Workbook category, as defined by the user at creation time. + */ + @JsonProperty(value = "category") + private String category; + + /* + * A list of 0 or more tags that are associated with this workbook + * definition + */ + @JsonProperty(value = "tags") + private List tags; + + /* + * The description of the workbook. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The unique revision id for this workbook definition + */ + @JsonProperty(value = "revision") + private String revision; + + /** + * 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 WorkbookPropertiesUpdateParameters object itself. + */ + public WorkbookPropertiesUpdateParameters 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 WorkbookPropertiesUpdateParameters object itself. + */ + public WorkbookPropertiesUpdateParameters 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 WorkbookPropertiesUpdateParameters object itself. + */ + public WorkbookPropertiesUpdateParameters withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the tags property: A list of 0 or more tags that are associated with this workbook definition. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of 0 or more tags that are associated with this workbook definition. + * + * @param tags the tags value to set. + * @return the WorkbookPropertiesUpdateParameters object itself. + */ + public WorkbookPropertiesUpdateParameters withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the description property: The description of the workbook. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the workbook. + * + * @param description the description value to set. + * @return the WorkbookPropertiesUpdateParameters object itself. + */ + public WorkbookPropertiesUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the revision property: The unique revision id for this workbook definition. + * + * @return the revision value. + */ + public String revision() { + return this.revision; + } + + /** + * Set the revision property: The unique revision id for this workbook definition. + * + * @param revision the revision value to set. + * @return the WorkbookPropertiesUpdateParameters object itself. + */ + public WorkbookPropertiesUpdateParameters withRevision(String revision) { + this.revision = revision; + 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/fluent/models/WorkbookTemplateInner.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookTemplateInner.java new file mode 100644 index 0000000000000..7fd549d73adb2 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookTemplateInner.java @@ -0,0 +1,182 @@ +// 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.WorkbookTemplateGallery; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateLocalizedGallery; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** An Application Insights workbook template definition. */ +@Fluent +public final class WorkbookTemplateInner extends WorkbookTemplateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplateInner.class); + + /* + * Metadata describing a workbook template for an Azure resource. + */ + @JsonProperty(value = "properties") + private WorkbookTemplateProperties innerProperties; + + /** + * Get the innerProperties property: Metadata describing a workbook template for an Azure resource. + * + * @return the innerProperties value. + */ + private WorkbookTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public WorkbookTemplateInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkbookTemplateInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the priority property: Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * + * @param priority the priority value to set. + * @return the WorkbookTemplateInner object itself. + */ + public WorkbookTemplateInner withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the author property: Information about the author of the workbook template. + * + * @return the author value. + */ + public String author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Set the author property: Information about the author of the workbook template. + * + * @param author the author value to set. + * @return the WorkbookTemplateInner object itself. + */ + public WorkbookTemplateInner withAuthor(String author) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withAuthor(author); + return this; + } + + /** + * Get the templateData property: Valid JSON object containing workbook template payload. + * + * @return the templateData value. + */ + public Object templateData() { + return this.innerProperties() == null ? null : this.innerProperties().templateData(); + } + + /** + * Set the templateData property: Valid JSON object containing workbook template payload. + * + * @param templateData the templateData value to set. + * @return the WorkbookTemplateInner object itself. + */ + public WorkbookTemplateInner withTemplateData(Object templateData) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withTemplateData(templateData); + return this; + } + + /** + * Get the galleries property: Workbook galleries supported by the template. + * + * @return the galleries value. + */ + public List galleries() { + return this.innerProperties() == null ? null : this.innerProperties().galleries(); + } + + /** + * Set the galleries property: Workbook galleries supported by the template. + * + * @param galleries the galleries value to set. + * @return the WorkbookTemplateInner object itself. + */ + public WorkbookTemplateInner withGalleries(List galleries) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withGalleries(galleries); + return this; + } + + /** + * Get the localized property: Key value pair of localized gallery. Each key is the locale code of languages + * supported by the Azure portal. + * + * @return the localized value. + */ + public Map> localized() { + return this.innerProperties() == null ? null : this.innerProperties().localized(); + } + + /** + * Set the localized property: Key value pair of localized gallery. Each key is the locale code of languages + * supported by the Azure portal. + * + * @param localized the localized value to set. + * @return the WorkbookTemplateInner object itself. + */ + public WorkbookTemplateInner withLocalized(Map> localized) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withLocalized(localized); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookTemplateProperties.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookTemplateProperties.java new file mode 100644 index 0000000000000..8d5ca5a998661 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/models/WorkbookTemplateProperties.java @@ -0,0 +1,190 @@ +// 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.WorkbookTemplateGallery; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateLocalizedGallery; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties that contain a workbook template. */ +@Fluent +public final class WorkbookTemplateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplateProperties.class); + + /* + * Priority of the template. Determines which template to open when a + * workbook gallery is opened in viewer mode. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Information about the author of the workbook template. + */ + @JsonProperty(value = "author") + private String author; + + /* + * Valid JSON object containing workbook template payload. + */ + @JsonProperty(value = "templateData", required = true) + private Object templateData; + + /* + * Workbook galleries supported by the template. + */ + @JsonProperty(value = "galleries", required = true) + private List galleries; + + /* + * Key value pair of localized gallery. Each key is the locale code of + * languages supported by the Azure portal. + */ + @JsonProperty(value = "localized") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map> localized; + + /** + * Get the priority property: Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * + * @param priority the priority value to set. + * @return the WorkbookTemplateProperties object itself. + */ + public WorkbookTemplateProperties withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the author property: Information about the author of the workbook template. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Set the author property: Information about the author of the workbook template. + * + * @param author the author value to set. + * @return the WorkbookTemplateProperties object itself. + */ + public WorkbookTemplateProperties withAuthor(String author) { + this.author = author; + return this; + } + + /** + * Get the templateData property: Valid JSON object containing workbook template payload. + * + * @return the templateData value. + */ + public Object templateData() { + return this.templateData; + } + + /** + * Set the templateData property: Valid JSON object containing workbook template payload. + * + * @param templateData the templateData value to set. + * @return the WorkbookTemplateProperties object itself. + */ + public WorkbookTemplateProperties withTemplateData(Object templateData) { + this.templateData = templateData; + return this; + } + + /** + * Get the galleries property: Workbook galleries supported by the template. + * + * @return the galleries value. + */ + public List galleries() { + return this.galleries; + } + + /** + * Set the galleries property: Workbook galleries supported by the template. + * + * @param galleries the galleries value to set. + * @return the WorkbookTemplateProperties object itself. + */ + public WorkbookTemplateProperties withGalleries(List galleries) { + this.galleries = galleries; + return this; + } + + /** + * Get the localized property: Key value pair of localized gallery. Each key is the locale code of languages + * supported by the Azure portal. + * + * @return the localized value. + */ + public Map> localized() { + return this.localized; + } + + /** + * Set the localized property: Key value pair of localized gallery. Each key is the locale code of languages + * supported by the Azure portal. + * + * @param localized the localized value to set. + * @return the WorkbookTemplateProperties object itself. + */ + public WorkbookTemplateProperties withLocalized(Map> localized) { + this.localized = localized; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templateData() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property templateData in model WorkbookTemplateProperties")); + } + if (galleries() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property galleries in model WorkbookTemplateProperties")); + } else { + galleries().forEach(e -> e.validate()); + } + if (localized() != null) { + localized() + .values() + .forEach( + e -> { + if (e != null) { + e.forEach(e1 -> e1.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..bd27f5bac7ae2 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,16 +28,19 @@ 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; import com.azure.resourcemanager.applicationinsights.fluent.WebTestLocationsClient; import com.azure.resourcemanager.applicationinsights.fluent.WebTestsClient; import com.azure.resourcemanager.applicationinsights.fluent.WorkItemConfigurationsClient; +import com.azure.resourcemanager.applicationinsights.fluent.WorkbookTemplatesClient; import com.azure.resourcemanager.applicationinsights.fluent.WorkbooksClient; import java.io.IOException; import java.lang.reflect.Type; @@ -114,16 +117,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 +225,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,6 +273,30 @@ public WebTestsClient getWebTests() { return this.webTests; } + /** The AnalyticsItemsClient object to access its operations. */ + private final AnalyticsItemsClient analyticsItems; + + /** + * Gets the AnalyticsItemsClient object to access its operations. + * + * @return the AnalyticsItemsClient object. + */ + public AnalyticsItemsClient getAnalyticsItems() { + return this.analyticsItems; + } + + /** The WorkbookTemplatesClient object to access its operations. */ + private final WorkbookTemplatesClient workbookTemplates; + + /** + * Gets the WorkbookTemplatesClient object to access its operations. + * + * @return the WorkbookTemplatesClient object. + */ + public WorkbookTemplatesClient getWorkbookTemplates() { + return this.workbookTemplates; + } + /** The MyWorkbooksClient object to access its operations. */ private final MyWorkbooksClient myWorkbooks; @@ -306,16 +321,40 @@ public WorkbooksClient getWorkbooks() { return this.workbooks; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The ComponentsClient object to access its operations. */ + private final ComponentsClient components; /** - * Gets the OperationsClient object to access its operations. + * Gets the ComponentsClient object to access its operations. * - * @return the OperationsClient object. + * @return the ComponentsClient object. */ - public OperationsClient getOperations() { - return this.operations; + 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 +379,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 +388,17 @@ 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.analyticsItems = new AnalyticsItemsClientImpl(this); + this.workbookTemplates = new WorkbookTemplatesClientImpl(this); this.myWorkbooks = new MyWorkbooksClientImpl(this); this.workbooks = new WorkbooksClientImpl(this); - this.operations = new OperationsClientImpl(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..817b253119e4c --- /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); + } + + 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/ComponentsImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentsImpl.java index ba13c5ac32633..dc59964f4d0f0 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentsImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/ComponentsImpl.java @@ -192,7 +192,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); } - this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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..2ea5ac2dfba52 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 @@ -5,11 +5,12 @@ package com.azure.resourcemanager.applicationinsights.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; 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.MyWorkbookManagedIdentity; import java.util.Collections; import java.util.List; import java.util.Map; @@ -32,7 +33,7 @@ public Map tags() { } } - public ManagedIdentity identity() { + public MyWorkbookManagedIdentity identity() { return this.innerModel().identity(); } @@ -61,6 +62,10 @@ public Kind kind() { return this.innerModel().kind(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } @@ -229,7 +234,7 @@ public MyWorkbookImpl withTags(Map tags) { return this; } - public MyWorkbookImpl withIdentity(ManagedIdentity identity) { + public MyWorkbookImpl withIdentity(MyWorkbookManagedIdentity identity) { this.innerModel().withIdentity(identity); return this; } @@ -290,12 +295,16 @@ public MyWorkbookImpl withStorageUri(String storageUri) { } public MyWorkbookImpl withSourceIdParameter(String sourceId) { - this.createSourceId = sourceId; - return this; + if (isInCreateMode()) { + this.createSourceId = sourceId; + return this; + } else { + this.updateSourceId = sourceId; + return this; + } } - public MyWorkbookImpl sourceIdParameter(String sourceId) { - this.updateSourceId = sourceId; - 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/MyWorkbooksClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksClientImpl.java index f17f27b69c992..91acb00250de3 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 @@ -220,7 +220,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 = "2021-03-08"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -293,7 +293,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 = "2021-03-08"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -469,7 +469,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 = "2021-03-08"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -529,7 +529,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 = "2021-03-08"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -680,7 +680,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 = "2021-03-08"; final String accept = "application/json"; return FluxUtil .withContext( @@ -730,7 +730,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 = "2021-03-08"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -830,7 +830,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 = "2021-03-08"; final String accept = "application/json"; return FluxUtil .withContext( @@ -880,7 +880,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 = "2021-03-08"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -979,7 +979,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-03-08"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1043,7 +1043,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-03-08"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1193,7 +1193,7 @@ private Mono> updateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-03-08"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1257,7 +1257,7 @@ private Mono> updateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-03-08"; 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/MyWorkbooksImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/MyWorkbooksImpl.java index 3cc5c8b27f80d..dffe6cf795c1f 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 @@ -147,7 +147,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'myWorkbooks'.", id))); } - this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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..94604845078ed 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 @@ -85,7 +85,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 +95,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 +118,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 +128,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 +149,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 +163,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 +176,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,7 +190,7 @@ 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) { @@ -204,7 +204,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 +240,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/WebTestsImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WebTestsImpl.java index 9e8423640e25f..18407ec7c5a9b 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WebTestsImpl.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WebTestsImpl.java @@ -146,7 +146,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webtests'.", id))); } - this.deleteWithResponse(resourceGroupName, webTestName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, webTestName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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..b5c245ae3f2df 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 @@ -5,13 +5,15 @@ package com.azure.resourcemanager.applicationinsights.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; 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.WorkbookResourceIdentity; import com.azure.resourcemanager.applicationinsights.models.WorkbookUpdateParameters; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -21,6 +23,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,10 +48,22 @@ public Map tags() { } } + public WorkbookResourceIdentity identity() { + return this.innerModel().identity(); + } + public Kind kind() { return this.innerModel().kind(); } + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } @@ -50,7 +76,7 @@ public String version() { return this.innerModel().version(); } - public String timeModified() { + public OffsetDateTime timeModified() { return this.innerModel().timeModified(); } @@ -79,29 +105,12 @@ 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 description() { + return this.innerModel().description(); } - public String type() { - return this.innerModel().type(); + public String revision() { + return this.innerModel().revision(); } public Region region() { @@ -240,11 +249,21 @@ public WorkbookImpl withTags(Map tags) { } } + public WorkbookImpl withIdentity(WorkbookResourceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + public WorkbookImpl withKind(Kind kind) { this.innerModel().withKind(kind); return this; } + public WorkbookImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + public WorkbookImpl withDisplayName(String displayName) { if (isInCreateMode()) { this.innerModel().withDisplayName(displayName); @@ -291,8 +310,13 @@ public WorkbookImpl withTagsPropertiesTags(List tagsPropertiesTags) { } public WorkbookImpl withSourceId(String sourceId) { - this.innerModel().withSourceId(sourceId); - return this; + if (isInCreateMode()) { + this.innerModel().withSourceId(sourceId); + return this; + } else { + this.updateSourceId = sourceId; + return this; + } } public WorkbookImpl withStorageUri(String storageUri) { @@ -300,24 +324,14 @@ public WorkbookImpl withStorageUri(String storageUri) { return this; } - public WorkbookImpl withIdentity(ManagedIdentityAutoGenerated identity) { - this.innerModel().withIdentity(identity); - 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); - return this; + public WorkbookImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateWorkbookUpdateParameters.withDescription(description); + return this; + } } public WorkbookImpl withSourceIdParameter(String sourceId) { @@ -330,8 +344,8 @@ public WorkbookImpl withKind(SharedTypeKind kind) { return this; } - public WorkbookImpl sourceId(String sourceId) { - this.updateSourceId = sourceId; + public WorkbookImpl withRevision(String revision) { + this.updateWorkbookUpdateParameters.withRevision(revision); return this; } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplateImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplateImpl.java new file mode 100644 index 0000000000000..ec78274f15373 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplateImpl.java @@ -0,0 +1,261 @@ +// 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.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookTemplateInner; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplate; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateGallery; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateLocalizedGallery; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateUpdateParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class WorkbookTemplateImpl + implements WorkbookTemplate, WorkbookTemplate.Definition, WorkbookTemplate.Update { + private WorkbookTemplateInner 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 location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public String author() { + return this.innerModel().author(); + } + + public Object templateData() { + return this.innerModel().templateData(); + } + + public List galleries() { + List inner = this.innerModel().galleries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map> localized() { + Map> inner = this.innerModel().localized(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public WorkbookTemplateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private WorkbookTemplateUpdateParameters updateWorkbookTemplateUpdateParameters; + + public WorkbookTemplateImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public WorkbookTemplate create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkbookTemplates() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WorkbookTemplate create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkbookTemplates() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) + .getValue(); + return this; + } + + WorkbookTemplateImpl( + String name, com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerObject = new WorkbookTemplateInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public WorkbookTemplateImpl update() { + this.updateWorkbookTemplateUpdateParameters = new WorkbookTemplateUpdateParameters(); + return this; + } + + public WorkbookTemplate apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkbookTemplates() + .updateWithResponse( + resourceGroupName, resourceName, updateWorkbookTemplateUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public WorkbookTemplate apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkbookTemplates() + .updateWithResponse(resourceGroupName, resourceName, updateWorkbookTemplateUpdateParameters, context) + .getValue(); + return this; + } + + WorkbookTemplateImpl( + WorkbookTemplateInner 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(), "workbooktemplates"); + } + + public WorkbookTemplate refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkbookTemplates() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public WorkbookTemplate refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkbookTemplates() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public WorkbookTemplateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public WorkbookTemplateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public WorkbookTemplateImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateWorkbookTemplateUpdateParameters.withTags(tags); + return this; + } + } + + public WorkbookTemplateImpl withPriority(Integer priority) { + if (isInCreateMode()) { + this.innerModel().withPriority(priority); + return this; + } else { + this.updateWorkbookTemplateUpdateParameters.withPriority(priority); + return this; + } + } + + public WorkbookTemplateImpl withAuthor(String author) { + if (isInCreateMode()) { + this.innerModel().withAuthor(author); + return this; + } else { + this.updateWorkbookTemplateUpdateParameters.withAuthor(author); + return this; + } + } + + public WorkbookTemplateImpl withTemplateData(Object templateData) { + if (isInCreateMode()) { + this.innerModel().withTemplateData(templateData); + return this; + } else { + this.updateWorkbookTemplateUpdateParameters.withTemplateData(templateData); + return this; + } + } + + public WorkbookTemplateImpl withGalleries(List galleries) { + if (isInCreateMode()) { + this.innerModel().withGalleries(galleries); + return this; + } else { + this.updateWorkbookTemplateUpdateParameters.withGalleries(galleries); + return this; + } + } + + public WorkbookTemplateImpl withLocalized(Map> localized) { + if (isInCreateMode()) { + this.innerModel().withLocalized(localized); + return this; + } else { + this.updateWorkbookTemplateUpdateParameters.withLocalized(localized); + 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/WorkbookTemplatesClientImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplatesClientImpl.java new file mode 100644 index 0000000000000..4d9db7cbd8d23 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplatesClientImpl.java @@ -0,0 +1,968 @@ +// 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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +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; +import com.azure.resourcemanager.applicationinsights.fluent.WorkbookTemplatesClient; +import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookTemplateInner; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateUpdateParameters; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplatesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkbookTemplatesClient. */ +public final class WorkbookTemplatesClientImpl implements WorkbookTemplatesClient { + private final ClientLogger logger = new ClientLogger(WorkbookTemplatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkbookTemplatesService service; + + /** The service client containing this operation class. */ + private final ApplicationInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkbookTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkbookTemplatesClientImpl(ApplicationInsightsManagementClientImpl client) { + this.service = + RestProxy.create(WorkbookTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationInsightsManagementClientWorkbookTemplates to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApplicationInsightsM") + private interface WorkbookTemplatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/workbooktemplates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/workbooktemplates/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/workbooktemplates/{resourceName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/workbooktemplates/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkbookTemplateInner workbookTemplateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/workbooktemplates/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a single workbook template by its 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 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 template by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a single workbook template by its 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 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 a single workbook template by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + accept, + context); + } + + /** + * Get a single workbook template by its 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 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 template by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a single workbook template by its 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 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 template by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkbookTemplateInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * Get a single workbook template by its 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 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 a single workbook template by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Delete a workbook template. + * + * @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 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) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + accept, + context); + } + + /** + * Delete a workbook template. + * + * @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 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) { + return deleteWithResponseAsync(resourceGroupName, resourceName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a workbook template. + * + * @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 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) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * Delete a workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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, Context context) { + return deleteWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Create a new workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties Properties that need to be specified to create a new workbook. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, WorkbookTemplateInner workbookTemplateProperties) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (workbookTemplateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workbookTemplateProperties is required and cannot be null.")); + } else { + workbookTemplateProperties.validate(); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + workbookTemplateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties 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 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 template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String resourceName, + WorkbookTemplateInner workbookTemplateProperties, + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (workbookTemplateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workbookTemplateProperties is required and cannot be null.")); + } else { + workbookTemplateProperties.validate(); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + workbookTemplateProperties, + accept, + context); + } + + /** + * Create a new workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties Properties that need to be specified to create a new workbook. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, WorkbookTemplateInner workbookTemplateProperties) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookTemplateProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties Properties that need to be specified to create a new workbook. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkbookTemplateInner createOrUpdate( + String resourceGroupName, String resourceName, WorkbookTemplateInner workbookTemplateProperties) { + return createOrUpdateAsync(resourceGroupName, resourceName, workbookTemplateProperties).block(); + } + + /** + * Create a new workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param workbookTemplateProperties 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 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 template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String resourceName, + WorkbookTemplateInner workbookTemplateProperties, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, workbookTemplateProperties, context) + .block(); + } + + /** + * Updates a workbook template 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 workbookTemplateUpdateParameters Properties that need to be specified to patch a workbook template. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String resourceName, + WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (workbookTemplateUpdateParameters != null) { + workbookTemplateUpdateParameters.validate(); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + workbookTemplateUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a workbook template 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 workbookTemplateUpdateParameters Properties that need to be specified to patch a workbook template. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String resourceName, + WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters, + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (workbookTemplateUpdateParameters != null) { + workbookTemplateUpdateParameters.validate(); + } + final String apiVersion = "2020-11-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + workbookTemplateUpdateParameters, + accept, + context); + } + + /** + * Updates a workbook template 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 workbookTemplateUpdateParameters Properties that need to be specified to patch a workbook template. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String resourceName, + WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters) { + return updateWithResponseAsync(resourceGroupName, resourceName, workbookTemplateUpdateParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a workbook template 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 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 template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String resourceName) { + final WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, resourceName, workbookTemplateUpdateParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a workbook template 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 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 template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkbookTemplateInner update(String resourceGroupName, String resourceName) { + final WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters = null; + return updateAsync(resourceGroupName, resourceName, workbookTemplateUpdateParameters).block(); + } + + /** + * Updates a workbook template 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 workbookTemplateUpdateParameters Properties that need to be specified to patch a workbook template. + * @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 workbook template definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String resourceName, + WorkbookTemplateUpdateParameters workbookTemplateUpdateParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, resourceName, workbookTemplateUpdateParameters, context) + .block(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplatesImpl.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplatesImpl.java new file mode 100644 index 0000000000000..30ae121e2cc14 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/implementation/WorkbookTemplatesImpl.java @@ -0,0 +1,170 @@ +// 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.PagedIterable; +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.WorkbookTemplatesClient; +import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookTemplateInner; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplate; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplates; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkbookTemplatesImpl implements WorkbookTemplates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplatesImpl.class); + + private final WorkbookTemplatesClient innerClient; + + private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager; + + public WorkbookTemplatesImpl( + WorkbookTemplatesClient innerClient, + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new WorkbookTemplateImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new WorkbookTemplateImpl(inner1, this.manager())); + } + + public WorkbookTemplate getByResourceGroup(String resourceGroupName, String resourceName) { + WorkbookTemplateInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new WorkbookTemplateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkbookTemplateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, context); + } + + public WorkbookTemplate 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, "workbooktemplates"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workbooktemplates'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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, "workbooktemplates"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workbooktemplates'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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, "workbooktemplates"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workbooktemplates'.", id))); + } + this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE); + } + + 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, "workbooktemplates"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workbooktemplates'.", id))); + } + return this.deleteWithResponse(resourceGroupName, resourceName, context); + } + + private WorkbookTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() { + return this.serviceManager; + } + + public WorkbookTemplateImpl define(String name) { + return new WorkbookTemplateImpl(name, this.manager()); + } +} 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..4fc34167d8122 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 @@ -34,7 +34,7 @@ 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.WorkbookErrorDefinitionException; import com.azure.resourcemanager.applicationinsights.models.WorkbookUpdateParameters; import com.azure.resourcemanager.applicationinsights.models.WorkbooksListResult; import java.util.List; @@ -71,7 +71,7 @@ private interface WorkbooksService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/workbooks") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -86,7 +86,7 @@ Mono> list( @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -104,7 +104,7 @@ Mono> listByResourceGroup( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/{resourceName}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -119,7 +119,7 @@ Mono> getByResourceGroup( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/{resourceName}") @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) Mono> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -134,7 +134,7 @@ Mono> delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/{resourceName}") @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) Mono> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -151,7 +151,7 @@ Mono> createOrUpdate( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + "/{resourceName}") @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) Mono> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -163,10 +163,41 @@ Mono> update( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks" + + "/{resourceName}/revisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) + Mono> revisionsList( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @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" + + "/{resourceName}/revisions/{revisionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) + Mono> revisionGet( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("revisionId") String revisionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.class) Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @@ -176,12 +207,22 @@ Mono> listBySubscriptionNext( @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(WorkbookErrorException.class) + @UnexpectedResponseExceptionType(WorkbookErrorDefinitionException.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(WorkbookErrorDefinitionException.class) + Mono> revisionsListNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -192,7 +233,7 @@ Mono> listByResourceGroupNext( * @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 WorkbookErrorDefinitionException 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. */ @@ -214,7 +255,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 = "2021-08-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -252,7 +293,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 WorkbookErrorException thrown if the request is rejected by server. + * @throws WorkbookErrorDefinitionException 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. */ @@ -274,7 +315,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 = "2021-08-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -308,7 +349,7 @@ 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 WorkbookErrorException thrown if the request is rejected by server. + * @throws WorkbookErrorDefinitionException 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. */ @@ -324,7 +365,7 @@ private PagedFlux listAsync(CategoryType category, List t * * @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 WorkbookErrorDefinitionException 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. */ @@ -346,7 +387,7 @@ 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 WorkbookErrorException thrown if the request is rejected by server. + * @throws WorkbookErrorDefinitionException 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. */ @@ -363,7 +404,7 @@ private PagedFlux listAsync( * * @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 WorkbookErrorDefinitionException 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. */ @@ -383,7 +424,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 WorkbookErrorException thrown if the request is rejected by server. + * @throws WorkbookErrorDefinitionException 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. */ @@ -403,7 +444,7 @@ public PagedIterable list( * @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 WorkbookErrorDefinitionException 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. */ @@ -429,7 +470,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 = "2021-08-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -471,7 +512,7 @@ private Mono> listByResourceGroupSinglePageAsync( * 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 WorkbookErrorDefinitionException 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. */ @@ -502,7 +543,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 = "2021-08-01"; final String accept = "application/json"; String tagsConverted = JacksonAdapter.createDefaultSerializerAdapter().serializeList(tags, CollectionFormat.CSV); @@ -540,7 +581,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @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 WorkbookErrorDefinitionException 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. */ @@ -558,7 +599,7 @@ 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 WorkbookErrorDefinitionException 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. */ @@ -583,7 +624,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNa * 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 WorkbookErrorDefinitionException 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. */ @@ -608,7 +649,7 @@ 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 WorkbookErrorDefinitionException 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. */ @@ -632,7 +673,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName * 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 WorkbookErrorDefinitionException 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. */ @@ -654,7 +695,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 WorkbookErrorDefinitionException 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 +721,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 = "2021-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -704,7 +745,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 WorkbookErrorDefinitionException 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 +771,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 = "2021-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -750,7 +791,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 WorkbookErrorDefinitionException 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 +814,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 WorkbookErrorDefinitionException 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 +830,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 WorkbookErrorDefinitionException 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 +846,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 WorkbookErrorDefinitionException 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 +871,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 = "2021-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -854,7 +895,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 WorkbookErrorDefinitionException 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 +921,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 = "2021-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -900,7 +941,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 WorkbookErrorDefinitionException 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 +956,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 WorkbookErrorDefinitionException 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 +971,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 WorkbookErrorDefinitionException 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. */ @@ -947,7 +988,7 @@ public Response deleteWithResponse(String resourceGroupName, String resour * @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 WorkbookErrorDefinitionException 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. */ @@ -979,7 +1020,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1007,7 +1048,7 @@ private Mono> createOrUpdateWithResponseAsync( * @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 WorkbookErrorDefinitionException 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. */ @@ -1043,7 +1084,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { workbookProperties.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1067,7 +1108,7 @@ private Mono> createOrUpdateWithResponseAsync( * @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 WorkbookErrorDefinitionException 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. */ @@ -1092,7 +1133,7 @@ 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 WorkbookErrorDefinitionException 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. */ @@ -1118,7 +1159,7 @@ 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 WorkbookErrorDefinitionException 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. */ @@ -1138,7 +1179,7 @@ public WorkbookInner createOrUpdate( * @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 WorkbookErrorDefinitionException 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. */ @@ -1161,7 +1202,7 @@ public Response createOrUpdateWithResponse( * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param workbookUpdateParameters 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 WorkbookErrorDefinitionException 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. */ @@ -1193,7 +1234,7 @@ private Mono> updateWithResponseAsync( if (workbookUpdateParameters != null) { workbookUpdateParameters.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1221,7 +1262,7 @@ private Mono> updateWithResponseAsync( * @param workbookUpdateParameters 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 WorkbookErrorDefinitionException 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. */ @@ -1254,7 +1295,7 @@ private Mono> updateWithResponseAsync( if (workbookUpdateParameters != null) { workbookUpdateParameters.validate(); } - final String apiVersion = "2020-10-20"; + final String apiVersion = "2021-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1278,7 +1319,7 @@ private Mono> updateWithResponseAsync( * @param sourceId Azure Resource Id that will fetch all linked workbooks. * @param workbookUpdateParameters 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 WorkbookErrorDefinitionException 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. */ @@ -1305,7 +1346,7 @@ private Mono updateAsync( * @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 WorkbookErrorDefinitionException 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. */ @@ -1330,7 +1371,7 @@ 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. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws WorkbookErrorDefinitionException 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. */ @@ -1350,7 +1391,7 @@ public WorkbookInner update(String resourceGroupName, String resourceName) { * @param workbookUpdateParameters 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 WorkbookErrorDefinitionException 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. */ @@ -1365,12 +1406,357 @@ public Response updateWithResponse( .block(); } + /** + * Get the revisions for the workbook defined by its 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 WorkbookErrorDefinitionException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revisionsListSinglePageAsync( + String resourceGroupName, String resourceName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .revisionsList( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + 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 the revisions for the workbook defined by its 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revisionsListSinglePageAsync( + String resourceGroupName, String resourceName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .revisionsList( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the revisions for the workbook defined by its 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 WorkbookErrorDefinitionException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux revisionsListAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>( + () -> revisionsListSinglePageAsync(resourceGroupName, resourceName), + nextLink -> revisionsListNextSinglePageAsync(nextLink)); + } + + /** + * Get the revisions for the workbook defined by its 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux revisionsListAsync( + String resourceGroupName, String resourceName, Context context) { + return new PagedFlux<>( + () -> revisionsListSinglePageAsync(resourceGroupName, resourceName, context), + nextLink -> revisionsListNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the revisions for the workbook defined by its 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 WorkbookErrorDefinitionException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable revisionsList(String resourceGroupName, String resourceName) { + return new PagedIterable<>(revisionsListAsync(resourceGroupName, resourceName)); + } + + /** + * Get the revisions for the workbook defined by its 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable revisionsList(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(revisionsListAsync(resourceGroupName, resourceName, context)); + } + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revisionGetWithResponseAsync( + String resourceGroupName, String resourceName, String revisionId) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (revisionId == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionId is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .revisionGet( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + revisionId, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revisionGetWithResponseAsync( + String resourceGroupName, String resourceName, String revisionId, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (revisionId == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionId is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .revisionGet( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + revisionId, + apiVersion, + accept, + context); + } + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revisionGetAsync(String resourceGroupName, String resourceName, String revisionId) { + return revisionGetWithResponseAsync(resourceGroupName, resourceName, revisionId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkbookInner revisionGet(String resourceGroupName, String resourceName, String revisionId) { + return revisionGetAsync(resourceGroupName, resourceName, revisionId).block(); + } + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response revisionGetWithResponse( + String resourceGroupName, String resourceName, String revisionId, Context context) { + return revisionGetWithResponseAsync(resourceGroupName, resourceName, revisionId, 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 WorkbookErrorDefinitionException 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. */ @@ -1407,7 +1793,7 @@ private Mono> listBySubscriptionNextSinglePageAsync * @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 WorkbookErrorDefinitionException 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. */ @@ -1442,7 +1828,7 @@ private Mono> listBySubscriptionNextSinglePageAsync * * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws WorkbookErrorException thrown if the request is rejected by server. + * @throws WorkbookErrorDefinitionException 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. */ @@ -1479,7 +1865,7 @@ private Mono> listByResourceGroupNextSinglePageAsyn * @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 WorkbookErrorDefinitionException 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. */ @@ -1509,4 +1895,75 @@ private Mono> listByResourceGroupNextSinglePageAsyn res.getValue().nextLink(), null)); } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws WorkbookErrorDefinitionException 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> revisionsListNextSinglePageAsync(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.revisionsListNext(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 WorkbookErrorDefinitionException 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> revisionsListNextSinglePageAsync(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 + .revisionsListNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } } 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..23ed0fa79e6b2 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 @@ -93,6 +93,41 @@ public Response deleteWithResponse(String resourceGroupName, String resour return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, context); } + public PagedIterable revisionsList(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().revisionsList(resourceGroupName, resourceName); + return Utils.mapPage(inner, inner1 -> new WorkbookImpl(inner1, this.manager())); + } + + public PagedIterable revisionsList(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = + this.serviceClient().revisionsList(resourceGroupName, resourceName, context); + return Utils.mapPage(inner, inner1 -> new WorkbookImpl(inner1, this.manager())); + } + + public Workbook revisionGet(String resourceGroupName, String resourceName, String revisionId) { + WorkbookInner inner = this.serviceClient().revisionGet(resourceGroupName, resourceName, revisionId); + if (inner != null) { + return new WorkbookImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response revisionGetWithResponse( + String resourceGroupName, String resourceName, String revisionId, Context context) { + Response inner = + this.serviceClient().revisionGetWithResponse(resourceGroupName, resourceName, revisionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkbookImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public Workbook getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -147,7 +182,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'workbooks'.", id))); } - this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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..d98c243d632b6 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentLinkedStorageAccountsPatch.java @@ -0,0 +1,66 @@ +// 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.LinkedStorageAccountsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Application Insights component linked storage accounts patch. */ +@Fluent +public final class ComponentLinkedStorageAccountsPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentLinkedStorageAccountsPatch.class); + + /* + * The properties of the linked storage accounts. + */ + @JsonProperty(value = "properties") + private LinkedStorageAccountsProperties innerProperties; + + /** + * Get the innerProperties property: The properties of the linked storage accounts. + * + * @return the innerProperties value. + */ + private LinkedStorageAccountsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the linkedStorageAccount property: Linked storage account resource ID. + * + * @return the linkedStorageAccount value. + */ + public String linkedStorageAccount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LinkedStorageAccountsProperties(); + } + this.innerProperties().withLinkedStorageAccount(linkedStorageAccount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentsResource.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentsResource.java index b868bf5e126ad..e8a79b5446472 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentsResource.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ComponentsResource.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.applicationinsights.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; 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 +@Fluent public class ComponentsResource extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentsResource.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/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/ManagedServiceIdentity.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..bf7a5429563be --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedServiceIdentity.java @@ -0,0 +1,142 @@ +// 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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ManagedServiceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedServiceIdentity.class); + + /* + * The service principal ID of the system assigned identity. This property + * will only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and + * UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedServiceIdentityType.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..c59db1039d25d --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedServiceIdentityType.java @@ -0,0 +1,41 @@ +// 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 ManagedServiceIdentityType. */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned,UserAssigned"); + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** @return known ManagedServiceIdentityType values. */ + public static Collection values() { + return values(ManagedServiceIdentityType.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..5108843898f0b 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.applicationinsights.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.MyWorkbookInner; import java.util.List; @@ -31,7 +32,7 @@ public interface MyWorkbook { * * @return the identity value. */ - ManagedIdentity identity(); + MyWorkbookManagedIdentity identity(); /** * Gets the id property: Azure resource Id. @@ -68,6 +69,13 @@ public interface MyWorkbook { */ Kind kind(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the displayName property: The user-defined name of the private workbook. * @@ -248,7 +256,7 @@ interface WithIdentity { * @param identity Identity used for BYOS. * @return the next definition stage. */ - WithCreate withIdentity(ManagedIdentity identity); + WithCreate withIdentity(MyWorkbookManagedIdentity identity); } /** The stage of the MyWorkbook definition allowing to specify name. */ interface WithName { @@ -388,8 +396,6 @@ interface WithSourceIdParameter { interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, - UpdateStages.WithName, - UpdateStages.WithType, UpdateStages.WithEtag, UpdateStages.WithKind, UpdateStages.WithDisplayName, @@ -399,7 +405,7 @@ interface Update UpdateStages.WithTagsPropertiesTags, UpdateStages.WithSourceId, UpdateStages.WithStorageUri, - UpdateStages.WithsourceIdParameter { + UpdateStages.WithSourceIdParameter { /** * Executes the update request. * @@ -435,27 +441,7 @@ interface WithIdentity { * @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 { - /** - * Specifies the name property: Azure resource name. - * - * @param name Azure resource name. - * @return the next definition stage. - */ - Update withName(String name); - } - /** The stage of the MyWorkbook update allowing to specify type. */ - interface WithType { - /** - * Specifies the type property: Azure resource type. - * - * @param type Azure resource type. - * @return the next definition stage. - */ - Update withType(String type); + Update withIdentity(MyWorkbookManagedIdentity identity); } /** The stage of the MyWorkbook update allowing to specify etag. */ interface WithEtag { @@ -554,14 +540,14 @@ interface WithStorageUri { Update withStorageUri(String storageUri); } /** The stage of the MyWorkbook update allowing to specify sourceId. */ - interface WithsourceIdParameter { + 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); + Update withSourceIdParameter(String sourceId); } } /** 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/MyWorkbookManagedIdentity.java similarity index 72% rename from sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/ManagedIdentity.java rename to sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookManagedIdentity.java index b403e8b0ac1b3..fa185bef09497 100644 --- 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/MyWorkbookManagedIdentity.java @@ -11,27 +11,27 @@ /** Customer Managed Identity. */ @Fluent -public class ManagedIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentity.class); +public class MyWorkbookManagedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MyWorkbookManagedIdentity.class); /* * Customer Managed Identity */ @JsonProperty(value = "userAssignedIdentities") - private UserAssignedIdentities userAssignedIdentities; + private MyWorkbookUserAssignedIdentities userAssignedIdentities; /* * The identity type. */ @JsonProperty(value = "type") - private ManagedIdentityType type; + private MyWorkbookManagedIdentityType type; /** * Get the userAssignedIdentities property: Customer Managed Identity. * * @return the userAssignedIdentities value. */ - public UserAssignedIdentities userAssignedIdentities() { + public MyWorkbookUserAssignedIdentities userAssignedIdentities() { return this.userAssignedIdentities; } @@ -39,9 +39,10 @@ public UserAssignedIdentities userAssignedIdentities() { * Set the userAssignedIdentities property: Customer Managed Identity. * * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ManagedIdentity object itself. + * @return the MyWorkbookManagedIdentity object itself. */ - public ManagedIdentity withUserAssignedIdentities(UserAssignedIdentities userAssignedIdentities) { + public MyWorkbookManagedIdentity withUserAssignedIdentities( + MyWorkbookUserAssignedIdentities userAssignedIdentities) { this.userAssignedIdentities = userAssignedIdentities; return this; } @@ -51,7 +52,7 @@ public ManagedIdentity withUserAssignedIdentities(UserAssignedIdentities userAss * * @return the type value. */ - public ManagedIdentityType type() { + public MyWorkbookManagedIdentityType type() { return this.type; } @@ -59,9 +60,9 @@ public ManagedIdentityType type() { * Set the type property: The identity type. * * @param type the type value to set. - * @return the ManagedIdentity object itself. + * @return the MyWorkbookManagedIdentity object itself. */ - public ManagedIdentity withType(ManagedIdentityType type) { + public MyWorkbookManagedIdentity withType(MyWorkbookManagedIdentityType type) { this.type = type; return this; } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookManagedIdentityType.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookManagedIdentityType.java new file mode 100644 index 0000000000000..a6dcffcc97708 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookManagedIdentityType.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 MyWorkbookManagedIdentityType. */ +public final class MyWorkbookManagedIdentityType extends ExpandableStringEnum { + /** Static value UserAssigned for MyWorkbookManagedIdentityType. */ + public static final MyWorkbookManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value None for MyWorkbookManagedIdentityType. */ + public static final MyWorkbookManagedIdentityType NONE = fromString("None"); + + /** + * Creates or finds a MyWorkbookManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MyWorkbookManagedIdentityType. + */ + @JsonCreator + public static MyWorkbookManagedIdentityType fromString(String name) { + return fromString(name, MyWorkbookManagedIdentityType.class); + } + + /** @return known MyWorkbookManagedIdentityType values. */ + public static Collection values() { + return values(MyWorkbookManagedIdentityType.class); + } +} 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..b315836bc67fb 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 @@ -8,6 +8,7 @@ import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -20,7 +21,7 @@ public class MyWorkbookResource extends Resource { * Identity used for BYOS */ @JsonProperty(value = "identity") - private ManagedIdentity identity; + private MyWorkbookManagedIdentity identity; /* * Azure resource Id @@ -44,6 +45,7 @@ public class MyWorkbookResource extends Resource { * Resource etag */ @JsonProperty(value = "etag") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map etag; /** @@ -51,7 +53,7 @@ public class MyWorkbookResource extends Resource { * * @return the identity value. */ - public ManagedIdentity identity() { + public MyWorkbookManagedIdentity identity() { return this.identity; } @@ -61,7 +63,7 @@ public ManagedIdentity identity() { * @param identity the identity value to set. * @return the MyWorkbookResource object itself. */ - public MyWorkbookResource withIdentity(ManagedIdentity identity) { + public MyWorkbookResource withIdentity(MyWorkbookManagedIdentity identity) { this.identity = identity; return this; } 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/MyWorkbookUserAssignedIdentities.java similarity index 93% rename from sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentities.java rename to sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/MyWorkbookUserAssignedIdentities.java index 82e27e7779c6e..29464af170f1e 100644 --- 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/MyWorkbookUserAssignedIdentities.java @@ -11,8 +11,8 @@ /** Customer Managed Identity. */ @Immutable -public final class UserAssignedIdentities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentities.class); +public final class MyWorkbookUserAssignedIdentities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MyWorkbookUserAssignedIdentities.class); /* * The principal ID of resource identity. 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/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/Operations.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/Operations.java index a439727d633cc..24d7bbe62f258 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,7 @@ 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); } 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/TagsResource.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/TagsResource.java index 2aee8ea3d38ad..a58ed9dd12160 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/TagsResource.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/TagsResource.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class TagsResource { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** 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/UserAssignedIdentity.java similarity index 55% rename from sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentitiesAutoGenerated.java rename to sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/UserAssignedIdentity.java index 9ef3948e54cd2..f6f1433372673 100644 --- 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/UserAssignedIdentity.java @@ -8,54 +8,40 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; -/** Customer Managed Identity. */ +/** User assigned identity properties. */ @Immutable -public final class UserAssignedIdentitiesAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentitiesAutoGenerated.class); +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); /* - * The principal ID of resource identity. + * The principal ID of the assigned identity. */ @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; + private UUID principalId; /* - * The tenant ID of resource. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The client ID of resource. + * The client ID of the assigned identity. */ @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private String clientId; + private UUID clientId; /** - * Get the principalId property: The principal ID of resource identity. + * Get the principalId property: The principal ID of the assigned identity. * * @return the principalId value. */ - public String principalId() { + public UUID 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. + * Get the clientId property: The client ID of the assigned identity. * * @return the clientId value. */ - public String clientId() { + public UUID clientId() { return this.clientId; } diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WebtestsResource.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WebtestsResource.java index 1c3102c9c9a5b..085c322b410c3 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WebtestsResource.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WebtestsResource.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.applicationinsights.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; 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 +@Fluent public class WebtestsResource extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(WebtestsResource.class); diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkItemCreateConfiguration.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkItemCreateConfiguration.java index 1ef9072962b16..427044113e366 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkItemCreateConfiguration.java +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkItemCreateConfiguration.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -37,6 +38,7 @@ public final class WorkItemCreateConfiguration { * Custom work item properties */ @JsonProperty(value = "WorkItemProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map workItemProperties; /** 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..a45b08f5cdf24 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 @@ -5,13 +5,36 @@ package com.azure.resourcemanager.applicationinsights.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; /** 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. * @@ -26,6 +49,13 @@ public interface Workbook { */ Map tags(); + /** + * Gets the identity property: Identity used for BYOS. + * + * @return the identity value. + */ + WorkbookResourceIdentity identity(); + /** * Gets the kind property: The kind of workbook. Choices are user and shared. * @@ -33,6 +63,20 @@ public interface Workbook { */ Kind kind(); + /** + * Gets the etag property: Resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the displayName property: The user-defined name (display name) of the workbook. * @@ -49,7 +93,8 @@ public interface Workbook { String serializedData(); /** - * Gets the version property: Workbook version. + * Gets the version property: Workbook schema version format, like 'Notebook/1.0', which should match the workbook + * in serializedData. * * @return the version value. */ @@ -61,7 +106,7 @@ public interface Workbook { * * @return the timeModified value. */ - String timeModified(); + OffsetDateTime timeModified(); /** * Gets the category property: Workbook category, as defined by the user at creation time. @@ -71,7 +116,7 @@ public interface Workbook { String category(); /** - * Gets the tagsPropertiesTags property: A list of 0 or more tags that are associated with this workbook definition. + * Gets the tagsPropertiesTags property: Being deprecated, please use the other tags field. * * @return the tagsPropertiesTags value. */ @@ -92,46 +137,25 @@ public interface Workbook { String sourceId(); /** - * Gets the storageUri property: BYOS Storage Account URI. + * Gets the storageUri property: The resourceId to the storage account when bring your own storage is used. * * @return the storageUri value. */ String storageUri(); /** - * Gets the identity property: Identity used for BYOS. + * Gets the description property: The description of the workbook. * - * @return the identity value. + * @return the description value. */ - ManagedIdentityAutoGenerated identity(); + String description(); /** - * Gets the etag property: Resource etag. + * Gets the revision property: The unique revision id for this workbook definition. * - * @return the etag value. + * @return the revision 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 revision(); /** * Gets the region of the resource. @@ -200,7 +224,9 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithKind, + DefinitionStages.WithEtag, DefinitionStages.WithDisplayName, DefinitionStages.WithSerializedData, DefinitionStages.WithVersion, @@ -208,10 +234,7 @@ interface WithCreate DefinitionStages.WithTagsPropertiesTags, DefinitionStages.WithSourceId, DefinitionStages.WithStorageUri, - DefinitionStages.WithIdentity, - DefinitionStages.WithEtag, - DefinitionStages.WithName, - DefinitionStages.WithType, + DefinitionStages.WithDescription, DefinitionStages.WithSourceIdParameter { /** * Executes the create request. @@ -238,6 +261,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** 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(WorkbookResourceIdentity identity); + } /** The stage of the Workbook definition allowing to specify kind. */ interface WithKind { /** @@ -248,6 +281,16 @@ interface WithKind { */ WithCreate withKind(Kind kind); } + /** 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(String etag); + } /** The stage of the Workbook definition allowing to specify displayName. */ interface WithDisplayName { /** @@ -273,9 +316,11 @@ interface WithSerializedData { /** The stage of the Workbook definition allowing to specify version. */ interface WithVersion { /** - * Specifies the version property: Workbook version. + * Specifies the version property: Workbook schema version format, like 'Notebook/1.0', which should match + * the workbook in serializedData. * - * @param version Workbook version. + * @param version Workbook schema version format, like 'Notebook/1.0', which should match the workbook in + * serializedData. * @return the next definition stage. */ WithCreate withVersion(String version); @@ -293,10 +338,9 @@ interface WithCategory { /** The stage of the Workbook definition allowing to specify tagsPropertiesTags. */ interface WithTagsPropertiesTags { /** - * Specifies the tagsPropertiesTags property: A list of 0 or more tags that are associated with this - * workbook definition. + * Specifies the tagsPropertiesTags property: Being deprecated, please use the other tags field. * - * @param tagsPropertiesTags A list of 0 or more tags that are associated with this workbook definition. + * @param tagsPropertiesTags Being deprecated, please use the other tags field. * @return the next definition stage. */ WithCreate withTagsPropertiesTags(List tagsPropertiesTags); @@ -314,52 +358,23 @@ interface WithSourceId { /** The stage of the Workbook definition allowing to specify storageUri. */ interface WithStorageUri { /** - * Specifies the storageUri property: BYOS Storage Account URI. + * Specifies the storageUri property: The resourceId to the storage account when bring your own storage is + * used. * - * @param storageUri BYOS Storage Account URI. + * @param storageUri The resourceId to the storage account when bring your own storage is used. * @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 { + /** The stage of the Workbook definition allowing to specify description. */ + interface WithDescription { /** - * Specifies the etag property: Resource etag. + * Specifies the description property: The description of the workbook.. * - * @param etag Resource etag. + * @param description The description of the workbook. * @return the next definition stage. */ - WithCreate withEtag(Map etag); - } - /** The stage of the Workbook definition allowing to specify name. */ - interface WithName { - /** - * Specifies the name property: Azure resource name. - * - * @param name Azure resource name. - * @return the next definition stage. - */ - WithCreate withName(String name); - } - /** The stage of the Workbook definition allowing to specify type. */ - interface WithType { - /** - * Specifies the type property: Azure resource type. - * - * @param type Azure resource type. - * @return the next definition stage. - */ - WithCreate withType(String type); + WithCreate withDescription(String description); } /** The stage of the Workbook definition allowing to specify sourceId. */ interface WithSourceIdParameter { @@ -387,7 +402,9 @@ interface Update UpdateStages.WithSerializedData, UpdateStages.WithCategory, UpdateStages.WithTagsPropertiesTags, - UpdateStages.WithsourceId { + UpdateStages.WithDescription, + UpdateStages.WithRevision, + UpdateStages.WithSourceId { /** * Executes the update request. * @@ -408,7 +425,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. @@ -468,15 +485,35 @@ interface WithTagsPropertiesTags { */ Update withTagsPropertiesTags(List tagsPropertiesTags); } + /** The stage of the Workbook update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the workbook.. + * + * @param description The description of the workbook. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Workbook update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: The unique revision id for this workbook definition. + * + * @param revision The unique revision id for this workbook definition. + * @return the next definition stage. + */ + Update withRevision(String revision); + } /** The stage of the Workbook update allowing to specify sourceId. */ - interface WithsourceId { + interface WithSourceId { /** * 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 sourceId(String sourceId); + Update withSourceId(String sourceId); } } /** 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/WorkbookErrorDefinition.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorDefinition.java new file mode 100644 index 0000000000000..01c6e6cacb083 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorDefinition.java @@ -0,0 +1,40 @@ +// 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.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error response. */ +@Immutable +public final class WorkbookErrorDefinition extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookErrorDefinition.class); + + /* + * Internal error details. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private Object innerError; + + /** + * Get the innerError property: Internal error details. + * + * @return the innerError value. + */ + public Object getInnerError() { + return this.innerError; + } + + /** + * 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/WorkbookErrorException.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorDefinitionException.java similarity index 51% rename from sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorException.java rename to sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookErrorDefinitionException.java index c4451f91ad985..0cdaaa4fcda74 100644 --- 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/WorkbookErrorDefinitionException.java @@ -4,34 +4,34 @@ package com.azure.resourcemanager.applicationinsights.models; -import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; -/** Exception thrown for an invalid response with WorkbookError information. */ -public final class WorkbookErrorException extends HttpResponseException { +/** Exception thrown for an invalid response with WorkbookErrorDefinition information. */ +public final class WorkbookErrorDefinitionException extends ManagementException { /** - * Initializes a new instance of the WorkbookErrorException class. + * Initializes a new instance of the WorkbookErrorDefinitionException 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) { + public WorkbookErrorDefinitionException(String message, HttpResponse response) { super(message, response); } /** - * Initializes a new instance of the WorkbookErrorException class. + * Initializes a new instance of the WorkbookErrorDefinitionException 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) { + public WorkbookErrorDefinitionException(String message, HttpResponse response, WorkbookErrorDefinition value) { super(message, response, value); } @Override - public WorkbookError getValue() { - return (WorkbookError) super.getValue(); + public WorkbookErrorDefinition getValue() { + return (WorkbookErrorDefinition) 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..1b0b7beb0abc4 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookResource.java @@ -0,0 +1,121 @@ +// 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.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An azure resource object. */ +@Fluent +public class WorkbookResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookResource.class); + + /* + * Identity used for BYOS + */ + @JsonProperty(value = "identity") + private WorkbookResourceIdentity identity; + + /* + * The kind of workbook. Choices are user and shared. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /* + * Resource etag + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the identity property: Identity used for BYOS. + * + * @return the identity value. + */ + public WorkbookResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity used for BYOS. + * + * @param identity the identity value to set. + * @return the WorkbookResource object itself. + */ + public WorkbookResource withIdentity(WorkbookResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: The kind of workbook. Choices are user and shared. + * + * @return the kind value. + */ + public Kind 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 WorkbookResource object itself. + */ + public WorkbookResource withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the etag property: Resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Resource etag. + * + * @param etag the etag value to set. + * @return the WorkbookResource object itself. + */ + public WorkbookResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@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() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookResourceIdentity.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookResourceIdentity.java new file mode 100644 index 0000000000000..fbb03b7c5ecb3 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookResourceIdentity.java @@ -0,0 +1,41 @@ +// 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 java.util.Map; + +/** Identity used for BYOS. */ +@Fluent +public class WorkbookResourceIdentity extends ManagedServiceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookResourceIdentity.class); + + /** {@inheritDoc} */ + @Override + public WorkbookResourceIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkbookResourceIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplate.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplate.java new file mode 100644 index 0000000000000..05e94ffdf1232 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplate.java @@ -0,0 +1,350 @@ +// 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.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookTemplateInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of WorkbookTemplate. */ +public interface WorkbookTemplate { + /** + * 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. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the priority property: Priority of the template. Determines which template to open when a workbook gallery + * is opened in viewer mode. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the author property: Information about the author of the workbook template. + * + * @return the author value. + */ + String author(); + + /** + * Gets the templateData property: Valid JSON object containing workbook template payload. + * + * @return the templateData value. + */ + Object templateData(); + + /** + * Gets the galleries property: Workbook galleries supported by the template. + * + * @return the galleries value. + */ + List galleries(); + + /** + * Gets the localized property: Key value pair of localized gallery. Each key is the locale code of languages + * supported by the Azure portal. + * + * @return the localized value. + */ + Map> localized(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.applicationinsights.fluent.models.WorkbookTemplateInner object. + * + * @return the inner object. + */ + WorkbookTemplateInner innerModel(); + + /** The entirety of the WorkbookTemplate definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The WorkbookTemplate definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkbookTemplate definition. */ + interface Blank extends WithLocation { + } + /** The stage of the WorkbookTemplate definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the WorkbookTemplate definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the WorkbookTemplate 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.WithTags, + DefinitionStages.WithPriority, + DefinitionStages.WithAuthor, + DefinitionStages.WithTemplateData, + DefinitionStages.WithGalleries, + DefinitionStages.WithLocalized { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkbookTemplate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkbookTemplate create(Context context); + } + /** The stage of the WorkbookTemplate definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the WorkbookTemplate definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of the template. Determines which template to open when a + * workbook gallery is opened in viewer mode.. + * + * @param priority Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + /** The stage of the WorkbookTemplate definition allowing to specify author. */ + interface WithAuthor { + /** + * Specifies the author property: Information about the author of the workbook template.. + * + * @param author Information about the author of the workbook template. + * @return the next definition stage. + */ + WithCreate withAuthor(String author); + } + /** The stage of the WorkbookTemplate definition allowing to specify templateData. */ + interface WithTemplateData { + /** + * Specifies the templateData property: Valid JSON object containing workbook template payload.. + * + * @param templateData Valid JSON object containing workbook template payload. + * @return the next definition stage. + */ + WithCreate withTemplateData(Object templateData); + } + /** The stage of the WorkbookTemplate definition allowing to specify galleries. */ + interface WithGalleries { + /** + * Specifies the galleries property: Workbook galleries supported by the template.. + * + * @param galleries Workbook galleries supported by the template. + * @return the next definition stage. + */ + WithCreate withGalleries(List galleries); + } + /** The stage of the WorkbookTemplate definition allowing to specify localized. */ + interface WithLocalized { + /** + * Specifies the localized property: Key value pair of localized gallery. Each key is the locale code of + * languages supported by the Azure portal.. + * + * @param localized Key value pair of localized gallery. Each key is the locale code of languages supported + * by the Azure portal. + * @return the next definition stage. + */ + WithCreate withLocalized(Map> localized); + } + } + /** + * Begins update for the WorkbookTemplate resource. + * + * @return the stage of resource update. + */ + WorkbookTemplate.Update update(); + + /** The template for WorkbookTemplate update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPriority, + UpdateStages.WithAuthor, + UpdateStages.WithTemplateData, + UpdateStages.WithGalleries, + UpdateStages.WithLocalized { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkbookTemplate apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkbookTemplate apply(Context context); + } + /** The WorkbookTemplate update stages. */ + interface UpdateStages { + /** The stage of the WorkbookTemplate update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the WorkbookTemplate update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of the template. Determines which template to open when a + * workbook gallery is opened in viewer mode.. + * + * @param priority Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the WorkbookTemplate update allowing to specify author. */ + interface WithAuthor { + /** + * Specifies the author property: Information about the author of the workbook template.. + * + * @param author Information about the author of the workbook template. + * @return the next definition stage. + */ + Update withAuthor(String author); + } + /** The stage of the WorkbookTemplate update allowing to specify templateData. */ + interface WithTemplateData { + /** + * Specifies the templateData property: Valid JSON object containing workbook template payload.. + * + * @param templateData Valid JSON object containing workbook template payload. + * @return the next definition stage. + */ + Update withTemplateData(Object templateData); + } + /** The stage of the WorkbookTemplate update allowing to specify galleries. */ + interface WithGalleries { + /** + * Specifies the galleries property: Workbook galleries supported by the template.. + * + * @param galleries Workbook galleries supported by the template. + * @return the next definition stage. + */ + Update withGalleries(List galleries); + } + /** The stage of the WorkbookTemplate update allowing to specify localized. */ + interface WithLocalized { + /** + * Specifies the localized property: Key value pair of localized gallery. Each key is the locale code of + * languages supported by the Azure portal.. + * + * @param localized Key value pair of localized gallery. Each key is the locale code of languages supported + * by the Azure portal. + * @return the next definition stage. + */ + Update withLocalized(Map> localized); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkbookTemplate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkbookTemplate refresh(Context context); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateGallery.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateGallery.java new file mode 100644 index 0000000000000..55b32da56f79a --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateGallery.java @@ -0,0 +1,154 @@ +// 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; + +/** Gallery information for a workbook template. */ +@Fluent +public final class WorkbookTemplateGallery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplateGallery.class); + + /* + * Name of the workbook template in the gallery. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Category for the gallery. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Type of workbook supported by the workbook template. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Order of the template within the gallery. + */ + @JsonProperty(value = "order") + private Integer order; + + /* + * Azure resource type supported by the gallery. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * Get the name property: Name of the workbook template in the gallery. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the workbook template in the gallery. + * + * @param name the name value to set. + * @return the WorkbookTemplateGallery object itself. + */ + public WorkbookTemplateGallery withName(String name) { + this.name = name; + return this; + } + + /** + * Get the category property: Category for the gallery. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: Category for the gallery. + * + * @param category the category value to set. + * @return the WorkbookTemplateGallery object itself. + */ + public WorkbookTemplateGallery withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the type property: Type of workbook supported by the workbook template. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of workbook supported by the workbook template. + * + * @param type the type value to set. + * @return the WorkbookTemplateGallery object itself. + */ + public WorkbookTemplateGallery withType(String type) { + this.type = type; + return this; + } + + /** + * Get the order property: Order of the template within the gallery. + * + * @return the order value. + */ + public Integer order() { + return this.order; + } + + /** + * Set the order property: Order of the template within the gallery. + * + * @param order the order value to set. + * @return the WorkbookTemplateGallery object itself. + */ + public WorkbookTemplateGallery withOrder(Integer order) { + this.order = order; + return this; + } + + /** + * Get the resourceType property: Azure resource type supported by the gallery. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Azure resource type supported by the gallery. + * + * @param resourceType the resourceType value to set. + * @return the WorkbookTemplateGallery object itself. + */ + public WorkbookTemplateGallery withResourceType(String resourceType) { + this.resourceType = resourceType; + 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/WorkbookTemplateLocalizedGallery.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateLocalizedGallery.java new file mode 100644 index 0000000000000..a1aa011d864c4 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateLocalizedGallery.java @@ -0,0 +1,80 @@ +// 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; +import java.util.List; + +/** Localized template data and gallery information. */ +@Fluent +public final class WorkbookTemplateLocalizedGallery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplateLocalizedGallery.class); + + /* + * Valid JSON object containing workbook template payload. + */ + @JsonProperty(value = "templateData") + private Object templateData; + + /* + * Workbook galleries supported by the template. + */ + @JsonProperty(value = "galleries") + private List galleries; + + /** + * Get the templateData property: Valid JSON object containing workbook template payload. + * + * @return the templateData value. + */ + public Object templateData() { + return this.templateData; + } + + /** + * Set the templateData property: Valid JSON object containing workbook template payload. + * + * @param templateData the templateData value to set. + * @return the WorkbookTemplateLocalizedGallery object itself. + */ + public WorkbookTemplateLocalizedGallery withTemplateData(Object templateData) { + this.templateData = templateData; + return this; + } + + /** + * Get the galleries property: Workbook galleries supported by the template. + * + * @return the galleries value. + */ + public List galleries() { + return this.galleries; + } + + /** + * Set the galleries property: Workbook galleries supported by the template. + * + * @param galleries the galleries value to set. + * @return the WorkbookTemplateLocalizedGallery object itself. + */ + public WorkbookTemplateLocalizedGallery withGalleries(List galleries) { + this.galleries = galleries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (galleries() != null) { + galleries().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateResource.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateResource.java new file mode 100644 index 0000000000000..c2f4c82be3f4f --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateResource.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.Fluent; +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. */ +@Fluent +public class WorkbookTemplateResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplateResource.class); + + /** {@inheritDoc} */ + @Override + public WorkbookTemplateResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkbookTemplateResource 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/WorkbookTemplateUpdateParameters.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateUpdateParameters.java new file mode 100644 index 0000000000000..0b8715cfa31ab --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplateUpdateParameters.java @@ -0,0 +1,193 @@ +// 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.WorkbookTemplateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters that can be provided when updating workbook template. */ +@Fluent +public final class WorkbookTemplateUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplateUpdateParameters.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Metadata describing a workbook for an Azure resource. + */ + @JsonProperty(value = "properties") + private WorkbookTemplateProperties innerProperties; + + /** + * 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 WorkbookTemplateUpdateParameters object itself. + */ + public WorkbookTemplateUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: Metadata describing a workbook for an Azure resource. + * + * @return the innerProperties value. + */ + private WorkbookTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the priority property: Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of the template. Determines which template to open when a workbook gallery is + * opened in viewer mode. + * + * @param priority the priority value to set. + * @return the WorkbookTemplateUpdateParameters object itself. + */ + public WorkbookTemplateUpdateParameters withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the author property: Information about the author of the workbook template. + * + * @return the author value. + */ + public String author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Set the author property: Information about the author of the workbook template. + * + * @param author the author value to set. + * @return the WorkbookTemplateUpdateParameters object itself. + */ + public WorkbookTemplateUpdateParameters withAuthor(String author) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withAuthor(author); + return this; + } + + /** + * Get the templateData property: Valid JSON object containing workbook template payload. + * + * @return the templateData value. + */ + public Object templateData() { + return this.innerProperties() == null ? null : this.innerProperties().templateData(); + } + + /** + * Set the templateData property: Valid JSON object containing workbook template payload. + * + * @param templateData the templateData value to set. + * @return the WorkbookTemplateUpdateParameters object itself. + */ + public WorkbookTemplateUpdateParameters withTemplateData(Object templateData) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withTemplateData(templateData); + return this; + } + + /** + * Get the galleries property: Workbook galleries supported by the template. + * + * @return the galleries value. + */ + public List galleries() { + return this.innerProperties() == null ? null : this.innerProperties().galleries(); + } + + /** + * Set the galleries property: Workbook galleries supported by the template. + * + * @param galleries the galleries value to set. + * @return the WorkbookTemplateUpdateParameters object itself. + */ + public WorkbookTemplateUpdateParameters withGalleries(List galleries) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withGalleries(galleries); + return this; + } + + /** + * Get the localized property: Key value pair of localized gallery. Each key is the locale code of languages + * supported by the Azure portal. + * + * @return the localized value. + */ + public Map> localized() { + return this.innerProperties() == null ? null : this.innerProperties().localized(); + } + + /** + * Set the localized property: Key value pair of localized gallery. Each key is the locale code of languages + * supported by the Azure portal. + * + * @param localized the localized value to set. + * @return the WorkbookTemplateUpdateParameters object itself. + */ + public WorkbookTemplateUpdateParameters withLocalized( + Map> localized) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookTemplateProperties(); + } + this.innerProperties().withLocalized(localized); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplates.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplates.java new file mode 100644 index 0000000000000..60a016aa34b5e --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplates.java @@ -0,0 +1,138 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkbookTemplates. */ +public interface WorkbookTemplates { + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all Workbook templates defined within a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all Workbook templates defined within a specified resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a single workbook template by its 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 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 template by its resourceName. + */ + WorkbookTemplate getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Get a single workbook template by its 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 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 a single workbook template by its resourceName. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Delete a workbook template. + * + * @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.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); + + /** + * Delete a workbook template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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.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, Context context); + + /** + * Get a single workbook template by its resourceName. + * + * @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 a single workbook template by its resourceName. + */ + WorkbookTemplate getById(String id); + + /** + * Get a single workbook template by its resourceName. + * + * @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 a single workbook template by its resourceName. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a workbook template. + * + * @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 a workbook template. + * + * @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 WorkbookTemplate resource. + * + * @param name resource name. + * @return the first stage of the new WorkbookTemplate definition. + */ + WorkbookTemplate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplatesListResult.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplatesListResult.java new file mode 100644 index 0000000000000..fdec9792b89b3 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookTemplatesListResult.java @@ -0,0 +1,55 @@ +// 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.WorkbookTemplateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** WorkbookTemplate list result. */ +@Fluent +public final class WorkbookTemplatesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookTemplatesListResult.class); + + /* + * An array of workbook templates. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: An array of workbook templates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of workbook templates. + * + * @param value the value value to set. + * @return the WorkbookTemplatesListResult object itself. + */ + public WorkbookTemplatesListResult withValue(List value) { + this.value = value; + 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/WorkbookUpdateParameters.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/models/WorkbookUpdateParameters.java index 3200915b3a988..cbd1811ec2629 100644 --- 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 @@ -5,17 +5,17 @@ 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.azure.resourcemanager.applicationinsights.fluent.models.WorkbookPropertiesUpdateParameters; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; 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 { +public final class WorkbookUpdateParameters { @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkbookUpdateParameters.class); /* @@ -25,36 +25,17 @@ public class WorkbookUpdateParameters { private SharedTypeKind kind; /* - * Resource tags + * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* - * The user-defined name (display name) of the workbook. + * Metadata describing a workbook for an Azure resource. */ - @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; + @JsonProperty(value = "properties") + private WorkbookPropertiesUpdateParameters innerProperties; /** * Get the kind property: The kind of workbook. Choices are user and shared. @@ -96,13 +77,22 @@ public WorkbookUpdateParameters withTags(Map tags) { return this; } + /** + * Get the innerProperties property: Metadata describing a workbook for an Azure resource. + * + * @return the innerProperties value. + */ + private WorkbookPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + /** * Get the displayName property: The user-defined name (display name) of the workbook. * * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -112,7 +102,10 @@ public String displayName() { * @return the WorkbookUpdateParameters object itself. */ public WorkbookUpdateParameters withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookPropertiesUpdateParameters(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -123,7 +116,7 @@ public WorkbookUpdateParameters withDisplayName(String displayName) { * @return the serializedData value. */ public String serializedData() { - return this.serializedData; + return this.innerProperties() == null ? null : this.innerProperties().serializedData(); } /** @@ -134,7 +127,10 @@ public String serializedData() { * @return the WorkbookUpdateParameters object itself. */ public WorkbookUpdateParameters withSerializedData(String serializedData) { - this.serializedData = serializedData; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookPropertiesUpdateParameters(); + } + this.innerProperties().withSerializedData(serializedData); return this; } @@ -144,7 +140,7 @@ public WorkbookUpdateParameters withSerializedData(String serializedData) { * @return the category value. */ public String category() { - return this.category; + return this.innerProperties() == null ? null : this.innerProperties().category(); } /** @@ -154,27 +150,79 @@ public String category() { * @return the WorkbookUpdateParameters object itself. */ public WorkbookUpdateParameters withCategory(String category) { - this.category = category; + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookPropertiesUpdateParameters(); + } + this.innerProperties().withCategory(category); return this; } /** - * Get the tagsPropertiesTags property: A list of 0 or more tags that are associated with this workbook definition. + * Get the tags property: A list of 0 or more tags that are associated with this workbook definition. * - * @return the tagsPropertiesTags value. + * @return the tags value. */ public List tagsPropertiesTags() { - return this.tagsPropertiesTags; + return this.innerProperties() == null ? null : this.innerProperties().tags(); + } + + /** + * Set the tags property: A list of 0 or more tags that are associated with this workbook definition. + * + * @param tags the tags value to set. + * @return the WorkbookUpdateParameters object itself. + */ + public WorkbookUpdateParameters withTagsPropertiesTags(List tags) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookPropertiesUpdateParameters(); + } + this.innerProperties().withTags(tags); + return this; + } + + /** + * Get the description property: The description of the workbook. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the workbook. + * + * @param description the description value to set. + * @return the WorkbookUpdateParameters object itself. + */ + public WorkbookUpdateParameters withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookPropertiesUpdateParameters(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the revision property: The unique revision id for this workbook definition. + * + * @return the revision value. + */ + public String revision() { + return this.innerProperties() == null ? null : this.innerProperties().revision(); } /** - * Set the tagsPropertiesTags property: A list of 0 or more tags that are associated with this workbook definition. + * Set the revision property: The unique revision id for this workbook definition. * - * @param tagsPropertiesTags the tagsPropertiesTags value to set. + * @param revision the revision value to set. * @return the WorkbookUpdateParameters object itself. */ - public WorkbookUpdateParameters withTagsPropertiesTags(List tagsPropertiesTags) { - this.tagsPropertiesTags = tagsPropertiesTags; + public WorkbookUpdateParameters withRevision(String revision) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkbookPropertiesUpdateParameters(); + } + this.innerProperties().withRevision(revision); return this; } @@ -184,5 +232,8 @@ public WorkbookUpdateParameters withTagsPropertiesTags(List tagsProperti * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().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..1ddaa0cda3a99 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 @@ -16,8 +16,8 @@ public interface Workbooks { * * @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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -32,8 +32,8 @@ public interface Workbooks { * 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -45,8 +45,8 @@ public interface Workbooks { * @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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -63,8 +63,8 @@ public interface Workbooks { * 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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. */ @@ -82,8 +82,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +96,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +109,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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,20 +122,77 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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, Context context); + /** + * Get the revisions for the workbook defined by its 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 com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the + * request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + PagedIterable revisionsList(String resourceGroupName, String resourceName); + + /** + * Get the revisions for the workbook defined by its 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException thrown if the + * request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the revisions for the workbook defined by its resourceName. + */ + PagedIterable revisionsList(String resourceGroupName, String resourceName, Context context); + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + Workbook revisionGet(String resourceGroupName, String resourceName, String revisionId); + + /** + * Get a single workbook revision defined by its revisionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the Application Insights component resource. + * @param revisionId The id of the workbook's revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 revision defined by its revisionId. + */ + Response revisionGetWithResponse( + String resourceGroupName, String resourceName, String revisionId, Context context); + /** * Get a single workbook by its resourceName. * * @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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +204,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +216,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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 +228,8 @@ 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.resourcemanager.applicationinsights.models.WorkbookErrorDefinitionException 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/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsDeleteSamples.java new file mode 100644 index 0000000000000..9475cd6995334 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsDeleteSamples.java @@ -0,0 +1,32 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; + +/** Samples for AnalyticsItems Delete. */ +public final class AnalyticsItemsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemDelete.json + */ + /** + * Sample code: AnalyticsItemDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .deleteWithResponse( + "my-resource-group", + "my-component", + ItemScopePath.ANALYTICS_ITEMS, + "3466c160-4a10-4df8-afdf-0007f3f6dee5", + null, + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsGetSamples.java new file mode 100644 index 0000000000000..b51f4f3b36a62 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsGetSamples.java @@ -0,0 +1,32 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; + +/** Samples for AnalyticsItems Get. */ +public final class AnalyticsItemsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemGet.json + */ + /** + * Sample code: AnalyticsItemGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .getWithResponse( + "my-resource-group", + "my-component", + ItemScopePath.ANALYTICS_ITEMS, + "3466c160-4a10-4df8-afdf-0007f3f6dee5", + null, + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsListSamples.java new file mode 100644 index 0000000000000..1e60d39e3ca67 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsListSamples.java @@ -0,0 +1,27 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; + +/** Samples for AnalyticsItems List. */ +public final class AnalyticsItemsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemList.json + */ + /** + * Sample code: AnalyticsItemList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .listWithResponse( + "my-resource-group", "my-component", ItemScopePath.ANALYTICS_ITEMS, null, null, null, Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsPutSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsPutSamples.java new file mode 100644 index 0000000000000..8c43a1317d74c --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnalyticsItemsPutSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentAnalyticsItemInner; +import com.azure.resourcemanager.applicationinsights.models.ItemScope; +import com.azure.resourcemanager.applicationinsights.models.ItemScopePath; +import com.azure.resourcemanager.applicationinsights.models.ItemType; + +/** Samples for AnalyticsItems Put. */ +public final class AnalyticsItemsPutSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemPut.json + */ + /** + * Sample code: AnalyticsItemPut. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void analyticsItemPut( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .analyticsItems() + .putWithResponse( + "my-resource-group", + "my-component", + ItemScopePath.ANALYTICS_ITEMS, + new ApplicationInsightsComponentAnalyticsItemInner() + .withName("Exceptions - New in the last 24 hours") + .withContent( + "let newExceptionsTimeRange = 1d;\n" + + "let timeRangeToCheckBefore = 7d;\n" + + "exceptions\n" + + "| where timestamp < ago(timeRangeToCheckBefore)\n" + + "| summarize count() by problemId\n" + + "| join kind= rightanti (\n" + + "exceptions\n" + + "| where timestamp >= ago(newExceptionsTimeRange)\n" + + "| extend stack = tostring(details[0].rawStack)\n" + + "| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp)," + + " any(stack) by problemId \n" + + ") on problemId \n" + + "| order by count_ desc\n") + .withScope(ItemScope.SHARED) + .withType(ItemType.QUERY), + null, + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsCreateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsCreateSamples.java new file mode 100644 index 0000000000000..bbb6e92110f2c --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsCreateSamples.java @@ -0,0 +1,36 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.AnnotationInner; +import java.time.OffsetDateTime; + +/** Samples for Annotations Create. */ +public final class AnnotationsCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsCreate.json + */ + /** + * Sample code: AnnotationsCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .createWithResponse( + "my-resource-group", + "my-component", + new AnnotationInner() + .withAnnotationName("TestAnnotation") + .withCategory("Text") + .withEventTime(OffsetDateTime.parse("2018-01-31T13:41:38.657Z")) + .withId("444e2c08-274a-4bbb-a89e-d77bb720f44a") + .withProperties("{\"Comments\":\"Testing\",\"Label\":\"Success\"}"), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsDeleteSamples.java new file mode 100644 index 0000000000000..c10eee1deae09 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsDeleteSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Annotations Delete. */ +public final class AnnotationsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsDelete.json + */ + /** + * Sample code: AnnotationsDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .deleteWithResponse( + "my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsGetSamples.java new file mode 100644 index 0000000000000..1f3c2d1fa11a6 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Annotations Get. */ +public final class AnnotationsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsGet.json + */ + /** + * Sample code: AnnotationsGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .getWithResponse("my-resource-group", "my-component", "444e2c08-274a-4bbb-a89e-d77bb720f44a", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsListSamples.java new file mode 100644 index 0000000000000..4d9ec4a423963 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/AnnotationsListSamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Annotations List. */ +public final class AnnotationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsList.json + */ + /** + * Sample code: AnnotationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void annotationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .annotations() + .list( + "my-resource-group", + "my-component", + "2018-02-05T00%3A30%3A00.000Z", + "2018-02-06T00%3A33A00.000Z", + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysCreateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysCreateSamples.java new file mode 100644 index 0000000000000..21241b5f0f677 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysCreateSamples.java @@ -0,0 +1,40 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApiKeyRequest; +import java.util.Arrays; + +/** Samples for ApiKeys Create. */ +public final class ApiKeysCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysCreate.json + */ + /** + * Sample code: APIKeyCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeyCreate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .apiKeys() + .createWithResponse( + "my-resource-group", + "my-component", + new ApiKeyRequest() + .withName("test2") + .withLinkedReadProperties( + Arrays + .asList( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api", + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")) + .withLinkedWriteProperties( + Arrays + .asList( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/annotations")), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysDeleteSamples.java new file mode 100644 index 0000000000000..bac181592b528 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ApiKeys Delete. */ +public final class ApiKeysDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysDelete.json + */ + /** + * Sample code: APIKeyDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeyDelete(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .apiKeys() + .deleteWithResponse( + "my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysGetSamples.java new file mode 100644 index 0000000000000..79fa85033a018 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ApiKeys Get. */ +public final class ApiKeysGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysGet.json + */ + /** + * Sample code: APIKeysGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeysGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .apiKeys() + .getWithResponse("my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysListSamples.java new file mode 100644 index 0000000000000..4c2518386d08c --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ApiKeysListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ApiKeys List. */ +public final class ApiKeysListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysList.json + */ + /** + * Sample code: APIKeysList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void aPIKeysList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.apiKeys().list("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentAvailableFeaturesGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentAvailableFeaturesGetSamples.java new file mode 100644 index 0000000000000..8387c5eac2237 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentAvailableFeaturesGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ComponentAvailableFeatures Get. */ +public final class ComponentAvailableFeaturesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AvailableBillingFeaturesGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentAvailableFeatures().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentCurrentBillingFeaturesGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentCurrentBillingFeaturesGetSamples.java new file mode 100644 index 0000000000000..17a243961b7e1 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentCurrentBillingFeaturesGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ComponentCurrentBillingFeatures Get. */ +public final class ComponentCurrentBillingFeaturesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentCurrentBillingFeatures().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentCurrentBillingFeaturesUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentCurrentBillingFeaturesUpdateSamples.java new file mode 100644 index 0000000000000..7228e5ce803bf --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentCurrentBillingFeaturesUpdateSamples.java @@ -0,0 +1,37 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentBillingFeaturesInner; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap; +import java.util.Arrays; + +/** Samples for ComponentCurrentBillingFeatures Update. */ +public final class ComponentCurrentBillingFeaturesUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesUpdate.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentCurrentBillingFeatures() + .updateWithResponse( + "my-resource-group", + "my-component", + new ApplicationInsightsComponentBillingFeaturesInner() + .withDataVolumeCap( + new ApplicationInsightsComponentDataVolumeCap() + .withCap(100.0f) + .withStopSendNotificationWhenHitCap(true)) + .withCurrentBillingFeatures(Arrays.asList("Basic", "Application Insights Enterprise")), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentFeatureCapabilitiesGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentFeatureCapabilitiesGetSamples.java new file mode 100644 index 0000000000000..4ca5872e0e8fa --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentFeatureCapabilitiesGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ComponentFeatureCapabilities Get. */ +public final class ComponentFeatureCapabilitiesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FeatureCapabilitiesGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentFeatureCapabilities().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationCreateAndUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationCreateAndUpdateSamples.java new file mode 100644 index 0000000000000..a513b649a58d9 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationCreateAndUpdateSamples.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation CreateAndUpdate. */ +public final class ComponentLinkedStorageAccountsOperationCreateAndUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsCreateAndUpdate.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsCreateAndUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsCreateAndUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentLinkedStorageAccountsOperations() + .define(StorageType.SERVICE_PROFILER) + .withExistingComponent("someResourceGroupName", "myComponent") + .withLinkedStorageAccount( + "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname") + .create(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationDeleteSamples.java new file mode 100644 index 0000000000000..08db666a18789 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationDeleteSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation Delete. */ +public final class ComponentLinkedStorageAccountsOperationDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsDelete.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentLinkedStorageAccountsOperations() + .deleteWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER, Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationGetSamples.java new file mode 100644 index 0000000000000..b75fe1c548ef2 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationGetSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation Get. */ +public final class ComponentLinkedStorageAccountsOperationGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsGet.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .componentLinkedStorageAccountsOperations() + .getWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER, Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationUpdateSamples.java new file mode 100644 index 0000000000000..41ed81c453dc3 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentLinkedStorageAccountsOperationUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ComponentLinkedStorageAccounts; +import com.azure.resourcemanager.applicationinsights.models.StorageType; + +/** Samples for ComponentLinkedStorageAccountsOperation Update. */ +public final class ComponentLinkedStorageAccountsOperationUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsUpdate.json + */ + /** + * Sample code: ComponentLinkedStorageAccountsUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentLinkedStorageAccountsUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + ComponentLinkedStorageAccounts resource = + manager + .componentLinkedStorageAccountsOperations() + .getWithResponse("someResourceGroupName", "myComponent", StorageType.SERVICE_PROFILER, Context.NONE) + .getValue(); + resource + .update() + .withLinkedStorageAccount( + "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname") + .apply(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentQuotaStatusGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentQuotaStatusGetSamples.java new file mode 100644 index 0000000000000..2f90d13253c56 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentQuotaStatusGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ComponentQuotaStatus Get. */ +public final class ComponentQuotaStatusGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/QuotaStatusGet.json + */ + /** + * Sample code: ComponentCurrentBillingFeaturesGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCurrentBillingFeaturesGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.componentQuotaStatus().getWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsCreateOrUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4dfec1da00316 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsCreateOrUpdateSamples.java @@ -0,0 +1,67 @@ +// 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.generated; + +import com.azure.resourcemanager.applicationinsights.models.ApplicationType; +import com.azure.resourcemanager.applicationinsights.models.FlowType; +import com.azure.resourcemanager.applicationinsights.models.RequestSource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Components CreateOrUpdate. */ +public final class ComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsCreate.json + */ + /** + * Sample code: ComponentCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .define("my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind("web") + .withApplicationType(ApplicationType.WEB) + .withFlowType(FlowType.BLUEFIELD) + .withRequestSource(RequestSource.REST) + .create(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsUpdate.json + */ + /** + * Sample code: ComponentUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .define("my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind("web") + .withTags(mapOf("ApplicationGatewayType", "Internal-Only", "BillingEntity", "Self")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsDeleteSamples.java new file mode 100644 index 0000000000000..a92f61bb32f60 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Components Delete. */ +public final class ComponentsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsDelete.json + */ + /** + * Sample code: ComponentsDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentsDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().deleteWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsGetByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..3e5d0a16e961d --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Components GetByResourceGroup. */ +public final class ComponentsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsGet.json + */ + /** + * Sample code: ComponentGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().getByResourceGroupWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsGetPurgeStatusSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsGetPurgeStatusSamples.java new file mode 100644 index 0000000000000..45523ea979e8b --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsGetPurgeStatusSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Components GetPurgeStatus. */ +public final class ComponentsGetPurgeStatusSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsPurgeStatus.json + */ + /** + * Sample code: ComponentPurge. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentPurge( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .getPurgeStatusWithResponse( + "OIAutoRest5123", "aztest5048", "purge-970318e7-b859-4edb-8903-83b1b54d0b74", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsListByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..8964d42427ed8 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Components ListByResourceGroup. */ +public final class ComponentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsListByResourceGroup.json + */ + /** + * Sample code: ComponentListByResourceGroup. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentListByResourceGroup( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().listByResourceGroup("my-resource-group", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsListSamples.java new file mode 100644 index 0000000000000..ed60c42109e98 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Components List. */ +public final class ComponentsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsList.json + */ + /** + * Sample code: ComponentsList.json. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentsListJson( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.components().list(Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsPurgeSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsPurgeSamples.java new file mode 100644 index 0000000000000..3baa461c33ac0 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsPurgeSamples.java @@ -0,0 +1,40 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ComponentPurgeBody; +import com.azure.resourcemanager.applicationinsights.models.ComponentPurgeBodyFilters; +import java.util.Arrays; + +/** Samples for Components Purge. */ +public final class ComponentsPurgeSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsPurge.json + */ + /** + * Sample code: ComponentPurge. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentPurge( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .components() + .purgeWithResponse( + "OIAutoRest5123", + "aztest5048", + new ComponentPurgeBody() + .withTable("Heartbeat") + .withFilters( + Arrays + .asList( + new ComponentPurgeBodyFilters() + .withColumn("TimeGenerated") + .withOperator(">") + .withValue("2017-09-01T00:00:00"))), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsUpdateTagsSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsUpdateTagsSamples.java new file mode 100644 index 0000000000000..04ed7a03236e1 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ComponentsUpdateTagsSamples.java @@ -0,0 +1,56 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponent; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Components UpdateTags. */ +public final class ComponentsUpdateTagsSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/examples/ComponentsUpdateTagsOnly.json + */ + /** + * Sample code: ComponentUpdateTagsOnly. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void componentUpdateTagsOnly( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + ApplicationInsightsComponent resource = + manager + .components() + .getByResourceGroupWithResponse("my-resource-group", "my-component", Context.NONE) + .getValue(); + resource + .update() + .withTags( + mapOf( + "ApplicationGatewayType", + "Internal-Only", + "BillingEntity", + "Self", + "Color", + "AzureBlue", + "CustomField_01", + "Custom text in some random field named randomly", + "NodeType", + "Edge")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsCreateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsCreateSamples.java new file mode 100644 index 0000000000000..160d6afa030ee --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsCreateSamples.java @@ -0,0 +1,43 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentExportRequest; + +/** Samples for ExportConfigurations Create. */ +public final class ExportConfigurationsCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsPost.json + */ + /** + * Sample code: ExportConfigurationPost. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationPost( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .createWithResponse( + "my-resource-group", + "my-component", + new ApplicationInsightsComponentExportRequest() + .withRecordTypes( + "Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd," + + " PerformanceCounters, Availability") + .withDestinationType("Blob") + .withDestinationAddress( + "https://mystorageblob.blob.core.windows.net/testexport?sv=2015-04-05&sr=c&sig=token") + .withIsEnabled("true") + .withNotificationQueueEnabled("false") + .withNotificationQueueUri("") + .withDestinationStorageSubscriptionId("subid") + .withDestinationStorageLocationId("eastus") + .withDestinationAccountId( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..1c8f16641a957 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ExportConfigurations Delete. */ +public final class ExportConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationDelete.json + */ + /** + * Sample code: ExportConfigurationDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .deleteWithResponse("my-resource-group", "my-component", "uGOoki0jQsyEs3IdQ83Q4QsNr4=", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsGetSamples.java new file mode 100644 index 0000000000000..d8d28cab4e0e6 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ExportConfigurations Get. */ +public final class ExportConfigurationsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationGet.json + */ + /** + * Sample code: ExportConfigurationGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .getWithResponse("my-resource-group", "my-component", "uGOoki0jQsyEs3IdQ83Q4QsNr4=", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsListSamples.java new file mode 100644 index 0000000000000..6760b658773bc --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ExportConfigurations List. */ +public final class ExportConfigurationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsList.json + */ + /** + * Sample code: ExportConfigurationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.exportConfigurations().listWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsUpdateSamples.java new file mode 100644 index 0000000000000..81e9d4702c2d1 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ExportConfigurationsUpdateSamples.java @@ -0,0 +1,44 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentExportRequest; + +/** Samples for ExportConfigurations Update. */ +public final class ExportConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationUpdate.json + */ + /** + * Sample code: ExportConfigurationUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void exportConfigurationUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .exportConfigurations() + .updateWithResponse( + "my-resource-group", + "my-component", + "uGOoki0jQsyEs3IdQ83Q4QsNr4=", + new ApplicationInsightsComponentExportRequest() + .withRecordTypes( + "Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd," + + " PerformanceCounters, Availability") + .withDestinationType("Blob") + .withDestinationAddress( + "https://mystorageblob.blob.core.windows.net/fchentest?sv=2015-04-05&sr=c&sig=token") + .withIsEnabled("true") + .withNotificationQueueEnabled("false") + .withNotificationQueueUri("") + .withDestinationStorageSubscriptionId("subid") + .withDestinationStorageLocationId("eastus") + .withDestinationAccountId( + "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesAddSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesAddSamples.java new file mode 100644 index 0000000000000..4bac930220a2b --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesAddSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentFavoriteInner; +import com.azure.resourcemanager.applicationinsights.models.FavoriteType; +import java.util.Arrays; + +/** Samples for Favorites Add. */ +public final class FavoritesAddSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteAdd.json + */ + /** + * Sample code: FavoriteAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteAdd(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .addWithResponse( + "my-resource-group", + "my-ai-component", + "deadb33f-8bee-4d3b-a059-9be8dac93960", + new ApplicationInsightsComponentFavoriteInner() + .withName("Blah Blah Blah") + .withConfig( + "{\"MEDataModelRawJSON\":\"{\\n" + + " \\\"version\\\": \\\"1.4.1\\\",\\n" + + " \\\"isCustomDataModel\\\": true,\\n" + + " \\\"items\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\n" + + " \\\"chartType\\\": \\\"Area\\\",\\n" + + " \\\"chartHeight\\\": 4,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"preview/requests/count\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Sum\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": false,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"aggregation\\\": \\\"Sum\\\",\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"fail\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\n" + + " \\\"chartType\\\": \\\"Area\\\",\\n" + + " \\\"chartHeight\\\": 2,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"preview/requests/duration\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Avg\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-j1\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": false,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"aggregation\\\": \\\"Avg\\\",\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"greenHues\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\n" + + " \\\"chartType\\\": \\\"Bar\\\",\\n" + + " \\\"chartHeight\\\": 4,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"preview/requests/duration\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Avg\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": false,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"aggregation\\\": \\\"Avg\\\",\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"magentaHues\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\n" + + " \\\"grouping\\\": {\\n" + + " \\\"kind\\\": \\\"ByDimension\\\",\\n" + + " \\\"dimension\\\": \\\"context.application.version\\\"\\n" + + " },\\n" + + " \\\"chartType\\\": \\\"Grid\\\",\\n" + + " \\\"chartHeight\\\": 1,\\n" + + " \\\"metrics\\\": [\\n" + + " {\\n" + + " \\\"id\\\": \\\"basicException.count\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Sum\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-g0\\\"\\n" + + " },\\n" + + " {\\n" + + " \\\"id\\\": \\\"requestFailed.count\\\",\\n" + + " \\\"metricAggregation\\\": \\\"Sum\\\",\\n" + + " \\\"color\\\": \\\"msportalfx-bgcolor-f0s2\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"priorPeriod\\\": true,\\n" + + " \\\"clickAction\\\": {\\n" + + " \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n" + + " },\\n" + + " \\\"horizontalBars\\\": true,\\n" + + " \\\"showOther\\\": true,\\n" + + " \\\"percentage\\\": false,\\n" + + " \\\"palette\\\": \\\"blueHues\\\",\\n" + + " \\\"yAxisOption\\\": 0,\\n" + + " \\\"title\\\": \\\"\\\"\\n" + + " }\\n" + + " ],\\n" + + " \\\"currentFilter\\\": {\\n" + + " \\\"eventTypes\\\": [\\n" + + " 1,\\n" + + " 2\\n" + + " ],\\n" + + " \\\"typeFacets\\\": {},\\n" + + " \\\"isPermissive\\\": false\\n" + + " },\\n" + + " \\\"timeContext\\\": {\\n" + + " \\\"durationMs\\\": 75600000,\\n" + + " \\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\n" + + " \\\"createdTime\\\": \\\"2018-01-31T23:54:26.280Z\\\",\\n" + + " \\\"isInitialTime\\\": false,\\n" + + " \\\"grain\\\": 1,\\n" + + " \\\"useDashboardTimeRange\\\": false\\n" + + " },\\n" + + " \\\"jsonUri\\\": \\\"Favorite_BlankChart\\\",\\n" + + " \\\"timeSource\\\": 0\\n" + + "}\"}") + .withVersion("ME") + .withFavoriteType(FavoriteType.SHARED) + .withTags(Arrays.asList("TagSample01", "TagSample02")) + .withIsGeneratedFromTemplate(false), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesDeleteSamples.java new file mode 100644 index 0000000000000..365376ea60a97 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Favorites Delete. */ +public final class FavoritesDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteDelete.json + */ + /** + * Sample code: FavoriteList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .deleteWithResponse( + "my-resource-group", "my-ai-component", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesGetSamples.java new file mode 100644 index 0000000000000..e109d5eaf0703 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Favorites Get. */ +public final class FavoritesGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteGet.json + */ + /** + * Sample code: FavoriteGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .getWithResponse( + "my-resource-group", "my-ai-component", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesListSamples.java new file mode 100644 index 0000000000000..203d8a93d7325 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesListSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Favorites List. */ +public final class FavoritesListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoritesList.json + */ + /** + * Sample code: FavoritesList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoritesList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .listWithResponse("my-resource-group", "my-ai-component", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesUpdateSamples.java new file mode 100644 index 0000000000000..547253408fc19 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/FavoritesUpdateSamples.java @@ -0,0 +1,78 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentFavoriteInner; +import com.azure.resourcemanager.applicationinsights.models.FavoriteType; +import java.util.Arrays; + +/** Samples for Favorites Update. */ +public final class FavoritesUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteUpdate.json + */ + /** + * Sample code: FavoriteList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void favoriteList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .favorites() + .updateWithResponse( + "my-resource-group", + "my-ai-component", + "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", + new ApplicationInsightsComponentFavoriteInner() + .withName("Derek Changed This") + .withConfig( + "{\"MEDataModelRawJSON\":\"{\\\"version\\\": \\\"1.4.1\\\",\\\"isCustomDataModel\\\":" + + " true,\\\"items\\\": [{\\\"id\\\":" + + " \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\\"chartType\\\":" + + " \\\"Area\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"preview/requests/count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Sum\\\",\\\"percentage\\\":" + + " false,\\\"palette\\\": \\\"fail\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"},{\\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\\"chartType\\\":" + + " \\\"Area\\\",\\\"chartHeight\\\": 2,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-j1\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\":" + + " false,\\\"palette\\\": \\\"greenHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"},{\\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\\"chartType\\\":" + + " \\\"Bar\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\":" + + " false,\\\"palette\\\": \\\"magentaHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"},{\\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\\"grouping\\\":" + + " {\\\"kind\\\": \\\"ByDimension\\\",\\\"dimension\\\":" + + " \\\"context.application.version\\\"},\\\"chartType\\\":" + + " \\\"Grid\\\",\\\"chartHeight\\\": 1,\\\"metrics\\\": [{\\\"id\\\":" + + " \\\"basicException.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-g0\\\"},{\\\"id\\\":" + + " \\\"requestFailed.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\":" + + " \\\"msportalfx-bgcolor-f0s2\\\"}],\\\"priorPeriod\\\": true,\\\"clickAction\\\":" + + " {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\":" + + " true,\\\"showOther\\\": true,\\\"percentage\\\": false,\\\"palette\\\":" + + " \\\"blueHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\":" + + " \\\"\\\"}],\\\"currentFilter\\\": {\\\"eventTypes\\\": [1,2],\\\"typeFacets\\\":" + + " {},\\\"isPermissive\\\": false},\\\"timeContext\\\": {\\\"durationMs\\\":" + + " 75600000,\\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\\"createdTime\\\":" + + " \\\"2018-01-31T23:54:26.280Z\\\",\\\"isInitialTime\\\": false,\\\"grain\\\":" + + " 1,\\\"useDashboardTimeRange\\\": false},\\\"jsonUri\\\":" + + " \\\"Favorite_BlankChart\\\",\\\"timeSource\\\": 0}\"}") + .withVersion("ME") + .withFavoriteType(FavoriteType.SHARED) + .withTags(Arrays.asList("TagSample01", "TagSample02", "TagSample03")) + .withIsGeneratedFromTemplate(false), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/LiveTokenGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/LiveTokenGetSamples.java new file mode 100644 index 0000000000000..0f9071a0d860a --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/LiveTokenGetSamples.java @@ -0,0 +1,27 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for LiveToken Get. */ +public final class LiveTokenGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-06-02-preview/examples/LiveTokenGet.json + */ + /** + * Sample code: Get live token for resource. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void getLiveTokenForResource( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .liveTokens() + .getWithResponse( + "subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/FabrikamFiberApp/providers/microsoft.insights/components/CustomAvailabilityTest/providers/microsoft.insights/generatelivetoken", + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksCreateOrUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4b7e7f77e8846 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.applicationinsights.models.Kind; + +/** Samples for MyWorkbooks CreateOrUpdate. */ +public final class MyWorkbooksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookAdd.json + */ + /** + * Sample code: WorkbookAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookAdd(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .define("deadb33f-8bee-4d3b-a059-9be8dac93960") + .withRegion("west us") + .withExistingResourceGroup("my-resource-group") + .withName("deadb33f-8bee-4d3b-a059-9be8dac93960") + .withKind(Kind.USER) + .withDisplayName("Blah Blah Blah") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r" + + "\\n" + + "---\\r" + + "\\n" + + "\\r" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\r" + + "\\n" + + "\\r" + + "\\n" + + "\\r" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below each" + + " section to configure it or add more" + + " sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}") + .withCategory("workbook") + .withSourceId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens") + .create(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksDeleteSamples.java new file mode 100644 index 0000000000000..d6f5cf696107f --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for MyWorkbooks Delete. */ +public final class MyWorkbooksDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookDelete.json + */ + /** + * Sample code: WorkbookDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .deleteWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksGetByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1518d0feb161d --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksGetByResourceGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for MyWorkbooks GetByResourceGroup. */ +public final class MyWorkbooksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookGet.json + */ + /** + * Sample code: WorkbookGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksListByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ab7a76f4971d2 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksListByResourceGroupSamples.java @@ -0,0 +1,40 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for MyWorkbooks ListByResourceGroup. */ +public final class MyWorkbooksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.json + */ + /** + * Sample code: WorkbooksList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .listByResourceGroup("my-resource-group", CategoryType.WORKBOOK, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList2.json + */ + /** + * Sample code: WorkbooksList2. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList2( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .myWorkbooks() + .listByResourceGroup("my-resource-group", CategoryType.WORKBOOK, null, null, null, Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksListSamples.java new file mode 100644 index 0000000000000..c41b388734726 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksListSamples.java @@ -0,0 +1,36 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for MyWorkbooks List. */ +public final class MyWorkbooksListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.json + */ + /** + * Sample code: WorkbooksList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.myWorkbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList2.json + */ + /** + * Sample code: WorkbooksList2. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList2( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.myWorkbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksUpdateSamples.java new file mode 100644 index 0000000000000..d6adf0df9e37a --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/MyWorkbooksUpdateSamples.java @@ -0,0 +1,59 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.Kind; +import com.azure.resourcemanager.applicationinsights.models.MyWorkbook; + +/** Samples for MyWorkbooks Update. */ +public final class MyWorkbooksUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookUpdate.json + */ + /** + * Sample code: WorkbookUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + MyWorkbook resource = + manager + .myWorkbooks() + .getByResourceGroupWithResponse( + "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE) + .getValue(); + resource + .update() + .withKind(Kind.USER) + .withDisplayName("Blah Blah Blah") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r" + + "\\n" + + "---\\r" + + "\\n" + + "\\r" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\r" + + "\\n" + + "\\r" + + "\\n" + + "\\r" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below each" + + " section to configure it or add more" + + " sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}") + .withVersion("ME") + .withCategory("workbook") + .withSourceId( + "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens") + .apply(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsGetSamples.java new file mode 100644 index 0000000000000..88f252ff84a1d --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ProactiveDetectionConfigurations Get. */ +public final class ProactiveDetectionConfigurationsGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationGet.json + */ + /** + * Sample code: ProactiveDetectionConfigurationGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void proactiveDetectionConfigurationGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .proactiveDetectionConfigurations() + .getWithResponse("my-resource-group", "my-component", "slowpageloadtime", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsListSamples.java new file mode 100644 index 0000000000000..84d96d20a045b --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ProactiveDetectionConfigurations List. */ +public final class ProactiveDetectionConfigurationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationsList.json + */ + /** + * Sample code: ProactiveDetectionConfigurationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void proactiveDetectionConfigurationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.proactiveDetectionConfigurations().listWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsUpdateSamples.java new file mode 100644 index 0000000000000..eac67d26981ce --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/ProactiveDetectionConfigurationsUpdateSamples.java @@ -0,0 +1,48 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentProactiveDetectionConfigurationInner; +import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions; +import java.util.Arrays; + +/** Samples for ProactiveDetectionConfigurations Update. */ +public final class ProactiveDetectionConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationUpdate.json + */ + /** + * Sample code: ProactiveDetectionConfigurationUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void proactiveDetectionConfigurationUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .proactiveDetectionConfigurations() + .updateWithResponse( + "my-resource-group", + "my-component", + "slowpageloadtime", + new ApplicationInsightsComponentProactiveDetectionConfigurationInner() + .withName("slowpageloadtime") + .withEnabled(true) + .withSendEmailsToSubscriptionOwners(true) + .withCustomEmails(Arrays.asList("foo@microsoft.com", "foo2@microsoft.com")) + .withRuleDefinitions( + new ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions() + .withName("slowpageloadtime") + .withDisplayName("Slow page load time") + .withDescription("Smart Detection rules notify you of performance anomaly issues.") + .withHelpUrl( + "https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics") + .withIsHidden(false) + .withIsEnabledByDefault(true) + .withIsInPreview(false) + .withSupportsEmailNotifications(true)), + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestLocationsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestLocationsListSamples.java new file mode 100644 index 0000000000000..b91319f89e3cc --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestLocationsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WebTestLocations List. */ +public final class WebTestLocationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestLocationsList.json + */ + /** + * Sample code: WebTestLocationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestLocationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTestLocations().list("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsCreateOrUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..cbc0a86802669 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsCreateOrUpdateSamples.java @@ -0,0 +1,96 @@ +// 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.generated; + +import com.azure.resourcemanager.applicationinsights.models.WebTestGeolocation; +import com.azure.resourcemanager.applicationinsights.models.WebTestKind; +import com.azure.resourcemanager.applicationinsights.models.WebTestPropertiesConfiguration; +import java.util.Arrays; + +/** Samples for WebTests CreateOrUpdate. */ +public final class WebTestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestCreate.json + */ + /** + * Sample code: webTestCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestCreate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .webTests() + .define("my-webtest-my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind(WebTestKind.PING) + .withSyntheticMonitorId("my-webtest-my-component") + .withWebTestName("my-webtest-my-component") + .withDescription("Ping web test alert for mytestwebapp") + .withEnabled(true) + .withFrequency(900) + .withTimeout(120) + .withWebTestKind(WebTestKind.PING) + .withRetryEnabled(true) + .withLocations(Arrays.asList(new WebTestGeolocation().withLocation("us-fl-mia-edge"))) + .withConfiguration( + new WebTestPropertiesConfiguration() + .withWebTest( + "")) + .create(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestUpdate.json + */ + /** + * Sample code: webTestUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestUpdate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .webTests() + .define("my-webtest-my-component") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withKind(WebTestKind.PING) + .withSyntheticMonitorId("my-webtest-my-component") + .withWebTestName("my-webtest-my-component") + .withFrequency(600) + .withTimeout(30) + .withWebTestKind(WebTestKind.PING) + .withLocations( + Arrays + .asList( + new WebTestGeolocation().withLocation("us-fl-mia-edge"), + new WebTestGeolocation().withLocation("apac-hk-hkn-azr"))) + .withConfiguration( + new WebTestPropertiesConfiguration() + .withWebTest( + "")) + .create(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsDeleteSamples.java new file mode 100644 index 0000000000000..dd155f43ccc2c --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WebTests Delete. */ +public final class WebTestsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestDelete.json + */ + /** + * Sample code: webTestDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestDelete(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().deleteWithResponse("my-resource-group", "my-webtest-01-mywebservice", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsGetByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..122f03a6a80c4 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsGetByResourceGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for WebTests GetByResourceGroup. */ +public final class WebTestsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestGet.json + */ + /** + * Sample code: webTestGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .webTests() + .getByResourceGroupWithResponse("my-resource-group", "my-webtest-01-mywebservice", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListByComponentSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListByComponentSamples.java new file mode 100644 index 0000000000000..71a428618a750 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListByComponentSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WebTests ListByComponent. */ +public final class WebTestsListByComponentSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByComponent.json + */ + /** + * Sample code: webTestListByComponent. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestListByComponent( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().listByComponent("my-component", "my-resource-group", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d8e5d1e361504 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WebTests ListByResourceGroup. */ +public final class WebTestsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByResourceGroup.json + */ + /** + * Sample code: webTestListByResourceGroup. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestListByResourceGroup( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().listByResourceGroup("my-resource-group", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListSamples.java new file mode 100644 index 0000000000000..16668f68094c3 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WebTests List. */ +public final class WebTestsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestList.json + */ + /** + * Sample code: webTestList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.webTests().list(Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsUpdateTagsSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsUpdateTagsSamples.java new file mode 100644 index 0000000000000..1406204a3ef1b --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WebTestsUpdateTagsSamples.java @@ -0,0 +1,56 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WebTest; +import java.util.HashMap; +import java.util.Map; + +/** Samples for WebTests UpdateTags. */ +public final class WebTestsUpdateTagsSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestUpdateTagsOnly.json + */ + /** + * Sample code: webTestUpdateTags. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void webTestUpdateTags( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + WebTest resource = + manager + .webTests() + .getByResourceGroupWithResponse("my-resource-group", "my-webtest-my-component", Context.NONE) + .getValue(); + resource + .update() + .withTags( + mapOf( + "Color", + "AzureBlue", + "CustomField-01", + "This is a random value", + "SystemType", + "A08", + "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component", + "Resource", + "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp", + "Resource")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsCreateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsCreateSamples.java new file mode 100644 index 0000000000000..17d873d818645 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsCreateSamples.java @@ -0,0 +1,48 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WorkItemCreateConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for WorkItemConfigurations Create. */ +public final class WorkItemConfigurationsCreateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigCreate.json + */ + /** + * Sample code: WorkItemConfigurationsCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .createWithResponse( + "my-resource-group", + "my-component", + new WorkItemCreateConfiguration() + .withConnectorId("d334e2a4-6733-488e-8645-a9fdc1694f41") + .withConnectorDataConfiguration( + "{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}") + .withValidateOnly(true) + .withWorkItemProperties(mapOf()), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..7bc97231743f8 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations Delete. */ +public final class WorkItemConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDelete.json + */ + /** + * Sample code: WorkItemConfigurationDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .deleteWithResponse("my-resource-group", "my-component", "Visual Studio Team Services", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsGetDefaultSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsGetDefaultSamples.java new file mode 100644 index 0000000000000..3dce1b1ff33e8 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsGetDefaultSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations GetDefault. */ +public final class WorkItemConfigurationsGetDefaultSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDefaultGet.json + */ + /** + * Sample code: WorkItemConfigurationsGetDefault. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsGetDefault( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workItemConfigurations().getDefaultWithResponse("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsGetItemSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsGetItemSamples.java new file mode 100644 index 0000000000000..1fbd9ac1e1255 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsGetItemSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations GetItem. */ +public final class WorkItemConfigurationsGetItemSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigGet.json + */ + /** + * Sample code: WorkItemConfigurationsGetDefault. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsGetDefault( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .getItemWithResponse("my-resource-group", "my-component", "Visual Studio Team Services", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsListSamples.java new file mode 100644 index 0000000000000..459db6a22875a --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkItemConfigurations List. */ +public final class WorkItemConfigurationsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigsGet.json + */ + /** + * Sample code: WorkItemConfigurationsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workItemConfigurations().list("my-resource-group", "my-component", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsUpdateItemSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsUpdateItemSamples.java new file mode 100644 index 0000000000000..c53443b25e023 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkItemConfigurationsUpdateItemSamples.java @@ -0,0 +1,49 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WorkItemCreateConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for WorkItemConfigurations UpdateItem. */ +public final class WorkItemConfigurationsUpdateItemSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigUpdate.json + */ + /** + * Sample code: WorkItemConfigurationsCreate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workItemConfigurationsCreate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workItemConfigurations() + .updateItemWithResponse( + "my-resource-group", + "my-component", + "Visual Studio Team Services", + new WorkItemCreateConfiguration() + .withConnectorId("d334e2a4-6733-488e-8645-a9fdc1694f41") + .withConnectorDataConfiguration( + "{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}") + .withValidateOnly(true) + .withWorkItemProperties(mapOf()), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesCreateOrUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..07160d823416f --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesCreateOrUpdateSamples.java @@ -0,0 +1,63 @@ +// 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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplateGallery; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for WorkbookTemplates CreateOrUpdate. */ +public final class WorkbookTemplatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateAdd.json + */ + /** + * Sample code: WorkbookTemplateAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateAdd( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) throws IOException { + manager + .workbookTemplates() + .define("testtemplate2") + .withRegion("west us") + .withExistingResourceGroup("my-resource-group") + .withPriority(1) + .withAuthor("Contoso") + .withTemplateData( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json\",\"items\":[{\"name\":\"text" + + " - 2\",\"type\":1,\"content\":{\"json\":\"## New workbook\\n" + + "---\\n" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\n" + + "\\n" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below" + + " each section to configure it or add more sections.\"}},{\"name\":\"query -" + + " 2\",\"type\":3,\"content\":{\"exportToExcelOptions\":\"visible\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"queryType\":0,\"resourceType\":\"microsoft.operationalinsights/workspaces\",\"size\":1,\"version\":\"KqlItem/1.0\"}}],\"styleSettings\":{},\"version\":\"Notebook/1.0\"}", + Object.class, + SerializerEncoding.JSON)) + .withGalleries( + Arrays + .asList( + new WorkbookTemplateGallery() + .withName("Simple Template") + .withCategory("Failures") + .withType("tsg") + .withOrder(100) + .withResourceType("microsoft.insights/components"))) + .create(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesDeleteSamples.java new file mode 100644 index 0000000000000..587759d9f097e --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkbookTemplates Delete. */ +public final class WorkbookTemplatesDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateDelete.json + */ + /** + * Sample code: WorkbookTemplateDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbookTemplates().deleteWithResponse("my-resource-group", "my-template-resource", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesGetByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..3eda6ea7c499e --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkbookTemplates GetByResourceGroup. */ +public final class WorkbookTemplatesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateGet.json + */ + /** + * Sample code: WorkbookTemplateGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbookTemplates() + .getByResourceGroupWithResponse("my-resource-group", "my-resource-name", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesListByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a05d12cbd7930 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkbookTemplates ListByResourceGroup. */ +public final class WorkbookTemplatesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplatesList.json + */ + /** + * Sample code: WorkbookTemplatesList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplatesList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbookTemplates().listByResourceGroup("my-resource-group", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesUpdateSamples.java new file mode 100644 index 0000000000000..cb882a701b8e3 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbookTemplatesUpdateSamples.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.WorkbookTemplate; + +/** Samples for WorkbookTemplates Update. */ +public final class WorkbookTemplatesUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateUpdate.json + */ + /** + * Sample code: WorkbookTemplateUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookTemplateUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + WorkbookTemplate resource = + manager + .workbookTemplates() + .getByResourceGroupWithResponse("my-resource-group", "my-template-resource", Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksCreateOrUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..067b852d1d9db --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksCreateOrUpdateSamples.java @@ -0,0 +1,109 @@ +// 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.generated; + +import com.azure.resourcemanager.applicationinsights.models.Kind; +import com.azure.resourcemanager.applicationinsights.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.applicationinsights.models.UserAssignedIdentity; +import com.azure.resourcemanager.applicationinsights.models.WorkbookResourceIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Workbooks CreateOrUpdate. */ +public final class WorkbooksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookManagedAdd.json + */ + /** + * Sample code: WorkbookManagedAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookManagedAdd( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .define("deadb33f-5e0d-4064-8ebb-1a4ed0313eb2") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("hidden-title", "tttt")) + .withIdentity( + new WorkbookResourceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .withKind(Kind.SHARED) + .withEtag("\"4a00f78d-0000-0700-0000-5f8f616c1000\"") + .withDisplayName("tttt") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":{\"json\":\"test\"},\"name\":\"text -" + + " 0\"}],\"isLocked\":false,\"fallbackResourceIds\":[\"/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup\"]}") + .withVersion("Notebook/1.0") + .withCategory("workbook") + .withTagsPropertiesTags(Arrays.asList()) + .withStorageUri( + "/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/MyGroup/providers/Microsoft.Storage/storageAccounts/testStorage/blobServices/default/containers/testContainer") + .withDescription("Sample workbook") + .withSourceIdParameter("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/MyGroup") + .create(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookAdd.json + */ + /** + * Sample code: WorkbookAdd. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookAdd(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .define("deadb33f-8bee-4d3b-a059-9be8dac93960") + .withRegion("west us") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("TagSample01", "sample01", "TagSample02", "sample02")) + .withKind(Kind.SHARED) + .withDisplayName("tttt") + .withSerializedData( + "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r" + + "\\n" + + "---\\r" + + "\\n" + + "\\r" + + "\\n" + + "Welcome to your new workbook. This area will display text formatted as markdown.\\r" + + "\\n" + + "\\r" + + "\\n" + + "\\r" + + "\\n" + + "We've included a basic analytics query to get you started. Use the `Edit` button below each" + + " section to configure it or add more" + + " sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union" + + " withsource=TableName *\\n" + + "| summarize Count=count() by TableName\\n" + + "| render" + + " barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}") + .withCategory("workbook") + .withDescription("Sample workbook") + .withSourceIdParameter("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/MyGroup") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksDeleteSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksDeleteSamples.java new file mode 100644 index 0000000000000..9a5884961842d --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Workbooks Delete. */ +public final class WorkbooksDeleteSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookDelete.json + */ + /** + * Sample code: WorkbookDelete. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookDelete( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .deleteWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksGetByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..07d1f5cda8267 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksGetByResourceGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Workbooks GetByResourceGroup. */ +public final class WorkbooksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookGet1.json + */ + /** + * Sample code: WorkbookGet1. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookGet1(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookManagedGet.json + */ + /** + * Sample code: WorkbookManagedGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookManagedGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookGet.json + */ + /** + * Sample code: WorkbookGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookGet(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .getByResourceGroupWithResponse("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksListByResourceGroupSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0c707580986e4 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksListByResourceGroupSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for Workbooks ListByResourceGroup. */ +public final class WorkbooksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksList.json + */ + /** + * Sample code: WorkbooksList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .listByResourceGroup( + "my-resource-group", + CategoryType.WORKBOOK, + null, + "/subscriptions/ad2f1a83-caac-4e21-9d2a-9ca3f87105e2/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/MyTestApp-CodeLens1", + null, + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksListSamples.java new file mode 100644 index 0000000000000..cf84dbbec54f9 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksListSamples.java @@ -0,0 +1,50 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.CategoryType; + +/** Samples for Workbooks List. */ +public final class WorkbooksListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksManagedList.json + */ + /** + * Sample code: WorkbooksManagedList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksManagedList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksListSub.json + */ + /** + * Sample code: WorkbooksListSub. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksListSub( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksList2.json + */ + /** + * Sample code: WorkbooksList2. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbooksList2( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().list(CategoryType.WORKBOOK, null, null, Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksRevisionGetSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksRevisionGetSamples.java new file mode 100644 index 0000000000000..7771d749c0f37 --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksRevisionGetSamples.java @@ -0,0 +1,29 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Workbooks RevisionGet. */ +public final class WorkbooksRevisionGetSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookRevisionGet.json + */ + /** + * Sample code: WorkbookRevisionGet. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookRevisionGet( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager + .workbooks() + .revisionGetWithResponse( + "my-resource-group", + "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", + "1e2f8435b98248febee70c64ac22e1ab", + Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksRevisionsListSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksRevisionsListSamples.java new file mode 100644 index 0000000000000..ca53ebcb47f0a --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksRevisionsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Workbooks RevisionsList. */ +public final class WorkbooksRevisionsListSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookRevisionsList.json + */ + /** + * Sample code: WorkbookRevisionsList. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookRevisionsList( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + manager.workbooks().revisionsList("my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE); + } +} diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksUpdateSamples.java b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksUpdateSamples.java new file mode 100644 index 0000000000000..f3dec0a905c4e --- /dev/null +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/samples/java/com/azure/resourcemanager/applicationinsights/generated/WorkbooksUpdateSamples.java @@ -0,0 +1,56 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.applicationinsights.models.Workbook; + +/** Samples for Workbooks Update. */ +public final class WorkbooksUpdateSamples { + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookUpdate.json + */ + /** + * Sample code: WorkbookUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + Workbook resource = + manager + .workbooks() + .getByResourceGroupWithResponse( + "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE) + .getValue(); + resource + .update() + .withSourceId( + "/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/MyTestApp-CodeLens1") + .apply(); + } + + /* + * x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookManagedUpdate.json + */ + /** + * Sample code: WorkbookManagedUpdate. + * + * @param manager Entry point to ApplicationInsightsManager. + */ + public static void workbookManagedUpdate( + com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) { + Workbook resource = + manager + .workbooks() + .getByResourceGroupWithResponse( + "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", Context.NONE) + .getValue(); + resource + .update() + .withSourceId("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/MyGroup") + .apply(); + } +}