diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md index 2dd0a420e7db..87c84cbbc0b5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md @@ -1,14 +1,123 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-05-09) -### Features Added +- Azure Resource Manager LogAnalytics client library for Java. This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2025-02-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.AzureResourceProperties` was removed + +#### `models.SystemDataAutoGenerated` was removed + +#### `models.CreatedByType` was removed + +#### `models.QueryPacksResource` was removed + +#### `models.Cluster$Definition` was modified + +* `withAssociatedWorkspaces(java.util.List)` was removed + +#### `models.CapacityReservationProperties` was modified + +* `java.lang.String lastSkuUpdate()` -> `java.time.OffsetDateTime lastSkuUpdate()` + +#### `models.WorkspacePatch` was modified + +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` +* `java.lang.String modifiedDate()` -> `java.time.OffsetDateTime modifiedDate()` + +#### `models.Workspace` was modified + +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` +* `models.SystemDataAutoGenerated systemData()` -> `com.azure.core.management.SystemData systemData()` +* `java.lang.String modifiedDate()` -> `java.time.OffsetDateTime modifiedDate()` + +#### `models.WorkspaceSku` was modified + +* `java.lang.String lastSkuUpdate()` -> `java.time.OffsetDateTime lastSkuUpdate()` + +#### `models.AssociatedWorkspace` was modified + +* `java.lang.String associateDate()` -> `java.time.OffsetDateTime associateDate()` +* `java.lang.String workspaceId()` -> `java.util.UUID workspaceId()` + +#### `models.Table` was modified + +* `models.SystemDataAutoGenerated systemData()` -> `com.azure.core.management.SystemData systemData()` + +#### `models.Cluster` was modified + +* `java.lang.String lastModifiedDate()` -> `java.time.OffsetDateTime lastModifiedDate()` +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` + +#### `models.IdentityType` was modified + +* `java.util.Collection values()` -> `models.IdentityType[] values()` + +### Features Added + +* `models.WorkspaceReplicationProperties` was added + +* `models.WorkspaceFailoverProperties` was added + +* `models.ClusterReplicationProperties` was added + +* `models.ClusterReplicationState` was added + +* `models.WorkspaceReplicationState` was added + +* `models.WorkspaceFailoverState` was added + +#### `models.Cluster$Definition` was modified + +* `withReplication(models.ClusterReplicationProperties)` was added + +#### `models.WorkspaceFeatures` was modified + +* `unifiedSentinelBillingOnly()` was added + +#### `models.Workspace$Update` was modified + +* `withReplication(models.WorkspaceReplicationProperties)` was added +* `withFailover(models.WorkspaceFailoverProperties)` was added + +#### `models.Workspace$Definition` was modified + +* `withFailover(models.WorkspaceFailoverProperties)` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added + +#### `models.WorkspacePatch` was modified + +* `withFailover(models.WorkspaceFailoverProperties)` was added +* `failover()` was added +* `replication()` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added + +#### `models.Workspace` was modified + +* `replication()` was added +* `failover()` was added + +#### `models.LogAnalyticsQueryPack` was modified + +* `systemData()` was added + +#### `models.Workspaces` was modified + +* `failover(java.lang.String,java.lang.String,java.lang.String)` was added +* `failover(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `failback(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `failback(java.lang.String,java.lang.String)` was added + +#### `models.Cluster` was modified + +* `replication()` was added + +#### `models.IdentityType` was modified -### Other Changes +* `toString()` was added +* `valueOf(java.lang.String)` was added ## 1.1.0 (2024-12-13) diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md index 0badc4533918..6a384048f3b9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md @@ -2,7 +2,7 @@ Azure Resource Manager LogAnalytics client library for Java. -This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2022-10. 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 LogAnalytics Management SDK. Operational Insights Client. Package tag package-2025-02-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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ LogAnalyticsManager manager = LogAnalyticsManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -107,5 +107,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md index 672f15ccedf6..f4f76f1f5052 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md @@ -134,6 +134,8 @@ - [CreateOrUpdate](#workspaces_createorupdate) - [Delete](#workspaces_delete) +- [Failback](#workspaces_failback) +- [Failover](#workspaces_failover) - [GetByResourceGroup](#workspaces_getbyresourcegroup) - [List](#workspaces_list) - [ListByResourceGroup](#workspaces_listbyresourcegroup) @@ -142,22 +144,22 @@ ```java /** - * Samples for AvailableServiceTiers ListByWorkspace. + * Samples for DataSources Get. */ -public final class AvailableServiceTiersListByWorkspaceSamples { +public final class DataSourcesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesAvailableServiceTiers.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataSourcesGet.json */ /** - * Sample code: AvailableServiceTiers. + * Sample code: DataSourcesGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void availableServiceTiers(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.availableServiceTiers() - .listByWorkspaceWithResponse("rg1", "workspace1", com.azure.core.util.Context.NONE); + public static void dataSourcesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataSources() + .getWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", com.azure.core.util.Context.NONE); } } ``` @@ -165,47 +167,22 @@ public final class AvailableServiceTiersListByWorkspaceSamples { ### Clusters_CreateOrUpdate ```java -import com.azure.resourcemanager.loganalytics.models.Capacity; -import com.azure.resourcemanager.loganalytics.models.ClusterSku; -import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Clusters CreateOrUpdate. + * Samples for Workspaces Failback. */ -public final class ClustersCreateOrUpdateSamples { +public final class WorkspacesFailbackSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesFailback.json */ /** - * Sample code: ClustersCreate. + * Sample code: WorkspacesFailover. * * @param manager Entry point to LogAnalyticsManager. */ - public static void clustersCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.clusters() - .define("oiautorest6685") - .withRegion("australiasoutheast") - .withExistingResourceGroup("oiautorest6685") - .withTags(mapOf("tag1", "val1")) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) - .create(); - } - - // Use "Map.of" if available - @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; + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failback("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); } } ``` @@ -214,21 +191,22 @@ public final class ClustersCreateOrUpdateSamples { ```java /** - * Samples for Clusters Delete. + * Samples for IntelligencePacks Enable. */ -public final class ClustersDeleteSamples { +public final class IntelligencePacksEnableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesEnableIntelligencePack.json */ /** - * Sample code: ClustersDelete. + * Sample code: IntelligencePacksEnable. * * @param manager Entry point to LogAnalyticsManager. */ - public static void clustersDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.clusters().delete("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + public static void intelligencePacksEnable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks() + .enableWithResponse("rg1", "TestLinkWS", "ChangeTracking", com.azure.core.util.Context.NONE); } } ``` @@ -237,22 +215,23 @@ public final class ClustersDeleteSamples { ```java /** - * Samples for Clusters GetByResourceGroup. + * Samples for DataSources ListByWorkspace. */ -public final class ClustersGetByResourceGroupSamples { +public final class DataSourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataSourcesListByWorkspace.json */ /** - * Sample code: ClustersGet. + * Sample code: DataSourcesListByWorkspace. * * @param manager Entry point to LogAnalyticsManager. */ - public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.clusters() - .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + public static void dataSourcesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataSources() + .listByWorkspace("OIAutoRest5123", "AzTest9724", "kind='WindowsEvent'", null, + com.azure.core.util.Context.NONE); } } ``` @@ -261,21 +240,21 @@ public final class ClustersGetByResourceGroupSamples { ```java /** - * Samples for Clusters List. + * Samples for Queries List. */ -public final class ClustersListSamples { +public final class QueriesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPackQueriesList.json */ /** - * Sample code: ClustersSubscriptionList. + * Sample code: QueryList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void clustersSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.clusters().list(com.azure.core.util.Context.NONE); + public static void queryList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queries().list("my-resource-group", "my-querypack", null, true, null, com.azure.core.util.Context.NONE); } } ``` @@ -284,21 +263,21 @@ public final class ClustersListSamples { ```java /** - * Samples for Clusters ListByResourceGroup. + * Samples for Tables Delete. */ -public final class ClustersListByResourceGroupSamples { +public final class TablesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * TablesDelete.json */ /** - * Sample code: ClustersGet. + * Sample code: TablesDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.clusters().listByResourceGroup("oiautorest6685", com.azure.core.util.Context.NONE); + public static void tablesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables().delete("oiautorest6685", "oiautorest6685", "table1_CL", com.azure.core.util.Context.NONE); } } ``` @@ -306,60 +285,22 @@ public final class ClustersListByResourceGroupSamples { ### Clusters_Update ```java -import com.azure.resourcemanager.loganalytics.models.Capacity; -import com.azure.resourcemanager.loganalytics.models.Cluster; -import com.azure.resourcemanager.loganalytics.models.ClusterSku; -import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; -import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; -import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; -import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.loganalytics.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Clusters Update. + * Samples for Workspaces ListByResourceGroup. */ -public final class ClustersUpdateSamples { +public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesListByResourceGroup.json */ /** - * Sample code: ClustersPatch. + * Sample code: WorkspacesGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void clustersPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - Cluster resource = manager.clusters() - .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tag1", "val1")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/53bc36c5-91e1-4d09-92c9-63b89e571926/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", - new UserAssignedIdentity()))) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) - .withKeyVaultProperties(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") - .withKeyName("fakeTokenPlaceholder") - .withKeyVersion("fakeTokenPlaceholder") - .withKeyRsaSize(1024)) - .apply(); - } - - // Use "Map.of" if available - @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; + public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().listByResourceGroup("oiautorest6685", com.azure.core.util.Context.NONE); } } ``` @@ -367,30 +308,24 @@ public final class ClustersUpdateSamples { ### DataExports_CreateOrUpdate ```java -import java.util.Arrays; - /** - * Samples for DataExports CreateOrUpdate. + * Samples for SavedSearches Delete. */ -public final class DataExportsCreateOrUpdateSamples { +public final class SavedSearchesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesDeleteSavedSearches.json */ /** - * Sample code: DataExportCreate. + * Sample code: SavedSearchesDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataExportCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.dataExports() - .define("export1") - .withExistingWorkspace("RgTest1", "DeWnTest1234") - .withTableNames(Arrays.asList("Heartbeat")) - .withResourceId( - "/subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test") - .create(); + public static void savedSearchesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.savedSearches() + .deleteWithResponse("TestRG", "TestWS", "00000000-0000-0000-0000-00000000000", + com.azure.core.util.Context.NONE); } } ``` @@ -398,23 +333,52 @@ public final class DataExportsCreateOrUpdateSamples { ### DataExports_Delete ```java +import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBody; +import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBodyFilters; +import java.util.Arrays; + /** - * Samples for DataExports Delete. + * Samples for WorkspacePurge Purge. */ -public final class DataExportsDeleteSamples { +public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesPurgeResourceId.json */ /** - * Sample code: DataExportDelete. + * Sample code: WorkspacePurgeResourceId. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataExportDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.dataExports() - .deleteWithResponse("RgTest1", "DeWnTest1234", "export1", com.azure.core.util.Context.NONE); + public static void workspacePurgeResourceId(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspacePurges() + .purgeWithResponse("OIAutoRest5123", "aztest5048", new WorkspacePurgeBody().withTable("Heartbeat") + .withFilters(Arrays.asList(new WorkspacePurgeBodyFilters().withColumn("_ResourceId") + .withOperator("==") + .withValue( + "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesPurge.json + */ + /** + * Sample code: WorkspacePurge. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacePurge(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspacePurges() + .purgeWithResponse("OIAutoRest5123", "aztest5048", + new WorkspacePurgeBody().withTable("Heartbeat") + .withFilters(Arrays.asList(new WorkspacePurgeBodyFilters().withColumn("TimeGenerated") + .withOperator(">") + .withValue("2017-09-01T00:00:00"))), + com.azure.core.util.Context.NONE); } } ``` @@ -423,21 +387,22 @@ public final class DataExportsDeleteSamples { ```java /** - * Samples for DataExports Get. + * Samples for Tables Migrate. */ -public final class DataExportsGetSamples { +public final class TablesMigrateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * TablesMigrate.json */ /** - * Sample code: DataExportGet. + * Sample code: TablesMigrate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.dataExports().getWithResponse("RgTest1", "DeWnTest1234", "export1", com.azure.core.util.Context.NONE); + public static void tablesMigrate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables() + .migrateWithResponse("oiautorest6685", "oiautorest6685", "table1_CL", com.azure.core.util.Context.NONE); } } ``` @@ -446,21 +411,22 @@ public final class DataExportsGetSamples { ```java /** - * Samples for DataExports ListByWorkspace. + * Samples for DataExports Delete. */ -public final class DataExportsListByWorkspaceSamples { +public final class DataExportsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataExportDelete.json */ /** - * Sample code: DataExportGet. + * Sample code: DataExportDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.dataExports().listByWorkspace("RgTest1", "DeWnTest1234", com.azure.core.util.Context.NONE); + public static void dataExportDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports() + .deleteWithResponse("RgTest1", "DeWnTest1234", "export1", com.azure.core.util.Context.NONE); } } ``` @@ -468,35 +434,34 @@ public final class DataExportsListByWorkspaceSamples { ### DataSources_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.loganalytics.models.DataSourceKind; -import java.io.IOException; +import com.azure.resourcemanager.loganalytics.models.Tag; +import java.util.Arrays; /** - * Samples for DataSources CreateOrUpdate. + * Samples for SavedSearches CreateOrUpdate. */ -public final class DataSourcesCreateOrUpdateSamples { +public final class SavedSearchesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesSavedSearchesCreateOrUpdate.json */ /** - * Sample code: DataSourcesCreate. + * Sample code: SavedSearchCreateOrUpdate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataSourcesCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) - throws IOException { - manager.dataSources() - .define("AzTestDS774") - .withExistingWorkspace("OIAutoRest5123", "AzTest9724") - .withProperties(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"LinkedResourceId\":\"/subscriptions/00000000-0000-0000-0000-00000000000/providers/microsoft.insights/eventtypes/management\"}", - Object.class, SerializerEncoding.JSON)) - .withKind(DataSourceKind.AZURE_ACTIVITY_LOG) + public static void savedSearchCreateOrUpdate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.savedSearches() + .define("00000000-0000-0000-0000-00000000000") + .withExistingWorkspace("TestRG", "TestWS") + .withCategory("Saved Search Test Category") + .withDisplayName("Create or Update Saved Search Test") + .withQuery("Heartbeat | summarize Count() by Computer | take a") + .withTags(Arrays.asList(new Tag().withName("Group").withValue("Computer"))) + .withFunctionAlias("heartbeat_func") + .withFunctionParameters("a:int=1") + .withVersion(2L) .create(); } } @@ -506,22 +471,21 @@ public final class DataSourcesCreateOrUpdateSamples { ```java /** - * Samples for DataSources Delete. + * Samples for QueryPacks List. */ -public final class DataSourcesDeleteSamples { +public final class QueryPacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksList.json */ /** - * Sample code: DataSourcesDelete. + * Sample code: QueryPacksList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataSourcesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.dataSources() - .deleteWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", com.azure.core.util.Context.NONE); + public static void queryPacksList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks().list(com.azure.core.util.Context.NONE); } } ``` @@ -530,22 +494,22 @@ public final class DataSourcesDeleteSamples { ```java /** - * Samples for DataSources Get. + * Samples for StorageInsightConfigs Get. */ -public final class DataSourcesGetSamples { +public final class StorageInsightConfigsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * StorageInsightsGet.json */ /** - * Sample code: DataSourcesGet. + * Sample code: StorageInsightsGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataSourcesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.dataSources() - .getWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", com.azure.core.util.Context.NONE); + public static void storageInsightsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs() + .getWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", com.azure.core.util.Context.NONE); } } ``` @@ -554,23 +518,22 @@ public final class DataSourcesGetSamples { ```java /** - * Samples for DataSources ListByWorkspace. + * Samples for DataSources Delete. */ -public final class DataSourcesListByWorkspaceSamples { +public final class DataSourcesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataSourcesDelete.json */ /** - * Sample code: DataSourcesListByWorkspace. + * Sample code: DataSourcesDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void dataSourcesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + public static void dataSourcesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { manager.dataSources() - .listByWorkspace("OIAutoRest5123", "AzTest9724", "kind='WindowsEvent'", null, - com.azure.core.util.Context.NONE); + .deleteWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", com.azure.core.util.Context.NONE); } } ``` @@ -579,21 +542,21 @@ public final class DataSourcesListByWorkspaceSamples { ```java /** - * Samples for DeletedWorkspaces List. + * Samples for Schema Get. */ -public final class DeletedWorkspacesListSamples { +public final class SchemaGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * SavedSearchesGetSchema.json */ /** - * Sample code: WorkspacesSubscriptionList. + * Sample code: WorkspacesGetSchema. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.deletedWorkspaces().list(com.azure.core.util.Context.NONE); + public static void workspacesGetSchema(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.schemas().getWithResponse("mms-eus", "atlantisdemo", com.azure.core.util.Context.NONE); } } ``` @@ -602,21 +565,22 @@ public final class DeletedWorkspacesListSamples { ```java /** - * Samples for DeletedWorkspaces ListByResourceGroup. + * Samples for StorageInsightConfigs Delete. */ -public final class DeletedWorkspacesListByResourceGroupSamples { +public final class StorageInsightConfigsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * StorageInsightsDelete.json */ /** - * Sample code: WorkspacesGet. + * Sample code: StorageInsightsDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.deletedWorkspaces().listByResourceGroup("oiautorest6685", com.azure.core.util.Context.NONE); + public static void storageInsightsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs() + .deleteWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", com.azure.core.util.Context.NONE); } } ``` @@ -630,7 +594,7 @@ public final class DeletedWorkspacesListByResourceGroupSamples { public final class GatewaysDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesGatewaysDelete.json */ /** @@ -650,22 +614,26 @@ public final class GatewaysDeleteSamples { ```java /** - * Samples for IntelligencePacks Disable. + * Samples for LinkedServices CreateOrUpdate. */ -public final class IntelligencePacksDisableSamples { +public final class LinkedServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDisableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedServicesCreate.json */ /** - * Sample code: IntelligencePacksDisable. + * Sample code: LinkedServicesCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void intelligencePacksDisable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.intelligencePacks() - .disableWithResponse("rg1", "TestLinkWS", "ChangeTracking", com.azure.core.util.Context.NONE); + public static void linkedServicesCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices() + .define("Cluster") + .withExistingWorkspace("mms-eus", "TestLinkWS") + .withWriteAccessResourceId( + "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster") + .create(); } } ``` @@ -674,22 +642,22 @@ public final class IntelligencePacksDisableSamples { ```java /** - * Samples for IntelligencePacks Enable. + * Samples for QueryPacks ListByResourceGroup. */ -public final class IntelligencePacksEnableSamples { +public final class QueryPacksListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesEnableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksListByResourceGroup.json */ /** - * Sample code: IntelligencePacksEnable. + * Sample code: QueryPackListByResourceGroup. * * @param manager Entry point to LogAnalyticsManager. */ - public static void intelligencePacksEnable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.intelligencePacks() - .enableWithResponse("rg1", "TestLinkWS", "ChangeTracking", com.azure.core.util.Context.NONE); + public static void + queryPackListByResourceGroup(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks().listByResourceGroup("my-resource-group", com.azure.core.util.Context.NONE); } } ``` @@ -698,21 +666,22 @@ public final class IntelligencePacksEnableSamples { ```java /** - * Samples for IntelligencePacks List. + * Samples for OperationStatuses Get. */ -public final class IntelligencePacksListSamples { +public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListIntelligencePacks.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * OperationStatusesGet.json */ /** - * Sample code: IntelligencePacksList. + * Sample code: Get specific operation status. * * @param manager Entry point to LogAnalyticsManager. */ - public static void intelligencePacksList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.intelligencePacks().listWithResponse("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); + public static void getSpecificOperationStatus(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.operationStatuses() + .getWithResponse("West US", "713192d7-503f-477a-9cfe-4efc3ee2bd11", com.azure.core.util.Context.NONE); } } ``` @@ -720,28 +689,61 @@ public final class IntelligencePacksListSamples { ### LinkedServices_CreateOrUpdate ```java +import java.util.HashMap; +import java.util.Map; + /** - * Samples for LinkedServices CreateOrUpdate. + * Samples for QueryPacks CreateOrUpdate. */ -public final class LinkedServicesCreateOrUpdateSamples { +public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksCreate.json */ /** - * Sample code: LinkedServicesCreate. + * Sample code: QueryPackCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void linkedServicesCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedServices() - .define("Cluster") - .withExistingWorkspace("mms-eus", "TestLinkWS") - .withWriteAccessResourceId( - "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster") + public static void queryPackCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks() + .define("my-querypack") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .create(); + } + + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksUpdate.json + */ + /** + * Sample code: QueryPackUpdate. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void queryPackUpdate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks() + .define("my-querypack") + .withRegion("South Central US") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("Tag1", "Value1")) .create(); } + + // Use "Map.of" if available + @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; + } } ``` @@ -749,21 +751,22 @@ public final class LinkedServicesCreateOrUpdateSamples { ```java /** - * Samples for LinkedServices Delete. + * Samples for LinkedServices ListByWorkspace. */ -public final class LinkedServicesDeleteSamples { +public final class LinkedServicesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedServicesListByWorkspace.json */ /** - * Sample code: LinkedServicesDelete. + * Sample code: LinkedServicesListByWorkspace. * * @param manager Entry point to LogAnalyticsManager. */ - public static void linkedServicesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedServices().delete("rg1", "TestLinkWS", "Cluster", com.azure.core.util.Context.NONE); + public static void + linkedServicesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices().listByWorkspace("mms-eus", "TestLinkWS", com.azure.core.util.Context.NONE); } } ``` @@ -772,21 +775,22 @@ public final class LinkedServicesDeleteSamples { ```java /** - * Samples for LinkedServices Get. + * Samples for Tables Get. */ -public final class LinkedServicesGetSamples { +public final class TablesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * TablesGet.json */ /** - * Sample code: LinkedServicesGet. + * Sample code: TablesGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void linkedServicesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedServices().getWithResponse("mms-eus", "TestLinkWS", "Cluster", com.azure.core.util.Context.NONE); + public static void tablesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables() + .getWithResponse("oiautorest6685", "oiautorest6685", "table1_SRCH", com.azure.core.util.Context.NONE); } } ``` @@ -795,22 +799,23 @@ public final class LinkedServicesGetSamples { ```java /** - * Samples for LinkedServices ListByWorkspace. + * Samples for Tables CancelSearch. */ -public final class LinkedServicesListByWorkspaceSamples { +public final class TablesCancelSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * TablesSearchCancel.json */ /** - * Sample code: LinkedServicesListByWorkspace. + * Sample code: TablesSearchCancel. * * @param manager Entry point to LogAnalyticsManager. */ - public static void - linkedServicesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedServices().listByWorkspace("mms-eus", "TestLinkWS", com.azure.core.util.Context.NONE); + public static void tablesSearchCancel(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables() + .cancelSearchWithResponse("oiautorest6685", "oiautorest6685", "table1_SRCH", + com.azure.core.util.Context.NONE); } } ``` @@ -818,31 +823,22 @@ public final class LinkedServicesListByWorkspaceSamples { ### LinkedStorageAccounts_CreateOrUpdate ```java -import com.azure.resourcemanager.loganalytics.models.DataSourceType; -import java.util.Arrays; - /** - * Samples for LinkedStorageAccounts CreateOrUpdate. + * Samples for Workspaces List. */ -public final class LinkedStorageAccountsCreateOrUpdateSamples { +public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesSubscriptionList.json */ /** - * Sample code: LinkedStorageAccountsCreate. + * Sample code: WorkspacesSubscriptionList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void linkedStorageAccountsCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedStorageAccounts() - .define(DataSourceType.CUSTOM_LOGS) - .withExistingWorkspace("mms-eus", "testLinkStorageAccountsWS") - .withStorageAccountIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA", - "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageB")) - .create(); + public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().list(com.azure.core.util.Context.NONE); } } ``` @@ -850,26 +846,36 @@ public final class LinkedStorageAccountsCreateOrUpdateSamples { ### LinkedStorageAccounts_Delete ```java -import com.azure.resourcemanager.loganalytics.models.DataSourceType; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.loganalytics.models.DataSourceKind; +import java.io.IOException; /** - * Samples for LinkedStorageAccounts Delete. + * Samples for DataSources CreateOrUpdate. */ -public final class LinkedStorageAccountsDeleteSamples { +public final class DataSourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataSourcesCreate.json */ /** - * Sample code: LinkedStorageAccountsDelete. + * Sample code: DataSourcesCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void linkedStorageAccountsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedStorageAccounts() - .deleteWithResponse("mms-eus", "testLinkStorageAccountsWS", DataSourceType.CUSTOM_LOGS, - com.azure.core.util.Context.NONE); + public static void dataSourcesCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) + throws IOException { + manager.dataSources() + .define("AzTestDS774") + .withExistingWorkspace("OIAutoRest5123", "AzTest9724") + .withProperties(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"LinkedResourceId\":\"/subscriptions/00000000-0000-0000-0000-00000000000/providers/microsoft.insights/eventtypes/management\"}", + Object.class, SerializerEncoding.JSON)) + .withKind(DataSourceKind.AZURE_ACTIVITY_LOG) + .create(); } } ``` @@ -877,26 +883,23 @@ public final class LinkedStorageAccountsDeleteSamples { ### LinkedStorageAccounts_Get ```java -import com.azure.resourcemanager.loganalytics.models.DataSourceType; - /** - * Samples for LinkedStorageAccounts Get. + * Samples for QueryPacks Delete. */ -public final class LinkedStorageAccountsGetSamples { +public final class QueryPacksDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksDelete.json */ /** - * Sample code: LinkedStorageAccountsGet. + * Sample code: QueryPacksDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void linkedStorageAccountsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedStorageAccounts() - .getWithResponse("mms-eus", "testLinkStorageAccountsWS", DataSourceType.CUSTOM_LOGS, - com.azure.core.util.Context.NONE); + public static void queryPacksDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks() + .deleteByResourceGroupWithResponse("my-resource-group", "my-querypack", com.azure.core.util.Context.NONE); } } ``` @@ -905,23 +908,21 @@ public final class LinkedStorageAccountsGetSamples { ```java /** - * Samples for LinkedStorageAccounts ListByWorkspace. + * Samples for DeletedWorkspaces ListByResourceGroup. */ -public final class LinkedStorageAccountsListByWorkspaceSamples { +public final class DeletedWorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesListByResourceGroup.json */ /** - * Sample code: Gets list of linked storage accounts on a workspace. + * Sample code: WorkspacesGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void getsListOfLinkedStorageAccountsOnAWorkspace( - com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.linkedStorageAccounts() - .listByWorkspace("mms-eus", "testLinkStorageAccountsWS", com.azure.core.util.Context.NONE); + public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.deletedWorkspaces().listByResourceGroup("oiautorest6685", com.azure.core.util.Context.NONE); } } ``` @@ -929,23 +930,41 @@ public final class LinkedStorageAccountsListByWorkspaceSamples { ### ManagementGroups_List ```java +import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ManagementGroups List. + * Samples for QueryPacks UpdateTags. */ -public final class ManagementGroupsListSamples { +public final class QueryPacksUpdateTagsSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListManagementGroups.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksUpdateTagsOnly.json */ /** - * Sample code: WorkspacesListManagementGroups. + * Sample code: QueryPackUpdateTagsOnly. * * @param manager Entry point to LogAnalyticsManager. */ - public static void - workspacesListManagementGroups(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.managementGroups().list("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); + public static void queryPackUpdateTagsOnly(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + LogAnalyticsQueryPack resource = manager.queryPacks() + .getByResourceGroupWithResponse("my-resource-group", "my-querypack", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); + } + + // Use "Map.of" if available + @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; } } ``` @@ -954,22 +973,21 @@ public final class ManagementGroupsListSamples { ```java /** - * Samples for OperationStatuses Get. + * Samples for Clusters ListByResourceGroup. */ -public final class OperationStatusesGetSamples { +public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * OperationStatusesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * ClustersListByResourceGroup.json */ /** - * Sample code: Get specific operation status. + * Sample code: ClustersGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void getSpecificOperationStatus(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.operationStatuses() - .getWithResponse("West US", "713192d7-503f-477a-9cfe-4efc3ee2bd11", com.azure.core.util.Context.NONE); + public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().listByResourceGroup("oiautorest6685", com.azure.core.util.Context.NONE); } } ``` @@ -978,21 +996,22 @@ public final class OperationStatusesGetSamples { ```java /** - * Samples for Operations List. + * Samples for QueryPacks GetByResourceGroup. */ -public final class OperationsListSamples { +public final class QueryPacksGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * OperationsListByTenant.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksGet.json */ /** - * Sample code: Get specific operation status. + * Sample code: QueryPackGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void getSpecificOperationStatus(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void queryPackGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks() + .getByResourceGroupWithResponse("my-resource-group", "my-querypack", com.azure.core.util.Context.NONE); } } ``` @@ -1000,23 +1019,25 @@ public final class OperationsListSamples { ### Queries_Delete ```java +import com.azure.resourcemanager.loganalytics.models.DataSourceType; + /** - * Samples for Queries Delete. + * Samples for LinkedStorageAccounts Get. */ -public final class QueriesDeleteSamples { +public final class LinkedStorageAccountsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedStorageAccountsGet.json */ /** - * Sample code: QueryDelete. + * Sample code: LinkedStorageAccountsGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queries() - .deleteWithResponse("my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + public static void linkedStorageAccountsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedStorageAccounts() + .getWithResponse("mms-eus", "testLinkStorageAccountsWS", DataSourceType.CUSTOM_LOGS, com.azure.core.util.Context.NONE); } } @@ -1026,23 +1047,21 @@ public final class QueriesDeleteSamples { ```java /** - * Samples for Queries Get. + * Samples for SharedKeysOperation GetSharedKeys. */ -public final class QueriesGetSamples { +public final class SharedKeysOperationGetSharedKeysSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesGetSharedKeys.json */ /** - * Sample code: QueryGet. + * Sample code: SharedKeysList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queries() - .getWithResponse("my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", - com.azure.core.util.Context.NONE); + public static void sharedKeysList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.sharedKeysOperations().getSharedKeysWithResponse("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); } } ``` @@ -1050,22 +1069,30 @@ public final class QueriesGetSamples { ### Queries_List ```java +import java.util.Arrays; + /** - * Samples for Queries List. + * Samples for DataExports CreateOrUpdate. */ -public final class QueriesListSamples { +public final class DataExportsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataExportCreateOrUpdate.json */ /** - * Sample code: QueryList. + * Sample code: DataExportCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queries().list("my-resource-group", "my-querypack", null, true, null, com.azure.core.util.Context.NONE); + public static void dataExportCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports() + .define("export1") + .withExistingWorkspace("RgTest1", "DeWnTest1234") + .withTableNames(Arrays.asList("Heartbeat")) + .withResourceId( + "/subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test") + .create(); } } ``` @@ -1073,83 +1100,94 @@ public final class QueriesListSamples { ### Queries_Put ```java -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Queries Put. + * Samples for IntelligencePacks List. */ -public final class QueriesPutSamples { +public final class IntelligencePacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesPut.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesListIntelligencePacks.json */ /** - * Sample code: QueryPut. + * Sample code: IntelligencePacksList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPut(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queries() - .define("a449f8af-8e64-4b3a-9b16-5a7165ff98c4") - .withExistingQueryPack("my-resource-group", "my-querypack") - .withTags(mapOf("my-label", Arrays.asList("label1"), "my-other-label", Arrays.asList("label2"))) - .withDisplayName("Exceptions - New in the last 24 hours") - .withDescription("my description") - .withBody( - "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\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") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("analytics"))) - .create(); + public static void intelligencePacksList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks().listWithResponse("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); } +} +``` - // Use "Map.of" if available - @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; +### Queries_Search + +```java +/** + * Samples for Usages List. + */ +public final class UsagesListSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesListUsages.json + */ + /** + * Sample code: UsagesList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void usagesList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.usages().list("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); } } ``` -### Queries_Search +### Queries_Update ```java -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchProperties; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated; -import java.util.Arrays; +import com.azure.resourcemanager.loganalytics.models.Capacity; +import com.azure.resourcemanager.loganalytics.models.Cluster; +import com.azure.resourcemanager.loganalytics.models.ClusterSku; +import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; +import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; +import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; +import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.loganalytics.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; /** - * Samples for Queries Search. + * Samples for Clusters Update. */ -public final class QueriesSearchSamples { +public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesSearch.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * ClustersUpdate.json */ /** - * Sample code: QuerySearch. + * Sample code: ClustersPatch. * * @param manager Entry point to LogAnalyticsManager. */ - public static void querySearch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queries() - .search("my-resource-group", "my-querypack", - new LogAnalyticsQueryPackQuerySearchProperties() - .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() - .withCategories(Arrays.asList("other", "analytics"))) - .withTags(mapOf("my-label", Arrays.asList("label1"))), - 3L, true, null, com.azure.core.util.Context.NONE); + public static void clustersPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Cluster resource = manager.clusters() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "val1")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/53bc36c5-91e1-4d09-92c9-63b89e571926/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) + .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) + .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withKeyVaultProperties(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyRsaSize(1024)) + .apply(); } // Use "Map.of" if available @@ -1166,161 +1204,185 @@ public final class QueriesSearchSamples { } ``` -### Queries_Update +### QueryPacks_CreateOrUpdate ```java -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Queries Update. + * Samples for Queries Delete. */ -public final class QueriesUpdateSamples { +public final class QueriesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPackQueriesDelete.json */ /** - * Sample code: QueryPatch. + * Sample code: QueryDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - LogAnalyticsQueryPackQuery resource = manager.queries() - .getWithResponse("my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("my-label", Arrays.asList("label1"), "my-other-label", Arrays.asList("label2"))) - .withDisplayName("Exceptions - New in the last 24 hours") - .withDescription("my description") - .withBody( - "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\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") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("analytics"))) - .apply(); + public static void queryDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queries() + .deleteWithResponse("my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + com.azure.core.util.Context.NONE); } +} +``` - // Use "Map.of" if available - @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; +### QueryPacks_CreateOrUpdateWithoutName + +```java +/** + * Samples for LinkedServices Get. + */ +public final class LinkedServicesGetSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedServicesGet.json + */ + /** + * Sample code: LinkedServicesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void linkedServicesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices().getWithResponse("mms-eus", "TestLinkWS", "Cluster", com.azure.core.util.Context.NONE); } } ``` -### QueryPacks_CreateOrUpdate +### QueryPacks_Delete ```java -import java.util.HashMap; -import java.util.Map; - /** - * Samples for QueryPacks CreateOrUpdate. + * Samples for Clusters List. */ -public final class QueryPacksCreateOrUpdateSamples { +public final class ClustersListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * ClustersSubscriptionList.json */ /** - * Sample code: QueryPackCreate. + * Sample code: ClustersSubscriptionList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPackCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks() - .define("my-querypack") - .withRegion("South Central US") - .withExistingResourceGroup("my-resource-group") - .create(); + public static void clustersSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().list(com.azure.core.util.Context.NONE); } +} +``` + +### QueryPacks_GetByResourceGroup +```java +/** + * Samples for ManagementGroups List. + */ +public final class ManagementGroupsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesListManagementGroups.json */ /** - * Sample code: QueryPackUpdate. + * Sample code: WorkspacesListManagementGroups. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPackUpdate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks() - .define("my-querypack") - .withRegion("South Central US") - .withExistingResourceGroup("my-resource-group") - .withTags(mapOf("Tag1", "Value1")) - .create(); + public static void + workspacesListManagementGroups(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.managementGroups().list("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); } +} +``` - // Use "Map.of" if available - @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; +### QueryPacks_List + +```java +import com.azure.resourcemanager.loganalytics.models.DataSourceType; + +/** + * Samples for LinkedStorageAccounts Delete. + */ +public final class LinkedStorageAccountsDeleteSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedStorageAccountsDelete.json + */ + /** + * Sample code: LinkedStorageAccountsDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void linkedStorageAccountsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedStorageAccounts() + .deleteWithResponse("mms-eus", "testLinkStorageAccountsWS", DataSourceType.CUSTOM_LOGS, + com.azure.core.util.Context.NONE); } } ``` -### QueryPacks_CreateOrUpdateWithoutName +### QueryPacks_ListByResourceGroup ```java -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for QueryPacks CreateOrUpdateWithoutName. + * Samples for AvailableServiceTiers ListByWorkspace. */ -public final class QueryPacksCreateOrUpdateWithoutNameSamples { +public final class AvailableServiceTiersListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesAvailableServiceTiers.json */ /** - * Sample code: QueryPackCreateNoName. + * Sample code: AvailableServiceTiers. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPackCreateNoName(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks() - .createOrUpdateWithoutNameWithResponse("my-resource-group", - new LogAnalyticsQueryPackInner().withLocation("South Central US"), com.azure.core.util.Context.NONE); + public static void availableServiceTiers(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.availableServiceTiers() + .listByWorkspaceWithResponse("rg1", "workspace1", com.azure.core.util.Context.NONE); } +} +``` + +### QueryPacks_UpdateTags +```java +import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Queries Put. + */ +public final class QueriesPutSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackUpdateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPackQueriesPut.json */ /** - * Sample code: QueryPackUpdateNoName. + * Sample code: QueryPut. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPackUpdateNoName(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks() - .createOrUpdateWithoutNameWithResponse("my-resource-group", - new LogAnalyticsQueryPackInner().withLocation("South Central US").withTags(mapOf("Tag1", "Value1")), - com.azure.core.util.Context.NONE); + public static void queryPut(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queries() + .define("a449f8af-8e64-4b3a-9b16-5a7165ff98c4") + .withExistingQueryPack("my-resource-group", "my-querypack") + .withTags(mapOf("my-label", Arrays.asList("label1"), "my-other-label", Arrays.asList("label2"))) + .withDisplayName("Exceptions - New in the last 24 hours") + .withDescription("my description") + .withBody( + "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\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") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("analytics"))) + .create(); } // Use "Map.of" if available @@ -1337,467 +1399,460 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { } ``` -### QueryPacks_Delete +### SavedSearches_CreateOrUpdate ```java /** - * Samples for QueryPacks Delete. + * Samples for SavedSearches Get. */ -public final class QueryPacksDeleteSamples { +public final class SavedSearchesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesSavedSearchesGet.json */ /** - * Sample code: QueryPacksDelete. + * Sample code: SavedSearchesGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPacksDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks() - .deleteByResourceGroupWithResponse("my-resource-group", "my-querypack", com.azure.core.util.Context.NONE); + public static void savedSearchesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.savedSearches() + .getWithResponse("TestRG", "TestWS", "00000000-0000-0000-0000-00000000000", + com.azure.core.util.Context.NONE); } } ``` -### QueryPacks_GetByResourceGroup +### SavedSearches_Delete ```java /** - * Samples for QueryPacks GetByResourceGroup. + * Samples for Workspaces Delete. */ -public final class QueryPacksGetByResourceGroupSamples { +public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesDelete.json */ /** - * Sample code: QueryPackGet. + * Sample code: WorkspacesDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPackGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks() - .getByResourceGroupWithResponse("my-resource-group", "my-querypack", com.azure.core.util.Context.NONE); + public static void workspacesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().delete("oiautorest6685", "oiautorest6685", null, com.azure.core.util.Context.NONE); } } ``` -### QueryPacks_List +### SavedSearches_Get ```java /** - * Samples for QueryPacks List. + * Samples for SharedKeysOperation Regenerate. */ -public final class QueryPacksListSamples { +public final class SharedKeysOperationRegenerateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesRegenerateSharedKeys.json */ /** - * Sample code: QueryPacksList. + * Sample code: RegenerateSharedKeys. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPacksList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks().list(com.azure.core.util.Context.NONE); + public static void regenerateSharedKeys(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.sharedKeysOperations().regenerateWithResponse("rg1", "workspace1", com.azure.core.util.Context.NONE); } } ``` -### QueryPacks_ListByResourceGroup +### SavedSearches_ListByWorkspace ```java /** - * Samples for QueryPacks ListByResourceGroup. + * Samples for WorkspacePurge GetPurgeStatus. */ -public final class QueryPacksListByResourceGroupSamples { +public final class WorkspacePurgeGetPurgeStatusSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesPurgeOperation.json */ /** - * Sample code: QueryPackListByResourceGroup. + * Sample code: WorkspacePurgeOperation. * * @param manager Entry point to LogAnalyticsManager. */ - public static void - queryPackListByResourceGroup(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.queryPacks().listByResourceGroup("my-resource-group", com.azure.core.util.Context.NONE); + public static void workspacePurgeOperation(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspacePurges() + .getPurgeStatusWithResponse("OIAutoRest5123", "aztest5048", "purge-970318e7-b859-4edb-8903-83b1b54d0b74", + com.azure.core.util.Context.NONE); } } ``` -### QueryPacks_UpdateTags +### Schema_Get ```java -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for QueryPacks UpdateTags. + * Samples for IntelligencePacks Disable. */ -public final class QueryPacksUpdateTagsSamples { +public final class IntelligencePacksDisableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdateTagsOnly.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesDisableIntelligencePack.json */ /** - * Sample code: QueryPackUpdateTagsOnly. + * Sample code: IntelligencePacksDisable. * * @param manager Entry point to LogAnalyticsManager. */ - public static void queryPackUpdateTagsOnly(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - LogAnalyticsQueryPack resource = manager.queryPacks() - .getByResourceGroupWithResponse("my-resource-group", "my-querypack", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); - } - - // Use "Map.of" if available - @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; + public static void intelligencePacksDisable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks() + .disableWithResponse("rg1", "TestLinkWS", "ChangeTracking", com.azure.core.util.Context.NONE); } } ``` -### SavedSearches_CreateOrUpdate +### SharedKeysOperation_GetSharedKeys ```java -import com.azure.resourcemanager.loganalytics.models.Tag; -import java.util.Arrays; - /** - * Samples for SavedSearches CreateOrUpdate. + * Samples for DeletedWorkspaces List. */ -public final class SavedSearchesCreateOrUpdateSamples { +public final class DeletedWorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesSubscriptionList.json */ /** - * Sample code: SavedSearchCreateOrUpdate. + * Sample code: WorkspacesSubscriptionList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void savedSearchCreateOrUpdate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.savedSearches() - .define("00000000-0000-0000-0000-00000000000") - .withExistingWorkspace("TestRG", "TestWS") - .withCategory("Saved Search Test Category") - .withDisplayName("Create or Update Saved Search Test") - .withQuery("Heartbeat | summarize Count() by Computer | take a") - .withTags(Arrays.asList(new Tag().withName("Group").withValue("Computer"))) - .withFunctionAlias("heartbeat_func") - .withFunctionParameters("a:int=1") - .withVersion(2L) - .create(); + public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.deletedWorkspaces().list(com.azure.core.util.Context.NONE); } } ``` -### SavedSearches_Delete +### SharedKeysOperation_Regenerate ```java /** - * Samples for SavedSearches Delete. + * Samples for LinkedServices Delete. */ -public final class SavedSearchesDeleteSamples { +public final class LinkedServicesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDeleteSavedSearches.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedServicesDelete.json */ /** - * Sample code: SavedSearchesDelete. + * Sample code: LinkedServicesDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void savedSearchesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.savedSearches() - .deleteWithResponse("TestRG", "TestWS", "00000000-0000-0000-0000-00000000000", - com.azure.core.util.Context.NONE); + public static void linkedServicesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices().delete("rg1", "TestLinkWS", "Cluster", com.azure.core.util.Context.NONE); } } ``` -### SavedSearches_Get +### StorageInsightConfigs_CreateOrUpdate ```java /** - * Samples for SavedSearches Get. + * Samples for Operations List. */ -public final class SavedSearchesGetSamples { +public final class OperationsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * OperationsListByTenant.json */ /** - * Sample code: SavedSearchesGet. + * Sample code: Get specific operation status. * * @param manager Entry point to LogAnalyticsManager. */ - public static void savedSearchesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.savedSearches() - .getWithResponse("TestRG", "TestWS", "00000000-0000-0000-0000-00000000000", - com.azure.core.util.Context.NONE); + public static void getSpecificOperationStatus(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### SavedSearches_ListByWorkspace +### StorageInsightConfigs_Delete ```java +import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; +import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for SavedSearches ListByWorkspace. + * Samples for Queries Update. */ -public final class SavedSearchesListByWorkspaceSamples { +public final class QueriesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPackQueriesUpdate.json */ /** - * Sample code: SavedSearchesList. + * Sample code: QueryPatch. * * @param manager Entry point to LogAnalyticsManager. */ - public static void savedSearchesList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.savedSearches().listByWorkspaceWithResponse("TestRG", "TestWS", com.azure.core.util.Context.NONE); + public static void queryPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + LogAnalyticsQueryPackQuery resource = manager.queries() + .getWithResponse("my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("my-label", Arrays.asList("label1"), "my-other-label", Arrays.asList("label2"))) + .withDisplayName("Exceptions - New in the last 24 hours") + .withDescription("my description") + .withBody( + "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\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") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("analytics"))) + .apply(); + } + + // Use "Map.of" if available + @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; } } ``` -### Schema_Get +### StorageInsightConfigs_Get ```java /** - * Samples for Schema Get. + * Samples for Workspaces Failover. */ -public final class SchemaGetSamples { +public final class WorkspacesFailoverSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesGetSchema.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesFailover.json */ /** - * Sample code: WorkspacesGetSchema. + * Sample code: WorkspacesFailover. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesGetSchema(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.schemas().getWithResponse("mms-eus", "atlantisdemo", com.azure.core.util.Context.NONE); + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failover("oiautorest6685", "eastus", "oiautorest6685", com.azure.core.util.Context.NONE); } } ``` -### SharedKeysOperation_GetSharedKeys +### StorageInsightConfigs_ListByWorkspace ```java /** - * Samples for SharedKeysOperation GetSharedKeys. + * Samples for Workspaces GetByResourceGroup. */ -public final class SharedKeysOperationGetSharedKeysSamples { +public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGetSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesGet.json */ /** - * Sample code: SharedKeysList. + * Sample code: WorkspaceGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void sharedKeysList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.sharedKeysOperations().getSharedKeysWithResponse("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); + public static void workspaceGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); } } ``` -### SharedKeysOperation_Regenerate +### Tables_CancelSearch ```java /** - * Samples for SharedKeysOperation Regenerate. + * Samples for DataExports ListByWorkspace. */ -public final class SharedKeysOperationRegenerateSamples { +public final class DataExportsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesRegenerateSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataExportListByWorkspace.json */ /** - * Sample code: RegenerateSharedKeys. + * Sample code: DataExportGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void regenerateSharedKeys(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.sharedKeysOperations().regenerateWithResponse("rg1", "workspace1", com.azure.core.util.Context.NONE); + public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().listByWorkspace("RgTest1", "DeWnTest1234", com.azure.core.util.Context.NONE); } } ``` -### StorageInsightConfigs_CreateOrUpdate +### Tables_CreateOrUpdate ```java -import com.azure.resourcemanager.loganalytics.models.StorageAccount; +import com.azure.resourcemanager.loganalytics.models.DataSourceType; import java.util.Arrays; /** - * Samples for StorageInsightConfigs CreateOrUpdate. + * Samples for LinkedStorageAccounts CreateOrUpdate. */ -public final class StorageInsightConfigsCreateOrUpdateSamples { +public final class LinkedStorageAccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedStorageAccountsCreate.json */ /** - * Sample code: StorageInsightsCreate. + * Sample code: LinkedStorageAccountsCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void storageInsightsCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.storageInsightConfigs() - .define("AzTestSI1110") - .withExistingWorkspace("OIAutoRest5123", "aztest5048") - .withContainers(Arrays.asList("wad-iis-logfiles")) - .withTables(Arrays.asList("WADWindowsEventLogsTable", "LinuxSyslogVer2v0")) - .withStorageAccount(new StorageAccount().withId( - "/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/OIAutoRest6987/providers/microsoft.storage/storageaccounts/AzTestFakeSA9945") - .withKey("fakeTokenPlaceholder")) + public static void linkedStorageAccountsCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedStorageAccounts() + .define(DataSourceType.CUSTOM_LOGS) + .withExistingWorkspace("mms-eus", "testLinkStorageAccountsWS") + .withStorageAccountIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA", + "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageB")) .create(); } } ``` -### StorageInsightConfigs_Delete +### Tables_Delete ```java /** - * Samples for StorageInsightConfigs Delete. + * Samples for Clusters Delete. */ -public final class StorageInsightConfigsDeleteSamples { +public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * ClustersDelete.json */ /** - * Sample code: StorageInsightsDelete. + * Sample code: ClustersDelete. * * @param manager Entry point to LogAnalyticsManager. */ - public static void storageInsightsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.storageInsightConfigs() - .deleteWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", com.azure.core.util.Context.NONE); + public static void clustersDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().delete("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); } } ``` -### StorageInsightConfigs_Get +### Tables_Get ```java /** - * Samples for StorageInsightConfigs Get. + * Samples for LinkedStorageAccounts ListByWorkspace. */ -public final class StorageInsightConfigsGetSamples { +public final class LinkedStorageAccountsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * LinkedStorageAccountsListByWorkspace.json */ /** - * Sample code: StorageInsightsGet. + * Sample code: Gets list of linked storage accounts on a workspace. * * @param manager Entry point to LogAnalyticsManager. */ - public static void storageInsightsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.storageInsightConfigs() - .getWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", com.azure.core.util.Context.NONE); + public static void getsListOfLinkedStorageAccountsOnAWorkspace( + com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedStorageAccounts() + .listByWorkspace("mms-eus", "testLinkStorageAccountsWS", com.azure.core.util.Context.NONE); } } ``` -### StorageInsightConfigs_ListByWorkspace +### Tables_ListByWorkspace ```java /** - * Samples for StorageInsightConfigs ListByWorkspace. + * Samples for Tables ListByWorkspace. */ -public final class StorageInsightConfigsListByWorkspaceSamples { +public final class TablesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * TablesList.json */ /** - * Sample code: StorageInsightsList. + * Sample code: TablesListByWorkspace. * * @param manager Entry point to LogAnalyticsManager. */ - public static void storageInsightsList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.storageInsightConfigs() - .listByWorkspace("OIAutoRest5123", "aztest5048", com.azure.core.util.Context.NONE); + public static void tablesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables().listByWorkspace("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); } } ``` -### Tables_CancelSearch +### Tables_Migrate ```java /** - * Samples for Tables CancelSearch. + * Samples for StorageInsightConfigs ListByWorkspace. */ -public final class TablesCancelSearchSamples { +public final class StorageInsightConfigsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesSearchCancel.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * StorageInsightsListByWorkspace.json */ /** - * Sample code: TablesSearchCancel. + * Sample code: StorageInsightsList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void tablesSearchCancel(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.tables() - .cancelSearchWithResponse("oiautorest6685", "oiautorest6685", "table1_SRCH", - com.azure.core.util.Context.NONE); + public static void storageInsightsList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs() + .listByWorkspace("OIAutoRest5123", "aztest5048", com.azure.core.util.Context.NONE); } } ``` -### Tables_CreateOrUpdate +### Tables_Update ```java import com.azure.resourcemanager.loganalytics.models.Column; import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; import com.azure.resourcemanager.loganalytics.models.Schema; +import com.azure.resourcemanager.loganalytics.models.Table; import java.util.Arrays; /** - * Samples for Tables CreateOrUpdate. + * Samples for Tables Update. */ -public final class TablesCreateOrUpdateSamples { +public final class TablesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesUpsert.json */ /** @@ -1806,281 +1861,247 @@ public final class TablesCreateOrUpdateSamples { * @param manager Entry point to LogAnalyticsManager. */ public static void tablesUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.tables() - .define("AzureNetworkFlow") - .withExistingWorkspace("oiautorest6685", "oiautorest6685") + Table resource = manager.tables() + .getWithResponse("oiautorest6685", "oiautorest6685", "AzureNetworkFlow", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withRetentionInDays(45) .withTotalRetentionInDays(70) .withSchema(new Schema().withName("AzureNetworkFlow") .withColumns(Arrays.asList(new Column().withName("MyNewColumn").withType(ColumnTypeEnum.GUID)))) - .create(); + .apply(); } } ``` -### Tables_Delete +### Usages_List ```java -/** - * Samples for Tables Delete. - */ -public final class TablesDeleteSamples { - /* - * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesDelete.json - */ - /** - * Sample code: TablesDelete. - * - * @param manager Entry point to LogAnalyticsManager. - */ - public static void tablesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.tables().delete("oiautorest6685", "oiautorest6685", "table1_CL", com.azure.core.util.Context.NONE); - } -} -``` - -### Tables_Get +import com.azure.resourcemanager.loganalytics.models.StorageAccount; +import java.util.Arrays; -```java /** - * Samples for Tables Get. + * Samples for StorageInsightConfigs CreateOrUpdate. */ -public final class TablesGetSamples { +public final class StorageInsightConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * StorageInsightsCreateOrUpdate.json */ /** - * Sample code: TablesGet. + * Sample code: StorageInsightsCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void tablesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.tables() - .getWithResponse("oiautorest6685", "oiautorest6685", "table1_SRCH", com.azure.core.util.Context.NONE); + public static void storageInsightsCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs() + .define("AzTestSI1110") + .withExistingWorkspace("OIAutoRest5123", "aztest5048") + .withContainers(Arrays.asList("wad-iis-logfiles")) + .withTables(Arrays.asList("WADWindowsEventLogsTable", "LinuxSyslogVer2v0")) + .withStorageAccount(new StorageAccount().withId( + "/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/OIAutoRest6987/providers/microsoft.storage/storageaccounts/AzTestFakeSA9945") + .withKey("fakeTokenPlaceholder")) + .create(); } } ``` -### Tables_ListByWorkspace +### WorkspacePurge_GetPurgeStatus ```java +import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; +import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Tables ListByWorkspace. + * Samples for Workspaces CreateOrUpdate. */ -public final class TablesListByWorkspaceSamples { +public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesCreate.json */ /** - * Sample code: TablesListByWorkspace. + * Sample code: WorkspacesCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void tablesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.tables().listByWorkspace("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + public static void workspacesCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .define("oiautorest6685") + .withRegion("australiasoutheast") + .withExistingResourceGroup("oiautorest6685") + .withTags(mapOf("tag1", "val1")) + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018)) + .withRetentionInDays(30) + .create(); } -} -``` - -### Tables_Migrate -```java -/** - * Samples for Tables Migrate. - */ -public final class TablesMigrateSamples { - /* - * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesMigrate.json - */ - /** - * Sample code: TablesMigrate. - * - * @param manager Entry point to LogAnalyticsManager. - */ - public static void tablesMigrate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.tables() - .migrateWithResponse("oiautorest6685", "oiautorest6685", "table1_CL", com.azure.core.util.Context.NONE); + // Use "Map.of" if available + @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; } } ``` -### Tables_Update +### WorkspacePurge_Purge ```java -import com.azure.resourcemanager.loganalytics.models.Column; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import com.azure.resourcemanager.loganalytics.models.Schema; -import com.azure.resourcemanager.loganalytics.models.Table; -import java.util.Arrays; +import com.azure.resourcemanager.loganalytics.models.Workspace; +import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; +import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; /** - * Samples for Tables Update. + * Samples for Workspaces Update. */ -public final class TablesUpdateSamples { +public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesUpdate.json */ /** - * Sample code: TablesUpsert. + * Sample code: WorkspacesPatch. * * @param manager Entry point to LogAnalyticsManager. */ - public static void tablesUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - Table resource = manager.tables() - .getWithResponse("oiautorest6685", "oiautorest6685", "AzureNetworkFlow", com.azure.core.util.Context.NONE) + public static void workspacesPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Workspace resource = manager.workspaces() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withRetentionInDays(45) - .withTotalRetentionInDays(70) - .withSchema(new Schema().withName("AzureNetworkFlow") - .withColumns(Arrays.asList(new Column().withName("MyNewColumn").withType(ColumnTypeEnum.GUID)))) + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018)) + .withRetentionInDays(30) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(-1.0D)) .apply(); } } ``` -### Usages_List +### Workspaces_CreateOrUpdate ```java /** - * Samples for Usages List. + * Samples for SavedSearches ListByWorkspace. */ -public final class UsagesListSamples { +public final class SavedSearchesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListUsages.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * SavedSearchesListByWorkspace.json */ /** - * Sample code: UsagesList. + * Sample code: SavedSearchesList. * * @param manager Entry point to LogAnalyticsManager. */ - public static void usagesList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.usages().list("rg1", "TestLinkWS", com.azure.core.util.Context.NONE); + public static void savedSearchesList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.savedSearches().listByWorkspaceWithResponse("TestRG", "TestWS", com.azure.core.util.Context.NONE); } } ``` -### WorkspacePurge_GetPurgeStatus +### Workspaces_Delete ```java /** - * Samples for WorkspacePurge GetPurgeStatus. + * Samples for DataExports Get. */ -public final class WorkspacePurgeGetPurgeStatusSamples { +public final class DataExportsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeOperation.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * DataExportGet.json */ /** - * Sample code: WorkspacePurgeOperation. + * Sample code: DataExportGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacePurgeOperation(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspacePurges() - .getPurgeStatusWithResponse("OIAutoRest5123", "aztest5048", "purge-970318e7-b859-4edb-8903-83b1b54d0b74", - com.azure.core.util.Context.NONE); + public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().getWithResponse("RgTest1", "DeWnTest1234", "export1", com.azure.core.util.Context.NONE); } } ``` -### WorkspacePurge_Purge +### Workspaces_Failback ```java -import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBody; -import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBodyFilters; +import com.azure.resourcemanager.loganalytics.models.Column; +import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; +import com.azure.resourcemanager.loganalytics.models.Schema; import java.util.Arrays; /** - * Samples for WorkspacePurge Purge. + * Samples for Tables CreateOrUpdate. */ -public final class WorkspacePurgePurgeSamples { - /* - * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeResourceId.json - */ - /** - * Sample code: WorkspacePurgeResourceId. - * - * @param manager Entry point to LogAnalyticsManager. - */ - public static void workspacePurgeResourceId(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspacePurges() - .purgeWithResponse("OIAutoRest5123", "aztest5048", new WorkspacePurgeBody().withTable("Heartbeat") - .withFilters(Arrays.asList(new WorkspacePurgeBodyFilters().withColumn("_ResourceId") - .withOperator("==") - .withValue( - "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource"))), - com.azure.core.util.Context.NONE); - } - +public final class TablesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurge.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * TablesUpsert.json */ /** - * Sample code: WorkspacePurge. + * Sample code: TablesUpsert. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacePurge(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspacePurges() - .purgeWithResponse("OIAutoRest5123", "aztest5048", - new WorkspacePurgeBody().withTable("Heartbeat") - .withFilters(Arrays.asList(new WorkspacePurgeBodyFilters().withColumn("TimeGenerated") - .withOperator(">") - .withValue("2017-09-01T00:00:00"))), - com.azure.core.util.Context.NONE); + public static void tablesUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables() + .define("AzureNetworkFlow") + .withExistingWorkspace("oiautorest6685", "oiautorest6685") + .withRetentionInDays(45) + .withTotalRetentionInDays(70) + .withSchema(new Schema().withName("AzureNetworkFlow") + .withColumns(Arrays.asList(new Column().withName("MyNewColumn").withType(ColumnTypeEnum.GUID)))) + .create(); } } ``` -### Workspaces_CreateOrUpdate +### Workspaces_Failover ```java -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; +import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchProperties; +import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** - * Samples for Workspaces CreateOrUpdate. + * Samples for Queries Search. */ -public final class WorkspacesCreateOrUpdateSamples { +public final class QueriesSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPackQueriesSearch.json */ /** - * Sample code: WorkspacesCreate. + * Sample code: QuerySearch. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspaces() - .define("oiautorest6685") - .withRegion("australiasoutheast") - .withExistingResourceGroup("oiautorest6685") - .withTags(mapOf("tag1", "val1")) - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018)) - .withRetentionInDays(30) - .create(); + public static void querySearch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queries() + .search("my-resource-group", "my-querypack", + new LogAnalyticsQueryPackQuerySearchProperties() + .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() + .withCategories(Arrays.asList("other", "analytics"))) + .withTags(mapOf("my-label", Arrays.asList("label1"))), + 3L, true, null, com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -2097,49 +2118,60 @@ public final class WorkspacesCreateOrUpdateSamples { } ``` -### Workspaces_Delete +### Workspaces_GetByResourceGroup ```java +import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Workspaces Delete. + * Samples for QueryPacks CreateOrUpdateWithoutName. */ -public final class WorkspacesDeleteSamples { +public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPacksCreateNoName.json */ /** - * Sample code: WorkspacesDelete. + * Sample code: QueryPackCreateNoName. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspaces().delete("oiautorest6685", "oiautorest6685", null, com.azure.core.util.Context.NONE); + public static void queryPackCreateNoName(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks() + .createOrUpdateWithoutNameWithResponse("my-resource-group", + new LogAnalyticsQueryPackInner().withLocation("South Central US"), com.azure.core.util.Context.NONE); } -} -``` -### Workspaces_GetByResourceGroup - -```java -/** - * Samples for Workspaces GetByResourceGroup. - */ -public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPackUpdateNoName.json */ /** - * Sample code: WorkspaceGet. + * Sample code: QueryPackUpdateNoName. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspaceGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspaces() - .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + public static void queryPackUpdateNoName(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queryPacks() + .createOrUpdateWithoutNameWithResponse("my-resource-group", + new LogAnalyticsQueryPackInner().withLocation("South Central US").withTags(mapOf("Tag1", "Value1")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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; } } ``` @@ -2148,21 +2180,22 @@ public final class WorkspacesGetByResourceGroupSamples { ```java /** - * Samples for Workspaces List. + * Samples for Clusters GetByResourceGroup. */ -public final class WorkspacesListSamples { +public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * ClustersGet.json */ /** - * Sample code: WorkspacesSubscriptionList. + * Sample code: ClustersGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspaces().list(com.azure.core.util.Context.NONE); + public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); } } ``` @@ -2171,21 +2204,23 @@ public final class WorkspacesListSamples { ```java /** - * Samples for Workspaces ListByResourceGroup. + * Samples for Queries Get. */ -public final class WorkspacesListByResourceGroupSamples { +public final class QueriesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * QueryPackQueriesGet.json */ /** - * Sample code: WorkspacesGet. + * Sample code: QueryGet. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - manager.workspaces().listByResourceGroup("oiautorest6685", com.azure.core.util.Context.NONE); + public static void queryGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.queries() + .getWithResponse("my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + com.azure.core.util.Context.NONE); } } ``` @@ -2193,34 +2228,47 @@ public final class WorkspacesListByResourceGroupSamples { ### Workspaces_Update ```java -import com.azure.resourcemanager.loganalytics.models.Workspace; -import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; +import com.azure.resourcemanager.loganalytics.models.Capacity; +import com.azure.resourcemanager.loganalytics.models.ClusterSku; +import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; +import java.util.HashMap; +import java.util.Map; /** - * Samples for Workspaces Update. + * Samples for Clusters CreateOrUpdate. */ -public final class WorkspacesUpdateSamples { +public final class ClustersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * ClustersCreate.json */ /** - * Sample code: WorkspacesPatch. + * Sample code: ClustersCreate. * * @param manager Entry point to LogAnalyticsManager. */ - public static void workspacesPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { - Workspace resource = manager.workspaces() - .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018)) - .withRetentionInDays(30) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(-1.0D)) - .apply(); + public static void clustersCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters() + .define("oiautorest6685") + .withRegion("eastus") + .withExistingResourceGroup("oiautorest6685") + .withTags(mapOf("tag1", "val1")) + .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) + .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .create(); + } + + // Use "Map.of" if available + @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/loganalytics/azure-resourcemanager-loganalytics/pom.xml b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml index 5ee96d48b02b..f7230a4366a4 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for LogAnalytics Management - This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2022-10. + This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2025-02-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - false true diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java index d6bdc947ef43..2521b5390ad5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.OperationalInsightsManagementClient; import com.azure.resourcemanager.loganalytics.implementation.AvailableServiceTiersImpl; @@ -73,6 +74,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -81,14 +83,16 @@ * Operational Insights Client. */ public final class LogAnalyticsManager { - private QueryPacks queryPacks; + private AvailableServiceTiers availableServiceTiers; - private Queries queries; + private Clusters clusters; private DataExports dataExports; private DataSources dataSources; + private Gateways gateways; + private IntelligencePacks intelligencePacks; private LinkedServices linkedServices; @@ -97,34 +101,32 @@ public final class LogAnalyticsManager { private ManagementGroups managementGroups; - private OperationStatuses operationStatuses; + private Operations operations; - private SharedKeysOperations sharedKeysOperations; + private OperationStatuses operationStatuses; - private Usages usages; + private Queries queries; - private StorageInsightConfigs storageInsightConfigs; + private QueryPacks queryPacks; private SavedSearches savedSearches; - private AvailableServiceTiers availableServiceTiers; + private Schemas schemas; - private Gateways gateways; + private SharedKeysOperations sharedKeysOperations; - private Schemas schemas; + private StorageInsightConfigs storageInsightConfigs; - private WorkspacePurges workspacePurges; + private Tables tables; - private Clusters clusters; + private Usages usages; - private Operations operations; + private WorkspacePurges workspacePurges; private Workspaces workspaces; private DeletedWorkspaces deletedWorkspaces; - private Tables tables; - private final OperationalInsightsManagementClient clientObject; private LogAnalyticsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -177,6 +179,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-loganalytics.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -284,12 +289,14 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.loganalytics") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -336,27 +343,27 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile } /** - * Gets the resource collection API of QueryPacks. It manages LogAnalyticsQueryPack. + * Gets the resource collection API of AvailableServiceTiers. * - * @return Resource collection API of QueryPacks. + * @return Resource collection API of AvailableServiceTiers. */ - public QueryPacks queryPacks() { - if (this.queryPacks == null) { - this.queryPacks = new QueryPacksImpl(clientObject.getQueryPacks(), this); + public AvailableServiceTiers availableServiceTiers() { + if (this.availableServiceTiers == null) { + this.availableServiceTiers = new AvailableServiceTiersImpl(clientObject.getAvailableServiceTiers(), this); } - return queryPacks; + return availableServiceTiers; } /** - * Gets the resource collection API of Queries. It manages LogAnalyticsQueryPackQuery. + * Gets the resource collection API of Clusters. It manages Cluster. * - * @return Resource collection API of Queries. + * @return Resource collection API of Clusters. */ - public Queries queries() { - if (this.queries == null) { - this.queries = new QueriesImpl(clientObject.getQueries(), this); + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); } - return queries; + return clusters; } /** @@ -383,6 +390,18 @@ public DataSources dataSources() { return dataSources; } + /** + * Gets the resource collection API of Gateways. + * + * @return Resource collection API of Gateways. + */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + } + return gateways; + } + /** * Gets the resource collection API of IntelligencePacks. * @@ -432,51 +451,51 @@ public ManagementGroups managementGroups() { } /** - * Gets the resource collection API of OperationStatuses. + * Gets the resource collection API of Operations. * - * @return Resource collection API of OperationStatuses. + * @return Resource collection API of Operations. */ - public OperationStatuses operationStatuses() { - if (this.operationStatuses == null) { - this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return operationStatuses; + return operations; } /** - * Gets the resource collection API of SharedKeysOperations. + * Gets the resource collection API of OperationStatuses. * - * @return Resource collection API of SharedKeysOperations. + * @return Resource collection API of OperationStatuses. */ - public SharedKeysOperations sharedKeysOperations() { - if (this.sharedKeysOperations == null) { - this.sharedKeysOperations = new SharedKeysOperationsImpl(clientObject.getSharedKeysOperations(), this); + public OperationStatuses operationStatuses() { + if (this.operationStatuses == null) { + this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this); } - return sharedKeysOperations; + return operationStatuses; } /** - * Gets the resource collection API of Usages. + * Gets the resource collection API of Queries. It manages LogAnalyticsQueryPackQuery. * - * @return Resource collection API of Usages. + * @return Resource collection API of Queries. */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); + public Queries queries() { + if (this.queries == null) { + this.queries = new QueriesImpl(clientObject.getQueries(), this); } - return usages; + return queries; } /** - * Gets the resource collection API of StorageInsightConfigs. It manages StorageInsight. + * Gets the resource collection API of QueryPacks. It manages LogAnalyticsQueryPack. * - * @return Resource collection API of StorageInsightConfigs. + * @return Resource collection API of QueryPacks. */ - public StorageInsightConfigs storageInsightConfigs() { - if (this.storageInsightConfigs == null) { - this.storageInsightConfigs = new StorageInsightConfigsImpl(clientObject.getStorageInsightConfigs(), this); + public QueryPacks queryPacks() { + if (this.queryPacks == null) { + this.queryPacks = new QueryPacksImpl(clientObject.getQueryPacks(), this); } - return storageInsightConfigs; + return queryPacks; } /** @@ -492,75 +511,75 @@ public SavedSearches savedSearches() { } /** - * Gets the resource collection API of AvailableServiceTiers. + * Gets the resource collection API of Schemas. * - * @return Resource collection API of AvailableServiceTiers. + * @return Resource collection API of Schemas. */ - public AvailableServiceTiers availableServiceTiers() { - if (this.availableServiceTiers == null) { - this.availableServiceTiers = new AvailableServiceTiersImpl(clientObject.getAvailableServiceTiers(), this); + public Schemas schemas() { + if (this.schemas == null) { + this.schemas = new SchemasImpl(clientObject.getSchemas(), this); } - return availableServiceTiers; + return schemas; } /** - * Gets the resource collection API of Gateways. + * Gets the resource collection API of SharedKeysOperations. * - * @return Resource collection API of Gateways. + * @return Resource collection API of SharedKeysOperations. */ - public Gateways gateways() { - if (this.gateways == null) { - this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + public SharedKeysOperations sharedKeysOperations() { + if (this.sharedKeysOperations == null) { + this.sharedKeysOperations = new SharedKeysOperationsImpl(clientObject.getSharedKeysOperations(), this); } - return gateways; + return sharedKeysOperations; } /** - * Gets the resource collection API of Schemas. + * Gets the resource collection API of StorageInsightConfigs. It manages StorageInsight. * - * @return Resource collection API of Schemas. + * @return Resource collection API of StorageInsightConfigs. */ - public Schemas schemas() { - if (this.schemas == null) { - this.schemas = new SchemasImpl(clientObject.getSchemas(), this); + public StorageInsightConfigs storageInsightConfigs() { + if (this.storageInsightConfigs == null) { + this.storageInsightConfigs = new StorageInsightConfigsImpl(clientObject.getStorageInsightConfigs(), this); } - return schemas; + return storageInsightConfigs; } /** - * Gets the resource collection API of WorkspacePurges. + * Gets the resource collection API of Tables. It manages Table. * - * @return Resource collection API of WorkspacePurges. + * @return Resource collection API of Tables. */ - public WorkspacePurges workspacePurges() { - if (this.workspacePurges == null) { - this.workspacePurges = new WorkspacePurgesImpl(clientObject.getWorkspacePurges(), this); + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(clientObject.getTables(), this); } - return workspacePurges; + return tables; } /** - * Gets the resource collection API of Clusters. It manages Cluster. + * Gets the resource collection API of Usages. * - * @return Resource collection API of Clusters. + * @return Resource collection API of Usages. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); } - return clusters; + return usages; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of WorkspacePurges. * - * @return Resource collection API of Operations. + * @return Resource collection API of WorkspacePurges. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public WorkspacePurges workspacePurges() { + if (this.workspacePurges == null) { + this.workspacePurges = new WorkspacePurgesImpl(clientObject.getWorkspacePurges(), this); } - return operations; + return workspacePurges; } /** @@ -587,18 +606,6 @@ public DeletedWorkspaces deletedWorkspaces() { return deletedWorkspaces; } - /** - * Gets the resource collection API of Tables. It manages Table. - * - * @return Resource collection API of Tables. - */ - public Tables tables() { - if (this.tables == null) { - this.tables = new TablesImpl(clientObject.getTables(), this); - } - return tables; - } - /** * Gets wrapped service client OperationalInsightsManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java index 76c429b02fe3..a230e66c3854 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java @@ -25,6 +25,13 @@ public interface OperationalInsightsManagementClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -40,18 +47,18 @@ public interface OperationalInsightsManagementClient { Duration getDefaultPollInterval(); /** - * Gets the QueryPacksClient object to access its operations. + * Gets the AvailableServiceTiersClient object to access its operations. * - * @return the QueryPacksClient object. + * @return the AvailableServiceTiersClient object. */ - QueryPacksClient getQueryPacks(); + AvailableServiceTiersClient getAvailableServiceTiers(); /** - * Gets the QueriesClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the QueriesClient object. + * @return the ClustersClient object. */ - QueriesClient getQueries(); + ClustersClient getClusters(); /** * Gets the DataExportsClient object to access its operations. @@ -67,6 +74,13 @@ public interface OperationalInsightsManagementClient { */ DataSourcesClient getDataSources(); + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + GatewaysClient getGateways(); + /** * Gets the IntelligencePacksClient object to access its operations. * @@ -96,32 +110,32 @@ public interface OperationalInsightsManagementClient { ManagementGroupsClient getManagementGroups(); /** - * Gets the OperationStatusesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the OperationStatusesClient object. + * @return the OperationsClient object. */ - OperationStatusesClient getOperationStatuses(); + OperationsClient getOperations(); /** - * Gets the SharedKeysOperationsClient object to access its operations. + * Gets the OperationStatusesClient object to access its operations. * - * @return the SharedKeysOperationsClient object. + * @return the OperationStatusesClient object. */ - SharedKeysOperationsClient getSharedKeysOperations(); + OperationStatusesClient getOperationStatuses(); /** - * Gets the UsagesClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the UsagesClient object. + * @return the QueriesClient object. */ - UsagesClient getUsages(); + QueriesClient getQueries(); /** - * Gets the StorageInsightConfigsClient object to access its operations. + * Gets the QueryPacksClient object to access its operations. * - * @return the StorageInsightConfigsClient object. + * @return the QueryPacksClient object. */ - StorageInsightConfigsClient getStorageInsightConfigs(); + QueryPacksClient getQueryPacks(); /** * Gets the SavedSearchesClient object to access its operations. @@ -131,46 +145,46 @@ public interface OperationalInsightsManagementClient { SavedSearchesClient getSavedSearches(); /** - * Gets the AvailableServiceTiersClient object to access its operations. + * Gets the SchemasClient object to access its operations. * - * @return the AvailableServiceTiersClient object. + * @return the SchemasClient object. */ - AvailableServiceTiersClient getAvailableServiceTiers(); + SchemasClient getSchemas(); /** - * Gets the GatewaysClient object to access its operations. + * Gets the SharedKeysOperationsClient object to access its operations. * - * @return the GatewaysClient object. + * @return the SharedKeysOperationsClient object. */ - GatewaysClient getGateways(); + SharedKeysOperationsClient getSharedKeysOperations(); /** - * Gets the SchemasClient object to access its operations. + * Gets the StorageInsightConfigsClient object to access its operations. * - * @return the SchemasClient object. + * @return the StorageInsightConfigsClient object. */ - SchemasClient getSchemas(); + StorageInsightConfigsClient getStorageInsightConfigs(); /** - * Gets the WorkspacePurgesClient object to access its operations. + * Gets the TablesClient object to access its operations. * - * @return the WorkspacePurgesClient object. + * @return the TablesClient object. */ - WorkspacePurgesClient getWorkspacePurges(); + TablesClient getTables(); /** - * Gets the ClustersClient object to access its operations. + * Gets the UsagesClient object to access its operations. * - * @return the ClustersClient object. + * @return the UsagesClient object. */ - ClustersClient getClusters(); + UsagesClient getUsages(); /** - * Gets the OperationsClient object to access its operations. + * Gets the WorkspacePurgesClient object to access its operations. * - * @return the OperationsClient object. + * @return the WorkspacePurgesClient object. */ - OperationsClient getOperations(); + WorkspacePurgesClient getWorkspacePurges(); /** * Gets the WorkspacesClient object to access its operations. @@ -185,11 +199,4 @@ public interface OperationalInsightsManagementClient { * @return the DeletedWorkspacesClient object. */ DeletedWorkspacesClient getDeletedWorkspaces(); - - /** - * Gets the TablesClient object to access its operations. - * - * @return the TablesClient object. - */ - TablesClient getTables(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java index 9762af2104eb..95c67eff5f20 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java @@ -248,4 +248,141 @@ Response updateWithResponse(String resourceGroupName, String wor */ @ServiceMethod(returns = ReturnType.SINGLE) WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailover(String resourceGroupName, String location, String workspaceName, + Context context); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failover(String resourceGroupName, String location, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failback(String resourceGroupName, String workspaceName, Context context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java index dca539d1283f..ab9cf38774f6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java @@ -13,10 +13,12 @@ import com.azure.resourcemanager.loganalytics.models.BillingType; import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -279,7 +281,7 @@ public ClusterInner withKeyVaultProperties(KeyVaultProperties keyVaultProperties * * @return the lastModifiedDate value. */ - public String lastModifiedDate() { + public OffsetDateTime lastModifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDate(); } @@ -288,7 +290,7 @@ public String lastModifiedDate() { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -302,39 +304,48 @@ public List associatedWorkspaces() { } /** - * Set the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. + * Get the capacityReservationProperties property: Additional properties for capacity reservation. * - * @param associatedWorkspaces the associatedWorkspaces value to set. + * @return the capacityReservationProperties value. + */ + public CapacityReservationProperties capacityReservationProperties() { + return this.innerProperties() == null ? null : this.innerProperties().capacityReservationProperties(); + } + + /** + * Set the capacityReservationProperties property: Additional properties for capacity reservation. + * + * @param capacityReservationProperties the capacityReservationProperties value to set. * @return the ClusterInner object itself. */ - public ClusterInner withAssociatedWorkspaces(List associatedWorkspaces) { + public ClusterInner withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { if (this.innerProperties() == null) { this.innerProperties = new ClusterProperties(); } - this.innerProperties().withAssociatedWorkspaces(associatedWorkspaces); + this.innerProperties().withCapacityReservationProperties(capacityReservationProperties); return this; } /** - * Get the capacityReservationProperties property: Additional properties for capacity reservation. + * Get the replication property: Cluster's replication properties. * - * @return the capacityReservationProperties value. + * @return the replication value. */ - public CapacityReservationProperties capacityReservationProperties() { - return this.innerProperties() == null ? null : this.innerProperties().capacityReservationProperties(); + public ClusterReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); } /** - * Set the capacityReservationProperties property: Additional properties for capacity reservation. + * Set the replication property: Cluster's replication properties. * - * @param capacityReservationProperties the capacityReservationProperties value to set. + * @param replication the replication value to set. * @return the ClusterInner object itself. */ - public ClusterInner withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { + public ClusterInner withReplication(ClusterReplicationProperties replication) { if (this.innerProperties() == null) { this.innerProperties = new ClusterProperties(); } - this.innerProperties().withCapacityReservationProperties(capacityReservationProperties); + this.innerProperties().withReplication(replication); return this; } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java index 4e19d868af64..0f579cd521bb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,8 +14,10 @@ import com.azure.resourcemanager.loganalytics.models.BillingType; import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -58,12 +61,12 @@ public final class ClusterProperties implements JsonSerializable associatedWorkspaces() { return this.associatedWorkspaces; } - /** - * Set the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. - * - * @param associatedWorkspaces the associatedWorkspaces value to set. - * @return the ClusterProperties object itself. - */ - public ClusterProperties withAssociatedWorkspaces(List associatedWorkspaces) { - this.associatedWorkspaces = associatedWorkspaces; - return this; - } - /** * Get the capacityReservationProperties property: Additional properties for capacity reservation. * @@ -244,6 +241,26 @@ public CapacityReservationProperties capacityReservationProperties() { return this; } + /** + * Get the replication property: Cluster's replication properties. + * + * @return the replication value. + */ + public ClusterReplicationProperties replication() { + return this.replication; + } + + /** + * Set the replication property: Cluster's replication properties. + * + * @param replication the replication value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withReplication(ClusterReplicationProperties replication) { + this.replication = replication; + return this; + } + /** * Validates the instance. * @@ -259,6 +276,9 @@ public void validate() { if (capacityReservationProperties() != null) { capacityReservationProperties().validate(); } + if (replication() != null) { + replication().validate(); + } } /** @@ -271,9 +291,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("isAvailabilityZonesEnabled", this.isAvailabilityZonesEnabled); jsonWriter.writeStringField("billingType", this.billingType == null ? null : this.billingType.toString()); jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); - jsonWriter.writeArrayField("associatedWorkspaces", this.associatedWorkspaces, - (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("capacityReservationProperties", this.capacityReservationProperties); + jsonWriter.writeJsonField("replication", this.replication); return jsonWriter.writeEndObject(); } @@ -308,9 +327,11 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti } else if ("keyVaultProperties".equals(fieldName)) { deserializedClusterProperties.keyVaultProperties = KeyVaultProperties.fromJson(reader); } else if ("lastModifiedDate".equals(fieldName)) { - deserializedClusterProperties.lastModifiedDate = reader.getString(); + deserializedClusterProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("createdDate".equals(fieldName)) { - deserializedClusterProperties.createdDate = reader.getString(); + deserializedClusterProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("associatedWorkspaces".equals(fieldName)) { List associatedWorkspaces = reader.readArray(reader1 -> AssociatedWorkspace.fromJson(reader1)); @@ -318,6 +339,8 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti } else if ("capacityReservationProperties".equals(fieldName)) { deserializedClusterProperties.capacityReservationProperties = CapacityReservationProperties.fromJson(reader); + } else if ("replication".equals(fieldName)) { + deserializedClusterProperties.replication = ClusterReplicationProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java index e5fc73ff7755..855631fc4208 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loganalytics.models.QueryPacksResource; import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -18,12 +19,17 @@ * An Log Analytics QueryPack definition. */ @Fluent -public final class LogAnalyticsQueryPackInner extends QueryPacksResource { +public final class LogAnalyticsQueryPackInner extends Resource { /* * Properties that define a Log Analytics QueryPack resource. */ private LogAnalyticsQueryPackProperties innerProperties = new LogAnalyticsQueryPackProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -54,6 +60,15 @@ private LogAnalyticsQueryPackProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -145,7 +160,6 @@ public String provisioningState() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() == null) { throw LOGGER.atError() @@ -200,6 +214,8 @@ public static LogAnalyticsQueryPackInner fromJson(JsonReader jsonReader) throws } else if ("properties".equals(fieldName)) { deserializedLogAnalyticsQueryPackInner.innerProperties = LogAnalyticsQueryPackProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogAnalyticsQueryPackInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java index 2d3af3ceef01..baf421ce5d1b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java @@ -5,11 +5,11 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loganalytics.models.AzureResourceProperties; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,29 +20,29 @@ * A Log Analytics QueryPack-Query definition. */ @Fluent -public final class LogAnalyticsQueryPackQueryInner extends AzureResourceProperties { +public final class LogAnalyticsQueryPackQueryInner extends ProxyResource { /* * Properties that define an Log Analytics QueryPack-Query resource. */ private LogAnalyticsQueryPackQueryProperties innerProperties; /* - * Read only system data + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; /* - * Azure resource type + * The type of the resource. */ private String type; /* - * Azure resource name + * The name of the resource. */ private String name; /* - * Azure resource Id + * Fully qualified resource Id for the resource. */ private String id; @@ -62,17 +62,16 @@ private LogAnalyticsQueryPackQueryProperties innerProperties() { } /** - * Get the systemData property: Read only system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ - @Override public SystemData systemData() { return this.systemData; } /** - * Get the type property: Azure resource type. + * Get the type property: The type of the resource. * * @return the type value. */ @@ -82,7 +81,7 @@ public String type() { } /** - * Get the name property: Azure resource name. + * Get the name property: The name of the resource. * * @return the name value. */ @@ -92,7 +91,7 @@ public String name() { } /** - * Get the id property: Azure resource Id. + * Get the id property: Fully qualified resource Id for the resource. * * @return the id value. */ @@ -280,7 +279,6 @@ public LogAnalyticsQueryPackQueryInner withProperties(Object properties) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -303,6 +301,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of LogAnalyticsQueryPackQueryInner if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the LogAnalyticsQueryPackQueryInner. */ public static LogAnalyticsQueryPackQueryInner fromJson(JsonReader jsonReader) throws IOException { @@ -319,11 +318,11 @@ public static LogAnalyticsQueryPackQueryInner fromJson(JsonReader jsonReader) th deserializedLogAnalyticsQueryPackQueryInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedLogAnalyticsQueryPackQueryInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedLogAnalyticsQueryPackQueryInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedLogAnalyticsQueryPackQueryInner.innerProperties = LogAnalyticsQueryPackQueryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogAnalyticsQueryPackQueryInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java index 4923dec7fdff..ce147ac49161 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -14,7 +15,6 @@ import com.azure.resourcemanager.loganalytics.models.ResultStatistics; import com.azure.resourcemanager.loganalytics.models.Schema; import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; import java.io.IOException; @@ -31,7 +31,7 @@ public final class TableInner extends ProxyResource { /* * Metadata pertaining to creation and last modification of the resource. */ - private SystemDataAutoGenerated systemData; + private SystemData systemData; /* * The type of the resource. @@ -68,7 +68,7 @@ private TableProperties innerProperties() { * * @return the systemData value. */ - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.systemData; } @@ -312,9 +312,6 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } - if (systemData() != null) { - systemData().validate(); - } } /** @@ -352,7 +349,7 @@ public static TableInner fromJson(JsonReader jsonReader) throws IOException { } else if ("properties".equals(fieldName)) { deserializedTableInner.innerProperties = TableProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedTableInner.systemData = SystemDataAutoGenerated.fromJson(reader); + deserializedTableInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java index 629b221fc494..65c697daf679 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java @@ -6,18 +6,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -39,7 +42,7 @@ public final class WorkspaceInner extends Resource { /* * Metadata pertaining to creation and last modification of the resource. */ - private SystemDataAutoGenerated systemData; + private SystemData systemData; /* * The etag of the workspace. @@ -101,7 +104,7 @@ public WorkspaceInner withIdentity(Identity identity) { * * @return the systemData value. */ - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.systemData; } @@ -267,7 +270,7 @@ public WorkspaceInner withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -276,7 +279,7 @@ public String createdDate() { * * @return the modifiedDate value. */ - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } @@ -408,6 +411,52 @@ public WorkspaceInner withDefaultDataCollectionRuleResourceId(String defaultData return this; } + /** + * Get the replication property: workspace replication properties. + * + * @return the replication value. + */ + public WorkspaceReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: workspace replication properties. + * + * @param replication the replication value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withReplication(WorkspaceReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + + /** + * Get the failover property: workspace failover properties. + * + * @return the failover value. + */ + public WorkspaceFailoverProperties failover() { + return this.innerProperties() == null ? null : this.innerProperties().failover(); + } + + /** + * Set the failover property: workspace failover properties. + * + * @param failover the failover value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withFailover(WorkspaceFailoverProperties failover) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFailover(failover); + return this; + } + /** * Validates the instance. * @@ -420,9 +469,6 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (systemData() != null) { - systemData().validate(); - } } /** @@ -471,7 +517,7 @@ public static WorkspaceInner fromJson(JsonReader jsonReader) throws IOException } else if ("identity".equals(fieldName)) { deserializedWorkspaceInner.identity = Identity.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedWorkspaceInner.systemData = SystemDataAutoGenerated.fromJson(reader); + deserializedWorkspaceInner.systemData = SystemData.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedWorkspaceInner.etag = reader.getString(); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java index 53c89225a8c1..a951ec0ccf06 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,9 +14,12 @@ import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -52,12 +56,12 @@ public final class WorkspaceProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("modifiedDate".equals(fieldName)) { - deserializedWorkspaceProperties.modifiedDate = reader.getString(); + deserializedWorkspaceProperties.modifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("publicNetworkAccessForIngestion".equals(fieldName)) { deserializedWorkspaceProperties.publicNetworkAccessForIngestion = PublicNetworkAccessType.fromString(reader.getString()); @@ -394,6 +458,10 @@ public static WorkspaceProperties fromJson(JsonReader jsonReader) throws IOExcep deserializedWorkspaceProperties.features = WorkspaceFeatures.fromJson(reader); } else if ("defaultDataCollectionRuleResourceId".equals(fieldName)) { deserializedWorkspaceProperties.defaultDataCollectionRuleResourceId = reader.getString(); + } else if ("replication".equals(fieldName)) { + deserializedWorkspaceProperties.replication = WorkspaceReplicationProperties.fromJson(reader); + } else if ("failover".equals(fieldName)) { + deserializedWorkspaceProperties.failover = WorkspaceFailoverProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java index bf7d14fc433d..13fe12059cd5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java @@ -97,11 +97,10 @@ private Mono>> listByWorkspaceWithRespo if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -135,11 +134,10 @@ private Mono>> listByWorkspaceWithRespo if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context); + workspaceName, this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java index d8419d40e0e5..2d0bed8cf989 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java @@ -13,9 +13,11 @@ import com.azure.resourcemanager.loganalytics.models.Cluster; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; import com.azure.resourcemanager.loganalytics.models.ClusterPatch; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -82,11 +84,11 @@ public KeyVaultProperties keyVaultProperties() { return this.innerModel().keyVaultProperties(); } - public String lastModifiedDate() { + public OffsetDateTime lastModifiedDate() { return this.innerModel().lastModifiedDate(); } - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerModel().createdDate(); } @@ -103,6 +105,10 @@ public CapacityReservationProperties capacityReservationProperties() { return this.innerModel().capacityReservationProperties(); } + public ClusterReplicationProperties replication() { + return this.innerModel().replication(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -266,13 +272,13 @@ public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) } } - public ClusterImpl withAssociatedWorkspaces(List associatedWorkspaces) { - this.innerModel().withAssociatedWorkspaces(associatedWorkspaces); + public ClusterImpl withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { + this.innerModel().withCapacityReservationProperties(capacityReservationProperties); return this; } - public ClusterImpl withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { - this.innerModel().withCapacityReservationProperties(capacityReservationProperties); + public ClusterImpl withReplication(ClusterReplicationProperties replication) { + this.innerModel().withReplication(replication); return this; } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java index 019b3c86f818..585dc508fe75 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java @@ -89,7 +89,7 @@ Mono> list(@HostParam("$host") String endpoint, @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") - @ExpectedResponses({ 200, 201, 202 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -117,7 +117,7 @@ Mono> getByResourceGroup(@HostParam("$host") String endpo @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @@ -165,11 +165,10 @@ private Mono> listByResourceGroupSinglePageAsync(Str return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -201,11 +200,10 @@ private Mono> listByResourceGroupSinglePageAsync(Str return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -289,11 +287,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); @@ -319,10 +316,11 @@ private Mono> listSinglePageAsync(Context context) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -415,11 +413,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), clusterName, parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), clusterName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -459,10 +456,9 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), clusterName, parameters, accept, context); } @@ -641,11 +637,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -678,10 +673,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, apiVersion, + return service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } @@ -843,11 +837,11 @@ private Mono> getByResourceGroupWithResponseAsync(String if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, apiVersion, clusterName, accept, context)) + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -880,11 +874,10 @@ private Mono> getByResourceGroupWithResponseAsync(String if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - apiVersion, clusterName, accept, context); + this.client.getApiVersion(), clusterName, accept, context); } /** @@ -970,11 +963,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, clusterName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1014,10 +1006,9 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, clusterName, apiVersion, + return service.update(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java index cc3f35ee6341..a98c4b3c0144 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java @@ -135,11 +135,10 @@ private Mono> listByWorkspaceSinglePageAsync(Stri if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), 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())); @@ -175,12 +174,11 @@ private Mono> listByWorkspaceSinglePageAsync(Stri if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context) + workspaceName, this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } @@ -288,11 +286,11 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, parameters, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -336,11 +334,10 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, dataExportName, apiVersion, parameters, accept, context); + workspaceName, dataExportName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -433,11 +430,10 @@ private Mono> getWithResponseAsync(String resourceGrou if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -474,11 +470,10 @@ private Mono> getWithResponseAsync(String resourceGrou if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - dataExportName, apiVersion, accept, context); + dataExportName, this.client.getApiVersion(), accept, context); } /** @@ -564,11 +559,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -605,11 +599,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, dataExportName, apiVersion, accept, context); + workspaceName, dataExportName, this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java index 79fcd6463169..f8d5dccc1b5f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java @@ -151,11 +151,11 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -198,11 +198,10 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context); + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -295,10 +294,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -335,10 +333,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, apiVersion, - this.client.getSubscriptionId(), context); + return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -423,11 +420,10 @@ private Mono> getWithResponseAsync(String resourceGrou return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -464,11 +460,10 @@ private Mono> getWithResponseAsync(String resourceGrou return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -556,11 +551,10 @@ private Mono> listByWorkspaceSinglePageAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - filter, skiptoken, apiVersion, this.client.getSubscriptionId(), accept, context)) + filter, skiptoken, this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -601,12 +595,11 @@ private Mono> listByWorkspaceSinglePageAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, skiptoken, apiVersion, - this.client.getSubscriptionId(), accept, context) + .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, skiptoken, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java index 69fc3b58644c..24e889ca6305 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java @@ -97,11 +97,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); @@ -127,10 +126,11 @@ private Mono> listSinglePageAsync(Context context) return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } @@ -215,11 +215,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -251,11 +250,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java index cc9b1d782cc7..fe369450eace 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java @@ -96,10 +96,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (gatewayId == null) { return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, gatewayId, apiVersion, context)) + resourceGroupName, workspaceName, gatewayId, this.client.getApiVersion(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -136,10 +135,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (gatewayId == null) { return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, gatewayId, apiVersion, context); + workspaceName, gatewayId, this.client.getApiVersion(), context); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java index adf553c5c7b2..2889312c6480 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java @@ -122,10 +122,9 @@ private Mono> disableWithResponseAsync(String resourceGroupName, return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.disable(this.client.getEndpoint(), resourceGroupName, workspaceName, - intelligencePackName, apiVersion, this.client.getSubscriptionId(), context)) + intelligencePackName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -163,10 +162,9 @@ private Mono> disableWithResponseAsync(String resourceGroupName, return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; context = this.client.mergeContext(context); return service.disable(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, - apiVersion, this.client.getSubscriptionId(), context); + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -252,10 +250,9 @@ private Mono> enableWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.enable(this.client.getEndpoint(), resourceGroupName, workspaceName, - intelligencePackName, apiVersion, this.client.getSubscriptionId(), context)) + intelligencePackName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -293,10 +290,9 @@ private Mono> enableWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; context = this.client.mergeContext(context); return service.enable(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, - apiVersion, this.client.getSubscriptionId(), context); + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -377,11 +373,10 @@ private Mono>> listWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -414,10 +409,9 @@ private Mono>> listWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + return service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java index fd4b651ecddc..d7252350dee5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java @@ -149,11 +149,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + linkedServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -198,11 +198,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); } /** @@ -399,11 +398,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + linkedServiceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -442,11 +440,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, - apiVersion, this.client.getSubscriptionId(), accept, context); + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -630,11 +627,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + linkedServiceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -672,11 +668,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -760,11 +755,10 @@ private Mono> listByWorkspaceSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -800,11 +794,10 @@ private Mono> listByWorkspaceSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java index 14c65e99b288..f6d51ed08aa2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java @@ -145,11 +145,11 @@ private Mono> createOrUpdateWithRes } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + dataSourceType, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -195,11 +195,10 @@ private Mono> createOrUpdateWithRes } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); } /** @@ -296,10 +295,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, apiVersion, this.client.getSubscriptionId(), context)) + dataSourceType, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -336,10 +334,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, apiVersion, - this.client.getSubscriptionId(), context); + return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -425,11 +422,10 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, apiVersion, this.client.getSubscriptionId(), accept, context)) + dataSourceType, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -467,11 +463,10 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -559,11 +554,10 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, apiVersion, workspaceName, accept, context)) + resourceGroupName, this.client.getApiVersion(), workspaceName, 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())); @@ -600,12 +594,11 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, - workspaceName, accept, context) + .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), workspaceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java index 96d8b006e861..4114c2d0563a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -44,6 +45,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String queryPackId() { return this.innerModel().queryPackId(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java index 411b94fc8e02..654752f55348 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java @@ -101,11 +101,10 @@ private Mono> listSinglePageAsync(String res return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -141,11 +140,10 @@ private Mono> listSinglePageAsync(String res return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + .list(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java index f0da81820b4d..08233bb7167e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java @@ -95,11 +95,10 @@ private Mono> getWithResponseAsync(String locatio return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), location, asyncOperationId, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), location, asyncOperationId, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -133,10 +132,9 @@ private Mono> getWithResponseAsync(String locatio return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), location, asyncOperationId, apiVersion, + return service.get(this.client.getEndpoint(), location, asyncOperationId, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java index d0f29df2b257..469d4100b3f6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java @@ -88,6 +88,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -131,31 +145,31 @@ public Duration getDefaultPollInterval() { } /** - * The QueryPacksClient object to access its operations. + * The AvailableServiceTiersClient object to access its operations. */ - private final QueryPacksClient queryPacks; + private final AvailableServiceTiersClient availableServiceTiers; /** - * Gets the QueryPacksClient object to access its operations. + * Gets the AvailableServiceTiersClient object to access its operations. * - * @return the QueryPacksClient object. + * @return the AvailableServiceTiersClient object. */ - public QueryPacksClient getQueryPacks() { - return this.queryPacks; + public AvailableServiceTiersClient getAvailableServiceTiers() { + return this.availableServiceTiers; } /** - * The QueriesClient object to access its operations. + * The ClustersClient object to access its operations. */ - private final QueriesClient queries; + private final ClustersClient clusters; /** - * Gets the QueriesClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the QueriesClient object. + * @return the ClustersClient object. */ - public QueriesClient getQueries() { - return this.queries; + public ClustersClient getClusters() { + return this.clusters; } /** @@ -186,6 +200,20 @@ public DataSourcesClient getDataSources() { return this.dataSources; } + /** + * The GatewaysClient object to access its operations. + */ + private final GatewaysClient gateways; + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + public GatewaysClient getGateways() { + return this.gateways; + } + /** * The IntelligencePacksClient object to access its operations. */ @@ -243,59 +271,59 @@ public ManagementGroupsClient getManagementGroups() { } /** - * The OperationStatusesClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final OperationStatusesClient operationStatuses; + private final OperationsClient operations; /** - * Gets the OperationStatusesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the OperationStatusesClient object. + * @return the OperationsClient object. */ - public OperationStatusesClient getOperationStatuses() { - return this.operationStatuses; + public OperationsClient getOperations() { + return this.operations; } /** - * The SharedKeysOperationsClient object to access its operations. + * The OperationStatusesClient object to access its operations. */ - private final SharedKeysOperationsClient sharedKeysOperations; + private final OperationStatusesClient operationStatuses; /** - * Gets the SharedKeysOperationsClient object to access its operations. + * Gets the OperationStatusesClient object to access its operations. * - * @return the SharedKeysOperationsClient object. + * @return the OperationStatusesClient object. */ - public SharedKeysOperationsClient getSharedKeysOperations() { - return this.sharedKeysOperations; + public OperationStatusesClient getOperationStatuses() { + return this.operationStatuses; } /** - * The UsagesClient object to access its operations. + * The QueriesClient object to access its operations. */ - private final UsagesClient usages; + private final QueriesClient queries; /** - * Gets the UsagesClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the UsagesClient object. + * @return the QueriesClient object. */ - public UsagesClient getUsages() { - return this.usages; + public QueriesClient getQueries() { + return this.queries; } /** - * The StorageInsightConfigsClient object to access its operations. + * The QueryPacksClient object to access its operations. */ - private final StorageInsightConfigsClient storageInsightConfigs; + private final QueryPacksClient queryPacks; /** - * Gets the StorageInsightConfigsClient object to access its operations. + * Gets the QueryPacksClient object to access its operations. * - * @return the StorageInsightConfigsClient object. + * @return the QueryPacksClient object. */ - public StorageInsightConfigsClient getStorageInsightConfigs() { - return this.storageInsightConfigs; + public QueryPacksClient getQueryPacks() { + return this.queryPacks; } /** @@ -313,87 +341,87 @@ public SavedSearchesClient getSavedSearches() { } /** - * The AvailableServiceTiersClient object to access its operations. + * The SchemasClient object to access its operations. */ - private final AvailableServiceTiersClient availableServiceTiers; + private final SchemasClient schemas; /** - * Gets the AvailableServiceTiersClient object to access its operations. + * Gets the SchemasClient object to access its operations. * - * @return the AvailableServiceTiersClient object. + * @return the SchemasClient object. */ - public AvailableServiceTiersClient getAvailableServiceTiers() { - return this.availableServiceTiers; + public SchemasClient getSchemas() { + return this.schemas; } /** - * The GatewaysClient object to access its operations. + * The SharedKeysOperationsClient object to access its operations. */ - private final GatewaysClient gateways; + private final SharedKeysOperationsClient sharedKeysOperations; /** - * Gets the GatewaysClient object to access its operations. + * Gets the SharedKeysOperationsClient object to access its operations. * - * @return the GatewaysClient object. + * @return the SharedKeysOperationsClient object. */ - public GatewaysClient getGateways() { - return this.gateways; + public SharedKeysOperationsClient getSharedKeysOperations() { + return this.sharedKeysOperations; } /** - * The SchemasClient object to access its operations. + * The StorageInsightConfigsClient object to access its operations. */ - private final SchemasClient schemas; + private final StorageInsightConfigsClient storageInsightConfigs; /** - * Gets the SchemasClient object to access its operations. + * Gets the StorageInsightConfigsClient object to access its operations. * - * @return the SchemasClient object. + * @return the StorageInsightConfigsClient object. */ - public SchemasClient getSchemas() { - return this.schemas; + public StorageInsightConfigsClient getStorageInsightConfigs() { + return this.storageInsightConfigs; } /** - * The WorkspacePurgesClient object to access its operations. + * The TablesClient object to access its operations. */ - private final WorkspacePurgesClient workspacePurges; + private final TablesClient tables; /** - * Gets the WorkspacePurgesClient object to access its operations. + * Gets the TablesClient object to access its operations. * - * @return the WorkspacePurgesClient object. + * @return the TablesClient object. */ - public WorkspacePurgesClient getWorkspacePurges() { - return this.workspacePurges; + public TablesClient getTables() { + return this.tables; } /** - * The ClustersClient object to access its operations. + * The UsagesClient object to access its operations. */ - private final ClustersClient clusters; + private final UsagesClient usages; /** - * Gets the ClustersClient object to access its operations. + * Gets the UsagesClient object to access its operations. * - * @return the ClustersClient object. + * @return the UsagesClient object. */ - public ClustersClient getClusters() { - return this.clusters; + public UsagesClient getUsages() { + return this.usages; } /** - * The OperationsClient object to access its operations. + * The WorkspacePurgesClient object to access its operations. */ - private final OperationsClient operations; + private final WorkspacePurgesClient workspacePurges; /** - * Gets the OperationsClient object to access its operations. + * Gets the WorkspacePurgesClient object to access its operations. * - * @return the OperationsClient object. + * @return the WorkspacePurgesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public WorkspacePurgesClient getWorkspacePurges() { + return this.workspacePurges; } /** @@ -424,20 +452,6 @@ public DeletedWorkspacesClient getDeletedWorkspaces() { return this.deletedWorkspaces; } - /** - * The TablesClient object to access its operations. - */ - private final TablesClient tables; - - /** - * Gets the TablesClient object to access its operations. - * - * @return the TablesClient object. - */ - public TablesClient getTables() { - return this.tables; - } - /** * Initializes an instance of OperationalInsightsManagementClient client. * @@ -455,28 +469,29 @@ public TablesClient getTables() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.queryPacks = new QueryPacksClientImpl(this); - this.queries = new QueriesClientImpl(this); + this.apiVersion = "2025-02-01"; + this.availableServiceTiers = new AvailableServiceTiersClientImpl(this); + this.clusters = new ClustersClientImpl(this); this.dataExports = new DataExportsClientImpl(this); this.dataSources = new DataSourcesClientImpl(this); + this.gateways = new GatewaysClientImpl(this); this.intelligencePacks = new IntelligencePacksClientImpl(this); this.linkedServices = new LinkedServicesClientImpl(this); this.linkedStorageAccounts = new LinkedStorageAccountsClientImpl(this); this.managementGroups = new ManagementGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); this.operationStatuses = new OperationStatusesClientImpl(this); - this.sharedKeysOperations = new SharedKeysOperationsClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.storageInsightConfigs = new StorageInsightConfigsClientImpl(this); + this.queries = new QueriesClientImpl(this); + this.queryPacks = new QueryPacksClientImpl(this); this.savedSearches = new SavedSearchesClientImpl(this); - this.availableServiceTiers = new AvailableServiceTiersClientImpl(this); - this.gateways = new GatewaysClientImpl(this); this.schemas = new SchemasClientImpl(this); + this.sharedKeysOperations = new SharedKeysOperationsClientImpl(this); + this.storageInsightConfigs = new StorageInsightConfigsClientImpl(this); + this.tables = new TablesClientImpl(this); + this.usages = new UsagesClientImpl(this); this.workspacePurges = new WorkspacePurgesClientImpl(this); - this.clusters = new ClustersClientImpl(this); - this.operations = new OperationsClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); this.deletedWorkspaces = new DeletedWorkspacesClientImpl(this); - this.tables = new TablesClientImpl(this); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java index 77996dac2fc7..b02f76fe3117 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java @@ -91,9 +91,10 @@ private Mono> listSinglePageAsync() { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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())); @@ -115,10 +116,9 @@ private Mono> listSinglePageAsync(Context context) return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java index 8925e741cf34..dcce0827e2e1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java @@ -182,11 +182,11 @@ private Mono> listSinglePageAsync if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, apiVersion, top, includeBody, skipToken, accept, context)) + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, 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())); @@ -226,12 +226,11 @@ private Mono> listSinglePageAsync if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - apiVersion, top, includeBody, skipToken, accept, context) + this.client.getApiVersion(), top, includeBody, skipToken, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -381,12 +380,11 @@ private Mono> searchSinglePageAsy } else { querySearchProperties.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.search(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, apiVersion, top, includeBody, skipToken, querySearchProperties, accept, context)) + .withContext(context -> service.search(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, + querySearchProperties, 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())); @@ -434,12 +432,11 @@ private Mono> searchSinglePageAsy } else { querySearchProperties.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .search(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - apiVersion, top, includeBody, skipToken, querySearchProperties, accept, context) + this.client.getApiVersion(), top, includeBody, skipToken, querySearchProperties, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -595,11 +592,10 @@ private Mono> getWithResponseAsync(Str if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -637,11 +633,10 @@ private Mono> getWithResponseAsync(Str if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - id, apiVersion, accept, context); + id, this.client.getApiVersion(), accept, context); } /** @@ -736,11 +731,10 @@ private Mono> putWithResponseAsync(Str } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, queryPayload, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -785,11 +779,10 @@ private Mono> putWithResponseAsync(Str } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - id, apiVersion, queryPayload, accept, context); + id, this.client.getApiVersion(), queryPayload, accept, context); } /** @@ -891,11 +884,10 @@ private Mono> updateWithResponseAsync( } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, queryPayload, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -940,11 +932,10 @@ private Mono> updateWithResponseAsync( } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, id, apiVersion, queryPayload, accept, context); + queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context); } /** @@ -1037,11 +1028,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1078,11 +1068,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, id, apiVersion, accept, context); + queryPackName, id, this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java index eb13f9fc4f9b..b77c18a204f9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java @@ -166,11 +166,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); @@ -196,10 +195,11 @@ private Mono> listSinglePageAsync(Cont return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -286,11 +286,10 @@ public PagedIterable list(Context context) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -322,11 +321,10 @@ private Mono> listByResourceGroupSingl return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -428,11 +426,11 @@ private Mono> createOrUpdateWithoutNameWith } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdateWithoutName(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -471,11 +469,11 @@ private Mono> createOrUpdateWithoutNameWith } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateWithoutName(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, context); + return service.createOrUpdateWithoutName(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, + context); } /** @@ -563,11 +561,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -600,11 +597,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), - queryPackName, accept, context); + return service.delete(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, accept, context); } /** @@ -681,11 +677,10 @@ private Mono> getByResourceGroupWithRespons if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -719,10 +714,9 @@ private Mono> getByResourceGroupWithRespons if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, accept, context); } @@ -812,11 +806,11 @@ private Mono> createOrUpdateWithResponseAsy } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, + logAnalyticsQueryPackPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -859,10 +853,9 @@ private Mono> createOrUpdateWithResponseAsy } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context); } @@ -962,11 +955,11 @@ private Mono> updateTagsWithResponseAsync(S } else { queryPackTags.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context)) + .withContext( + context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1006,10 +999,9 @@ private Mono> updateTagsWithResponseAsync(S } else { queryPackTags.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateTags(this.client.getEndpoint(), resourceGroupName, apiVersion, + return service.updateTags(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java index 1a5a158e3364..1f63fedf2880 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java @@ -134,10 +134,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -174,10 +173,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, savedSearchId, apiVersion, context); + workspaceName, savedSearchId, this.client.getApiVersion(), context); } /** @@ -269,11 +267,11 @@ private Mono> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, parameters, accept, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -317,11 +315,10 @@ private Mono> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, savedSearchId, apiVersion, parameters, accept, context); + workspaceName, savedSearchId, this.client.getApiVersion(), parameters, accept, context); } /** @@ -415,11 +412,10 @@ private Mono> getWithResponseAsync(String resourceGro if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, accept, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -457,11 +453,10 @@ private Mono> getWithResponseAsync(String resourceGro if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - savedSearchId, apiVersion, accept, context); + savedSearchId, this.client.getApiVersion(), accept, context); } /** @@ -544,11 +539,10 @@ private Mono> listByWorkspaceWithResponse return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -582,11 +576,10 @@ private Mono> listByWorkspaceWithResponse return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java index e6aa53b15388..a02e48db8a04 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java @@ -94,11 +94,10 @@ private Mono> getWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -131,10 +130,9 @@ private Mono> getWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java index 2eb885fccb49..8c8de2f6a382 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java @@ -104,11 +104,10 @@ private Mono> getSharedKeysWithResponseAsync(String re return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getSharedKeys(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -141,11 +140,10 @@ private Mono> getSharedKeysWithResponseAsync(String re return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getSharedKeys(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.getSharedKeys(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -225,11 +223,10 @@ private Mono> regenerateWithResponseAsync(String resou if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.regenerate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -263,11 +260,10 @@ private Mono> regenerateWithResponseAsync(String resou if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.regenerate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context); + workspaceName, this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java index 4eb222cb9623..79875f4ff957 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java @@ -152,11 +152,11 @@ private Mono> createOrUpdateWithResponseAsync(Stri } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -201,11 +201,10 @@ private Mono> createOrUpdateWithResponseAsync(Stri } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context); + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -299,11 +298,10 @@ private Mono> getWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), accept, context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -341,11 +339,10 @@ private Mono> getWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -433,10 +430,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -474,10 +470,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, - apiVersion, this.client.getSubscriptionId(), context); + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -559,11 +554,10 @@ private Mono> listByWorkspaceSinglePageAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().odataNextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -599,11 +593,10 @@ private Mono> listByWorkspaceSinglePageAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().odataNextLink(), null)); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java index 7f0a3bcb785a..743c54e03a5c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; import com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; @@ -12,7 +13,6 @@ import com.azure.resourcemanager.loganalytics.models.ResultStatistics; import com.azure.resourcemanager.loganalytics.models.Schema; import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.Table; import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; @@ -33,7 +33,7 @@ public String type() { return this.innerModel().type(); } - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java index 1762c5ef174c..261d808b4c1e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java @@ -172,11 +172,10 @@ private Mono> listByWorkspaceSinglePageAsync(String re if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), 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())); @@ -212,12 +211,11 @@ private Mono> listByWorkspaceSinglePageAsync(String re if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context) + workspaceName, this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } @@ -325,11 +323,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, parameters, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -372,11 +369,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, parameters, accept, context); + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context); } /** @@ -575,11 +571,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, parameters, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -622,11 +617,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, parameters, accept, context); + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context); } /** @@ -817,11 +811,10 @@ private Mono> getWithResponseAsync(String resourceGroupName if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -858,11 +851,10 @@ private Mono> getWithResponseAsync(String resourceGroupName if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - apiVersion, tableName, accept, context); + this.client.getApiVersion(), tableName, accept, context); } /** @@ -948,11 +940,10 @@ private Mono>> deleteWithResponseAsync(String resource if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -989,11 +980,10 @@ private Mono>> deleteWithResponseAsync(String resource if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1171,11 +1161,10 @@ private Mono> migrateWithResponseAsync(String resourceGroupName, if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.migrate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1213,11 +1202,10 @@ private Mono> migrateWithResponseAsync(String resourceGroupName, if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.migrate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1304,11 +1292,10 @@ private Mono> cancelSearchWithResponseAsync(String resourceGroupN if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.cancelSearch(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1345,11 +1332,10 @@ private Mono> cancelSearchWithResponseAsync(String resourceGroupN if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.cancelSearch(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java index 82068fd4360d..eec73bf5ebd6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java @@ -99,11 +99,10 @@ private Mono> listSinglePageAsync(String resourc return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -139,11 +138,10 @@ private Mono> listSinglePageAsync(String resourc return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + .list(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java index b2ea3cb7253e..53ac12f88eda 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.Workspace; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -55,7 +58,7 @@ public Identity identity() { return this.innerModel().identity(); } - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.innerModel().systemData(); } @@ -83,11 +86,11 @@ public WorkspaceCapping workspaceCapping() { return this.innerModel().workspaceCapping(); } - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerModel().createdDate(); } - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerModel().modifiedDate(); } @@ -120,6 +123,14 @@ public String defaultDataCollectionRuleResourceId() { return this.innerModel().defaultDataCollectionRuleResourceId(); } + public WorkspaceReplicationProperties replication() { + return this.innerModel().replication(); + } + + public WorkspaceFailoverProperties failover() { + return this.innerModel().failover(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -331,6 +342,26 @@ public WorkspaceImpl withDefaultDataCollectionRuleResourceId(String defaultDataC } } + public WorkspaceImpl withReplication(WorkspaceReplicationProperties replication) { + if (isInCreateMode()) { + this.innerModel().withReplication(replication); + return this; + } else { + this.updateParameters.withReplication(replication); + return this; + } + } + + public WorkspaceImpl withFailover(WorkspaceFailoverProperties failover) { + if (isInCreateMode()) { + this.innerModel().withFailover(failover); + return this; + } else { + this.updateParameters.withFailover(failover); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java index 9f03aae1ad81..fdd0763e24f0 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java @@ -124,11 +124,10 @@ private Mono purgeWithResponseAsync(String resourc } else { body.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.purge(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, body, accept, context)) + .withContext(context -> service.purge(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -175,11 +174,10 @@ private Mono purgeWithResponseAsync(String resourc } else { body.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.purge(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), - workspaceName, body, accept, context); + return service.purge(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), workspaceName, body, accept, context); } /** @@ -291,11 +289,10 @@ private Mono> getPurgeStatusWithResp if (purgeId == null) { return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, purgeId, accept, context)) + .withContext(context -> service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, purgeId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -333,10 +330,9 @@ private Mono> getPurgeStatusWithResp if (purgeId == null) { return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, apiVersion, + return service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, purgeId, accept, context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java index 271666c99ac4..42ed84e16d2d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -125,6 +126,25 @@ Mono> update(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") WorkspacePatch parameters, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/locations/{location}/workspaces/{workspaceName}/failover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failover(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/failback") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failback(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** @@ -145,11 +165,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); @@ -175,10 +194,11 @@ private Mono> listSinglePageAsync(Context context) return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } @@ -258,11 +278,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); @@ -293,11 +312,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); @@ -396,11 +414,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -440,11 +457,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -627,11 +643,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), force, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -668,10 +683,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, context); } @@ -905,11 +919,10 @@ private Mono> getByResourceGroupWithResponseAsync(Strin return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - workspaceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -942,11 +955,10 @@ private Mono> getByResourceGroupWithResponseAsync(Strin return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -1032,11 +1044,10 @@ private Mono> updateWithResponseAsync(String resourceGr } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1076,10 +1087,9 @@ private Mono> updateWithResponseAsync(String resourceGr } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, + return service.update(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } @@ -1134,4 +1144,494 @@ public Response updateWithResponse(String resourceGroupName, Str public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { return updateWithResponse(resourceGroupName, workspaceName, parameters, Context.NONE).getValue(); } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync(String resourceGroupName, String location, + String workspaceName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, workspaceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync(String resourceGroupName, String location, + String workspaceName, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.failover(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, location, + workspaceName, this.client.getApiVersion(), accept, context); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String location, + String workspaceName) { + Mono>> mono = failoverWithResponseAsync(resourceGroupName, location, workspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String location, + String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = failoverWithResponseAsync(resourceGroupName, location, workspaceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover(String resourceGroupName, String location, + String workspaceName) { + return this.beginFailoverAsync(resourceGroupName, location, workspaceName).getSyncPoller(); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover(String resourceGroupName, String location, + String workspaceName, Context context) { + return this.beginFailoverAsync(resourceGroupName, location, workspaceName, context).getSyncPoller(); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String location, String workspaceName) { + return beginFailoverAsync(resourceGroupName, location, workspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String location, String workspaceName, Context context) { + return beginFailoverAsync(resourceGroupName, location, workspaceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName) { + failoverAsync(resourceGroupName, location, workspaceName).block(); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failover(String resourceGroupName, String location, String workspaceName, Context context) { + failoverAsync(resourceGroupName, location, workspaceName, context).block(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failbackWithResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failback(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failbackWithResponseAsync(String resourceGroupName, String workspaceName, + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.failback(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailbackAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = failbackWithResponseAsync(resourceGroupName, workspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailbackAsync(String resourceGroupName, String workspaceName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = failbackWithResponseAsync(resourceGroupName, workspaceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName) { + return this.beginFailbackAsync(resourceGroupName, workspaceName).getSyncPoller(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName, + Context context) { + return this.beginFailbackAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failbackAsync(String resourceGroupName, String workspaceName) { + return beginFailbackAsync(resourceGroupName, workspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failbackAsync(String resourceGroupName, String workspaceName, Context context) { + return beginFailbackAsync(resourceGroupName, workspaceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName) { + failbackAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failback(String resourceGroupName, String workspaceName, Context context) { + failbackAsync(resourceGroupName, workspaceName, context).block(); + } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java index 4a7afc2cce12..1b2501f12a6d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java @@ -76,6 +76,22 @@ public Workspace getByResourceGroup(String resourceGroupName, String workspaceNa } } + public void failover(String resourceGroupName, String location, String workspaceName) { + this.serviceClient().failover(resourceGroupName, location, workspaceName); + } + + public void failover(String resourceGroupName, String location, String workspaceName, Context context) { + this.serviceClient().failover(resourceGroupName, location, workspaceName, context); + } + + public void failback(String resourceGroupName, String workspaceName) { + this.serviceClient().failback(resourceGroupName, workspaceName); + } + + public void failback(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().failback(resourceGroupName, workspaceName, context); + } + public Workspace getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java index 5c61dfa853b2..7d47aa8f7013 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.UUID; /** * The list of Log Analytics workspaces associated with the cluster. @@ -19,7 +22,7 @@ public final class AssociatedWorkspace implements JsonSerializable UUID.fromString(nonNullReader.getString())); } else if ("workspaceName".equals(fieldName)) { deserializedAssociatedWorkspace.workspaceName = reader.getString(); } else if ("resourceId".equals(fieldName)) { deserializedAssociatedWorkspace.resourceId = reader.getString(); } else if ("associateDate".equals(fieldName)) { - deserializedAssociatedWorkspace.associateDate = reader.getString(); + deserializedAssociatedWorkspace.associateDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java deleted file mode 100644 index bc42393369e7..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java +++ /dev/null @@ -1,174 +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.loganalytics.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * An Azure resource QueryPack-Query object. - */ -@Immutable -public class AzureResourceProperties implements JsonSerializable { - /* - * Azure resource Id - */ - private String id; - - /* - * Azure resource name - */ - private String name; - - /* - * Azure resource type - */ - private String type; - - /* - * Read only system data - */ - private SystemData systemData; - - /** - * Creates an instance of AzureResourceProperties class. - */ - public AzureResourceProperties() { - } - - /** - * 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 AzureResourceProperties object itself. - */ - AzureResourceProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Azure resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Azure resource name. - * - * @param name the name value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Azure resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Azure resource type. - * - * @param type the type value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the systemData property: Read only system data. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Read only system data. - * - * @param systemData the systemData value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureResourceProperties. - */ - public static AzureResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceProperties deserializedAzureResourceProperties = new AzureResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureResourceProperties.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureResourceProperties.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureResourceProperties.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureResourceProperties.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceProperties; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java index ceb411fc31f0..dafe37492d27 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java @@ -46,7 +46,22 @@ public enum CapacityReservationLevel { /** * Enum value 5000. */ - FIVE_ZERO_ZERO_ZERO(5000); + FIVE_ZERO_ZERO_ZERO(5000), + + /** + * Enum value 10000. + */ + ONE_ZERO_ZERO_ZERO_ZERO(10000), + + /** + * Enum value 25000. + */ + TWO_FIVE_ZERO_ZERO_ZERO(25000), + + /** + * Enum value 50000. + */ + FIVE_ZERO_ZERO_ZERO_ZERO(50000); /** * The actual serialized value for a CapacityReservationLevel instance. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java index 6d8bff2edc0b..8d05f51f98c5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java @@ -5,11 +5,13 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; /** * The Capacity Reservation properties. @@ -19,7 +21,7 @@ public final class CapacityReservationProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("minCapacity".equals(fieldName)) { deserializedCapacityReservationProperties.minCapacity = reader.getNullable(JsonReader::getLong); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java index acc232dd92e1..23e603e4b092 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java @@ -7,6 +7,7 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.ClusterInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -113,14 +114,14 @@ public interface Cluster { * * @return the lastModifiedDate value. */ - String lastModifiedDate(); + OffsetDateTime lastModifiedDate(); /** * Gets the createdDate property: The cluster creation time. * * @return the createdDate value. */ - String createdDate(); + OffsetDateTime createdDate(); /** * Gets the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. @@ -136,6 +137,13 @@ public interface Cluster { */ CapacityReservationProperties capacityReservationProperties(); + /** + * Gets the replication property: Cluster's replication properties. + * + * @return the replication value. + */ + ClusterReplicationProperties replication(); + /** * Gets the region of the resource. * @@ -222,7 +230,7 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithIsDoubleEncryptionEnabled, DefinitionStages.WithIsAvailabilityZonesEnabled, DefinitionStages.WithBillingType, DefinitionStages.WithKeyVaultProperties, - DefinitionStages.WithAssociatedWorkspaces, DefinitionStages.WithCapacityReservationProperties { + DefinitionStages.WithCapacityReservationProperties, DefinitionStages.WithReplication { /** * Executes the create request. * @@ -338,30 +346,29 @@ interface WithKeyVaultProperties { } /** - * The stage of the Cluster definition allowing to specify associatedWorkspaces. + * The stage of the Cluster definition allowing to specify capacityReservationProperties. */ - interface WithAssociatedWorkspaces { + interface WithCapacityReservationProperties { /** - * Specifies the associatedWorkspaces property: The list of Log Analytics workspaces associated with the - * cluster. + * Specifies the capacityReservationProperties property: Additional properties for capacity reservation. * - * @param associatedWorkspaces The list of Log Analytics workspaces associated with the cluster. + * @param capacityReservationProperties Additional properties for capacity reservation. * @return the next definition stage. */ - WithCreate withAssociatedWorkspaces(List associatedWorkspaces); + WithCreate withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties); } /** - * The stage of the Cluster definition allowing to specify capacityReservationProperties. + * The stage of the Cluster definition allowing to specify replication. */ - interface WithCapacityReservationProperties { + interface WithReplication { /** - * Specifies the capacityReservationProperties property: Additional properties for capacity reservation. + * Specifies the replication property: Cluster's replication properties.. * - * @param capacityReservationProperties Additional properties for capacity reservation. + * @param replication Cluster's replication properties. * @return the next definition stage. */ - WithCreate withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties); + WithCreate withReplication(ClusterReplicationProperties replication); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java new file mode 100644 index 000000000000..af1e66a31e6f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Cluster replication properties. + */ +@Fluent +public final class ClusterReplicationProperties implements JsonSerializable { + /* + * The secondary location of the replication. If replication is being enabled, enabled must be provided. + */ + private String location; + + /* + * Specifies whether the replication is enabled or not. When true the cluster is replicate to the specified + * location. + */ + private Boolean enabled; + + /* + * Should enable AvailabilityZones for the given replicated cluster + */ + private Boolean isAvailabilityZonesEnabled; + + /* + * The provisioning state of the cluster replication. + */ + private ClusterReplicationState provisioningState; + + /* + * The cluster's replication creation time + */ + private OffsetDateTime createdDate; + + /* + * The last time the cluster's replication was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of ClusterReplicationProperties class. + */ + public ClusterReplicationProperties() { + } + + /** + * Get the location property: The secondary location of the replication. If replication is being enabled, enabled + * must be provided. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The secondary location of the replication. If replication is being enabled, enabled + * must be provided. + * + * @param location the location value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the enabled property: Specifies whether the replication is enabled or not. When true the cluster is replicate + * to the specified location. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the replication is enabled or not. When true the cluster is replicate + * to the specified location. + * + * @param enabled the enabled value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the isAvailabilityZonesEnabled property: Should enable AvailabilityZones for the given replicated cluster. + * + * @return the isAvailabilityZonesEnabled value. + */ + public Boolean isAvailabilityZonesEnabled() { + return this.isAvailabilityZonesEnabled; + } + + /** + * Set the isAvailabilityZonesEnabled property: Should enable AvailabilityZones for the given replicated cluster. + * + * @param isAvailabilityZonesEnabled the isAvailabilityZonesEnabled value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + this.isAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster replication. + * + * @return the provisioningState value. + */ + public ClusterReplicationState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdDate property: The cluster's replication creation time. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the lastModifiedDate property: The last time the cluster's replication was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeBooleanField("isAvailabilityZonesEnabled", this.isAvailabilityZonesEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterReplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterReplicationProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterReplicationProperties. + */ + public static ClusterReplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterReplicationProperties deserializedClusterReplicationProperties = new ClusterReplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedClusterReplicationProperties.location = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedClusterReplicationProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("isAvailabilityZonesEnabled".equals(fieldName)) { + deserializedClusterReplicationProperties.isAvailabilityZonesEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterReplicationProperties.provisioningState + = ClusterReplicationState.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + deserializedClusterReplicationProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedClusterReplicationProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterReplicationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java new file mode 100644 index 000000000000..0e275a7398cc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the cluster replication. + */ +public final class ClusterReplicationState extends ExpandableStringEnum { + /** + * Static value Succeeded for ClusterReplicationState. + */ + public static final ClusterReplicationState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value EnableRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState ENABLE_REQUESTED = fromString("EnableRequested"); + + /** + * Static value Enabling for ClusterReplicationState. + */ + public static final ClusterReplicationState ENABLING = fromString("Enabling"); + + /** + * Static value DisableRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState DISABLE_REQUESTED = fromString("DisableRequested"); + + /** + * Static value Disabling for ClusterReplicationState. + */ + public static final ClusterReplicationState DISABLING = fromString("Disabling"); + + /** + * Static value RollbackRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState ROLLBACK_REQUESTED = fromString("RollbackRequested"); + + /** + * Static value RollingBack for ClusterReplicationState. + */ + public static final ClusterReplicationState ROLLING_BACK = fromString("RollingBack"); + + /** + * Static value Failed for ClusterReplicationState. + */ + public static final ClusterReplicationState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ClusterReplicationState. + */ + public static final ClusterReplicationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ClusterReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterReplicationState() { + } + + /** + * Creates or finds a ClusterReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterReplicationState. + */ + public static ClusterReplicationState fromString(String name) { + return fromString(name, ClusterReplicationState.class); + } + + /** + * Gets known ClusterReplicationState values. + * + * @return known ClusterReplicationState values. + */ + public static Collection values() { + return values(ClusterReplicationState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java deleted file mode 100644 index 3097d8e5c784..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java +++ /dev/null @@ -1,61 +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.loganalytics.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of identity that created the resource. - */ -public final class CreatedByType extends ExpandableStringEnum { - /** - * Static value User for CreatedByType. - */ - public static final CreatedByType USER = fromString("User"); - - /** - * Static value Application for CreatedByType. - */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** - * Static value ManagedIdentity for CreatedByType. - */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** - * Static value Key for CreatedByType. - */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates a new instance of CreatedByType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CreatedByType() { - } - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** - * Gets known CreatedByType values. - * - * @return known CreatedByType values. - */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java index c9267e6a3315..b1e162d20f3d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java @@ -4,73 +4,58 @@ package com.azure.resourcemanager.loganalytics.models; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - /** - * The type of identity that creates/modifies resources. + * Type of managed service identity. */ -public final class IdentityType extends ExpandableStringEnum { - /** - * Static value user for IdentityType. - */ - public static final IdentityType USER = fromString("user"); - +public enum IdentityType { /** - * Static value application for IdentityType. + * Enum value SystemAssigned. */ - public static final IdentityType APPLICATION = fromString("application"); + SYSTEM_ASSIGNED("SystemAssigned"), /** - * Static value managedIdentity for IdentityType. + * Enum value UserAssigned. */ - public static final IdentityType MANAGED_IDENTITY = fromString("managedIdentity"); + USER_ASSIGNED("UserAssigned"), /** - * Static value key for IdentityType. + * Enum value None. */ - public static final IdentityType KEY = fromString("key"); + NONE("None"); /** - * Static value SystemAssigned for IdentityType. + * The actual serialized value for a IdentityType instance. */ - public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + private final String value; - /** - * Static value UserAssigned for IdentityType. - */ - public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); - - /** - * Static value None for IdentityType. - */ - public static final IdentityType NONE = fromString("None"); - - /** - * Creates a new instance of IdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IdentityType() { + IdentityType(String value) { + this.value = value; } /** - * Creates or finds a IdentityType from its string representation. + * Parses a serialized value to a IdentityType instance. * - * @param name a name to look for. - * @return the corresponding IdentityType. - */ - public static IdentityType fromString(String name) { - return fromString(name, IdentityType.class); + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + public static IdentityType fromString(String value) { + if (value == null) { + return null; + } + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } /** - * Gets known IdentityType values. - * - * @return known IdentityType values. + * {@inheritDoc} */ - public static Collection values() { - return values(IdentityType.class); + @Override + public String toString() { + return this.value; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java index 25d15670f112..03d115294b06 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import java.time.OffsetDateTime; @@ -49,6 +50,13 @@ public interface LogAnalyticsQueryPack { */ Map tags(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the queryPackId property: The unique ID of your application. This field cannot be changed. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java index 58d3966e6302..c04f014bf2e5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java @@ -16,28 +16,28 @@ */ public interface LogAnalyticsQueryPackQuery { /** - * Gets the id property: Azure resource Id. + * Gets the id property: Fully qualified resource Id for the resource. * * @return the id value. */ String id(); /** - * Gets the name property: Azure resource name. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** - * Gets the type property: Azure resource type. + * Gets the type property: The type of the resource. * * @return the type value. */ String type(); /** - * Gets the systemData property: Read only system data. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/QueryPacksResource.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/QueryPacksResource.java deleted file mode 100644 index 7ffdb8e39a6f..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/QueryPacksResource.java +++ /dev/null @@ -1,143 +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.loganalytics.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * An azure resource object. - */ -@Fluent -public class QueryPacksResource extends Resource { - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of QueryPacksResource class. - */ - public QueryPacksResource() { - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public QueryPacksResource withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public QueryPacksResource withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QueryPacksResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QueryPacksResource if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the QueryPacksResource. - */ - public static QueryPacksResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QueryPacksResource deserializedQueryPacksResource = new QueryPacksResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedQueryPacksResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQueryPacksResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQueryPacksResource.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedQueryPacksResource.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedQueryPacksResource.withTags(tags); - } else { - reader.skipChildren(); - } - } - - return deserializedQueryPacksResource; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java deleted file mode 100644 index 6e27ad4d2842..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java +++ /dev/null @@ -1,242 +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.loganalytics.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Metadata pertaining to creation and last modification of the resource. - */ -@Fluent -public final class SystemDataAutoGenerated implements JsonSerializable { - /* - * The identity that created the resource. - */ - private String createdBy; - - /* - * The type of identity that created the resource. - */ - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). - */ - private OffsetDateTime createdAt; - - /* - * The identity that last modified the resource. - */ - private String lastModifiedBy; - - /* - * The type of identity that last modified the resource. - */ - private CreatedByType lastModifiedByType; - - /* - * The timestamp of resource last modification (UTC) - */ - private OffsetDateTime lastModifiedAt; - - /** - * Creates an instance of SystemDataAutoGenerated class. - */ - public SystemDataAutoGenerated() { - } - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Get the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - public CreatedByType createdByType() { - return this.createdByType; - } - - /** - * Set the createdByType property: The type of identity that created the resource. - * - * @param createdByType the createdByType value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; - return this; - } - - /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). - * - * @param createdAt the createdAt value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: The identity that last modified the resource. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - public CreatedByType lastModifiedByType() { - return this.lastModifiedByType; - } - - /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. - * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedByType(CreatedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; - } - - /** - * Get the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("createdBy", this.createdBy); - jsonWriter.writeStringField("createdByType", this.createdByType == null ? null : this.createdByType.toString()); - jsonWriter.writeStringField("createdAt", - this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); - jsonWriter.writeStringField("lastModifiedBy", this.lastModifiedBy); - jsonWriter.writeStringField("lastModifiedByType", - this.lastModifiedByType == null ? null : this.lastModifiedByType.toString()); - jsonWriter.writeStringField("lastModifiedAt", - this.lastModifiedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedAt)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SystemDataAutoGenerated from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SystemDataAutoGenerated if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the SystemDataAutoGenerated. - */ - public static SystemDataAutoGenerated fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SystemDataAutoGenerated deserializedSystemDataAutoGenerated = new SystemDataAutoGenerated(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("createdBy".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdBy = reader.getString(); - } else if ("createdByType".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdByType = CreatedByType.fromString(reader.getString()); - } else if ("createdAt".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastModifiedBy".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedBy = reader.getString(); - } else if ("lastModifiedByType".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedByType - = CreatedByType.fromString(reader.getString()); - } else if ("lastModifiedAt".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedSystemDataAutoGenerated; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java index a132b06efdf1..9c0812dd1d84 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; @@ -38,7 +39,7 @@ public interface Table { * * @return the systemData value. */ - SystemDataAutoGenerated systemData(); + SystemData systemData(); /** * Gets the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java index 1565231d5312..9d7cd91cc51a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java @@ -5,8 +5,10 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -61,7 +63,7 @@ public interface Workspace { * * @return the systemData value. */ - SystemDataAutoGenerated systemData(); + SystemData systemData(); /** * Gets the etag property: The etag of the workspace. @@ -111,14 +113,14 @@ public interface Workspace { * * @return the createdDate value. */ - String createdDate(); + OffsetDateTime createdDate(); /** * Gets the modifiedDate property: Workspace modification date. * * @return the modifiedDate value. */ - String modifiedDate(); + OffsetDateTime modifiedDate(); /** * Gets the publicNetworkAccessForIngestion property: The network access type for accessing Log Analytics ingestion. @@ -164,6 +166,20 @@ public interface Workspace { */ String defaultDataCollectionRuleResourceId(); + /** + * Gets the replication property: workspace replication properties. + * + * @return the replication value. + */ + WorkspaceReplicationProperties replication(); + + /** + * Gets the failover property: workspace failover properties. + * + * @return the failover value. + */ + WorkspaceFailoverProperties failover(); + /** * Gets the region of the resource. * @@ -251,7 +267,8 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde DefinitionStages.WithEtag, DefinitionStages.WithSku, DefinitionStages.WithRetentionInDays, DefinitionStages.WithWorkspaceCapping, DefinitionStages.WithPublicNetworkAccessForIngestion, DefinitionStages.WithPublicNetworkAccessForQuery, DefinitionStages.WithForceCmkForQuery, - DefinitionStages.WithFeatures, DefinitionStages.WithDefaultDataCollectionRuleResourceId { + DefinitionStages.WithFeatures, DefinitionStages.WithDefaultDataCollectionRuleResourceId, + DefinitionStages.WithReplication, DefinitionStages.WithFailover { /** * Executes the create request. * @@ -419,6 +436,32 @@ interface WithDefaultDataCollectionRuleResourceId { */ WithCreate withDefaultDataCollectionRuleResourceId(String defaultDataCollectionRuleResourceId); } + + /** + * The stage of the Workspace definition allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: workspace replication properties.. + * + * @param replication workspace replication properties. + * @return the next definition stage. + */ + WithCreate withReplication(WorkspaceReplicationProperties replication); + } + + /** + * The stage of the Workspace definition allowing to specify failover. + */ + interface WithFailover { + /** + * Specifies the failover property: workspace failover properties.. + * + * @param failover workspace failover properties. + * @return the next definition stage. + */ + WithCreate withFailover(WorkspaceFailoverProperties failover); + } } /** @@ -435,7 +478,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, Updat UpdateStages.WithRetentionInDays, UpdateStages.WithWorkspaceCapping, UpdateStages.WithPublicNetworkAccessForIngestion, UpdateStages.WithPublicNetworkAccessForQuery, UpdateStages.WithForceCmkForQuery, UpdateStages.WithFeatures, - UpdateStages.WithDefaultDataCollectionRuleResourceId { + UpdateStages.WithDefaultDataCollectionRuleResourceId, UpdateStages.WithReplication, UpdateStages.WithFailover { /** * Executes the update request. * @@ -594,6 +637,32 @@ interface WithDefaultDataCollectionRuleResourceId { */ Update withDefaultDataCollectionRuleResourceId(String defaultDataCollectionRuleResourceId); } + + /** + * The stage of the Workspace update allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: workspace replication properties.. + * + * @param replication workspace replication properties. + * @return the next definition stage. + */ + Update withReplication(WorkspaceReplicationProperties replication); + } + + /** + * The stage of the Workspace update allowing to specify failover. + */ + interface WithFailover { + /** + * Specifies the failover property: workspace failover properties.. + * + * @param failover workspace failover properties. + * @return the next definition stage. + */ + Update withFailover(WorkspaceFailoverProperties failover); + } } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java new file mode 100644 index 000000000000..2c21e573155e --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The failover state of the replication. + */ +@Immutable +public final class WorkspaceFailoverProperties implements JsonSerializable { + /* + * The failover state of the replication. + */ + private WorkspaceFailoverState state; + + /* + * The last time when the failover state was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of WorkspaceFailoverProperties class. + */ + public WorkspaceFailoverProperties() { + } + + /** + * Get the state property: The failover state of the replication. + * + * @return the state value. + */ + public WorkspaceFailoverState state() { + return this.state; + } + + /** + * Get the lastModifiedDate property: The last time when the failover state was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceFailoverProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceFailoverProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceFailoverProperties. + */ + public static WorkspaceFailoverProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceFailoverProperties deserializedWorkspaceFailoverProperties = new WorkspaceFailoverProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedWorkspaceFailoverProperties.state + = WorkspaceFailoverState.fromString(reader.getString()); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedWorkspaceFailoverProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceFailoverProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java new file mode 100644 index 000000000000..9e737290b651 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.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.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The failover state of the replication. + */ +public final class WorkspaceFailoverState extends ExpandableStringEnum { + /** + * Static value Inactive for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState INACTIVE = fromString("Inactive"); + + /** + * Static value Activating for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState ACTIVATING = fromString("Activating"); + + /** + * Static value Active for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState ACTIVE = fromString("Active"); + + /** + * Static value Deactivating for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState DEACTIVATING = fromString("Deactivating"); + + /** + * Static value Failed for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState FAILED = fromString("Failed"); + + /** + * Creates a new instance of WorkspaceFailoverState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceFailoverState() { + } + + /** + * Creates or finds a WorkspaceFailoverState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceFailoverState. + */ + public static WorkspaceFailoverState fromString(String name) { + return fromString(name, WorkspaceFailoverState.class); + } + + /** + * Gets known WorkspaceFailoverState values. + * + * @return known WorkspaceFailoverState values. + */ + public static Collection values() { + return values(WorkspaceFailoverState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java index a9df6beb1b9b..4f5ccf33e352 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java @@ -43,6 +43,11 @@ public final class WorkspaceFeatures implements JsonSerializable(); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java index a535826fce8c..cc71120c2510 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java @@ -10,6 +10,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceProperties; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -242,7 +243,7 @@ public WorkspacePatch withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -251,7 +252,7 @@ public String createdDate() { * * @return the modifiedDate value. */ - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } @@ -383,6 +384,52 @@ public WorkspacePatch withDefaultDataCollectionRuleResourceId(String defaultData return this; } + /** + * Get the replication property: workspace replication properties. + * + * @return the replication value. + */ + public WorkspaceReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: workspace replication properties. + * + * @param replication the replication value to set. + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withReplication(WorkspaceReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + + /** + * Get the failover property: workspace failover properties. + * + * @return the failover value. + */ + public WorkspaceFailoverProperties failover() { + return this.innerProperties() == null ? null : this.innerProperties().failover(); + } + + /** + * Set the failover property: workspace failover properties. + * + * @param failover the failover value to set. + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withFailover(WorkspaceFailoverProperties failover) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFailover(failover); + return this; + } + /** * Validates the instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java new file mode 100644 index 000000000000..3221198b5a6a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Workspace replication properties. + */ +@Fluent +public final class WorkspaceReplicationProperties implements JsonSerializable { + /* + * The location of the replication. + */ + private String location; + + /* + * Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated to + * the specified location. If replication is been enabled, location must be provided. + */ + private Boolean enabled; + + /* + * The provisioning state of the replication. + */ + private WorkspaceReplicationState provisioningState; + + /* + * The last time when the replication was enabled. + */ + private OffsetDateTime createdDate; + + /* + * The last time when the replication was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of WorkspaceReplicationProperties class. + */ + public WorkspaceReplicationProperties() { + } + + /** + * Get the location property: The location of the replication. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the replication. + * + * @param location the location value to set. + * @return the WorkspaceReplicationProperties object itself. + */ + public WorkspaceReplicationProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the enabled property: Specifies whether the replication is enabled or not. When true, workspace configuration + * and data is replicated to the specified location. If replication is been enabled, location must be provided. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the replication is enabled or not. When true, workspace configuration + * and data is replicated to the specified location. If replication is been enabled, location must be provided. + * + * @param enabled the enabled value to set. + * @return the WorkspaceReplicationProperties object itself. + */ + public WorkspaceReplicationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the replication. + * + * @return the provisioningState value. + */ + public WorkspaceReplicationState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdDate property: The last time when the replication was enabled. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the lastModifiedDate property: The last time when the replication was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceReplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceReplicationProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceReplicationProperties. + */ + public static WorkspaceReplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceReplicationProperties deserializedWorkspaceReplicationProperties + = new WorkspaceReplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.location = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.provisioningState + = WorkspaceReplicationState.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceReplicationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java new file mode 100644 index 000000000000..3012cd8a21ed --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the replication. + */ +public final class WorkspaceReplicationState extends ExpandableStringEnum { + /** + * Static value Succeeded for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value EnableRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ENABLE_REQUESTED = fromString("EnableRequested"); + + /** + * Static value Enabling for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ENABLING = fromString("Enabling"); + + /** + * Static value DisableRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState DISABLE_REQUESTED = fromString("DisableRequested"); + + /** + * Static value Disabling for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState DISABLING = fromString("Disabling"); + + /** + * Static value RollbackRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ROLLBACK_REQUESTED = fromString("RollbackRequested"); + + /** + * Static value RollingBack for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ROLLING_BACK = fromString("RollingBack"); + + /** + * Static value Failed for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState FAILED = fromString("Failed"); + + /** + * Static value Canceled for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of WorkspaceReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceReplicationState() { + } + + /** + * Creates or finds a WorkspaceReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceReplicationState. + */ + public static WorkspaceReplicationState fromString(String name) { + return fromString(name, WorkspaceReplicationState.class); + } + + /** + * Gets known WorkspaceReplicationState values. + * + * @return known WorkspaceReplicationState values. + */ + public static Collection values() { + return values(WorkspaceReplicationState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java index 2d7a1192b4f8..85448ae914ee 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java @@ -5,12 +5,14 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; /** * The SKU (tier) of a workspace. @@ -30,7 +32,7 @@ public final class WorkspaceSku implements JsonSerializable { /* * The last time when the sku was updated. */ - private String lastSkuUpdate; + private OffsetDateTime lastSkuUpdate; /** * Creates an instance of WorkspaceSku class. @@ -85,7 +87,7 @@ public WorkspaceSku withCapacityReservationLevel(CapacityReservationLevel capaci * * @return the lastSkuUpdate value. */ - public String lastSkuUpdate() { + public OffsetDateTime lastSkuUpdate() { return this.lastSkuUpdate; } @@ -137,7 +139,8 @@ public static WorkspaceSku fromJson(JsonReader jsonReader) throws IOException { deserializedWorkspaceSku.capacityReservationLevel = CapacityReservationLevel.fromInt(reader.getInt()); } else if ("lastSkuUpdate".equals(fieldName)) { - deserializedWorkspaceSku.lastSkuUpdate = reader.getString(); + deserializedWorkspaceSku.lastSkuUpdate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java index aded531c69b2..e050d0e19e7b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java @@ -109,6 +109,68 @@ public interface Workspaces { */ Workspace getByResourceGroup(String resourceGroupName, String workspaceName); + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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. + */ + void failover(String resourceGroupName, String location, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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. + */ + void failback(String resourceGroupName, String workspaceName, Context context); + /** * Gets a workspace instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java index 6027c2a37478..73ac90bf12d5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class AvailableServiceTiersListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesAvailableServiceTiers.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java index cdf8a9d5ec19..c94826308743 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java @@ -16,7 +16,7 @@ public final class ClustersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * ClustersCreate.json */ /** @@ -27,7 +27,7 @@ public final class ClustersCreateOrUpdateSamples { public static void clustersCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { manager.clusters() .define("oiautorest6685") - .withRegion("australiasoutheast") + .withRegion("eastus") .withExistingResourceGroup("oiautorest6685") .withTags(mapOf("tag1", "val1")) .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java index 7e221b1ec4d4..e64869a64cbc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java @@ -10,7 +10,7 @@ public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * ClustersDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java index b7bb8dade85b..55cc1a80e2dd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * ClustersGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java index 90e2eb2da761..49b8c2d2cf9e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * ClustersListByResourceGroup.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java index 4444ec1d187b..d4930940e196 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java @@ -10,7 +10,7 @@ public final class ClustersListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * ClustersSubscriptionList.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java index 49cc21a3ef7b..ce9faffffcba 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java @@ -21,7 +21,7 @@ public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * ClustersUpdate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java index f7c685d67ebd..c529500aa167 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ public final class DataExportsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataExportCreateOrUpdate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java index 5abe36f0e084..0f5fc257018e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java @@ -10,7 +10,7 @@ public final class DataExportsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataExportDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java index 5a2a5d2d9db2..1e48bfc1bbb4 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java @@ -10,7 +10,7 @@ public final class DataExportsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataExportGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java index 7ab637466708..41889f3c56c3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class DataExportsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataExportListByWorkspace.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java index 25d3636d4c2d..81e32f30c640 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class DataSourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataSourcesCreate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java index a57cb035de24..af5129318acd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java @@ -10,7 +10,7 @@ public final class DataSourcesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataSourcesDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java index ee60fa9ca0f5..95071a0a2eab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java @@ -10,7 +10,7 @@ public final class DataSourcesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataSourcesGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java index 64401d4f00c1..f0e7a16f1475 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class DataSourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * DataSourcesListByWorkspace.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java index f6a8ed6871cf..66ca56c9b8b8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class DeletedWorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesListByResourceGroup.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java index ad2ba98f0b64..77ede27c305f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java @@ -10,7 +10,7 @@ public final class DeletedWorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesSubscriptionList.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java index 28cc492db409..64e851db14e5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java @@ -10,7 +10,7 @@ public final class GatewaysDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesGatewaysDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java index 9eebdb756452..015192980db9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java @@ -10,7 +10,7 @@ public final class IntelligencePacksDisableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesDisableIntelligencePack.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java index 250a7dba63b5..b9bb32cb1791 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java @@ -10,7 +10,7 @@ public final class IntelligencePacksEnableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesEnableIntelligencePack.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java index 9b2a6df40974..a029e1faff60 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java @@ -10,7 +10,7 @@ public final class IntelligencePacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesListIntelligencePacks.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java index 4073959caf7a..e1249158ecfe 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java @@ -10,7 +10,7 @@ public final class LinkedServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedServicesCreate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java index 02d4c9ba5ae8..6cfd75150a46 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java @@ -10,7 +10,7 @@ public final class LinkedServicesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedServicesDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java index f8d21b5a25d1..daf5a8f316e7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java @@ -10,7 +10,7 @@ public final class LinkedServicesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedServicesGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java index 468ce3a9a4ef..16b49c873de2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class LinkedServicesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedServicesListByWorkspace.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java index 5ec9c7aa0f5f..8c3f610b8844 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class LinkedStorageAccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedStorageAccountsCreate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java index 1ce389516f57..f7dda72feca6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java @@ -12,7 +12,7 @@ public final class LinkedStorageAccountsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedStorageAccountsDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java index 9a0d884e4eaf..86b1ac2d39f8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java @@ -12,7 +12,7 @@ public final class LinkedStorageAccountsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedStorageAccountsGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java index e1ae26a204db..2e69d119d7bd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class LinkedStorageAccountsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * LinkedStorageAccountsListByWorkspace.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java index 0cdabc9ffbb7..3b7e4e09272d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java @@ -10,7 +10,7 @@ public final class ManagementGroupsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesListManagementGroups.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java index 853be869b15e..6698a9de57c3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java @@ -10,7 +10,7 @@ public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * OperationStatusesGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java index 374a6f18606b..99cf810a0bca 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * OperationsListByTenant.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java index 387ca164856b..f7bf5314fdfe 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java @@ -10,7 +10,7 @@ public final class QueriesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPackQueriesDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java index 064096ffaa8b..fa2426dfdae8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java @@ -10,7 +10,7 @@ public final class QueriesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPackQueriesGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java index aa03bcd8a840..f99e80a85385 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java @@ -10,7 +10,7 @@ public final class QueriesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPackQueriesList.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java index 0ad9950cf1db..f1326cf528ff 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java @@ -15,7 +15,7 @@ public final class QueriesPutSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPackQueriesPut.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java index 95c9a54af48e..6187530800f6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java @@ -16,7 +16,7 @@ public final class QueriesSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPackQueriesSearch.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java index aa5b79266f20..b5bea9712b64 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java @@ -16,7 +16,7 @@ public final class QueriesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPackQueriesUpdate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java index c12df416effa..b9f891103641 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksCreate.json */ /** @@ -31,7 +31,7 @@ public static void queryPackCreate(com.azure.resourcemanager.loganalytics.LogAna /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksUpdate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java index ea6b29b2488a..5fcab3bd1ecf 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java @@ -14,7 +14,7 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksCreateNoName.json */ /** @@ -30,7 +30,7 @@ public static void queryPackCreateNoName(com.azure.resourcemanager.loganalytics. /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPackUpdateNoName.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java index 71a8666537c5..4dc20ef841fa 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java @@ -10,7 +10,7 @@ public final class QueryPacksDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java index bb2f520554f9..ac4a07fbff73 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class QueryPacksGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java index d6a9196b8adf..0d0318026526 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class QueryPacksListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksListByResourceGroup.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java index cfbfa4347068..a0e419df0e47 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java @@ -10,7 +10,7 @@ public final class QueryPacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksList.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java index 5dd53593eed6..ba79272fe650 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java @@ -14,7 +14,7 @@ public final class QueryPacksUpdateTagsSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * QueryPacksUpdateTagsOnly.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java index d1eb2e1ebce7..210d6a5814e2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class SavedSearchesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesSavedSearchesCreateOrUpdate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java index cb0a0e4c8fd1..d7ad55d9f1d6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java @@ -10,7 +10,7 @@ public final class SavedSearchesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesDeleteSavedSearches.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java index dda1d9c87f7c..f52bcc23dae5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java @@ -10,7 +10,7 @@ public final class SavedSearchesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesSavedSearchesGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java index 7bf9bc3c73fb..d21c0c6d7798 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class SavedSearchesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * SavedSearchesListByWorkspace.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java index 33fa55b4dd20..f462d2f68921 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java @@ -10,7 +10,7 @@ public final class SchemaGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * SavedSearchesGetSchema.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java index 68efb62c6ca4..d9eaddc3e472 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java @@ -10,7 +10,7 @@ public final class SharedKeysOperationGetSharedKeysSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesGetSharedKeys.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java index 1739d55e2a41..3f8dfe131d95 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java @@ -10,7 +10,7 @@ public final class SharedKeysOperationRegenerateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesRegenerateSharedKeys.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java index a36413877d66..32634564ae59 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class StorageInsightConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * StorageInsightsCreateOrUpdate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java index fd6a760cda89..d2e955637146 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java @@ -10,7 +10,7 @@ public final class StorageInsightConfigsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * StorageInsightsDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java index 0f9fcc8b7936..68e337a9d548 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java @@ -10,7 +10,7 @@ public final class StorageInsightConfigsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * StorageInsightsGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java index b7b8e6125f33..c99d95044bd6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class StorageInsightConfigsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * StorageInsightsListByWorkspace.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java index 6afa7f1b9cfe..5ccdb0900da8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java @@ -10,7 +10,7 @@ public final class TablesCancelSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesSearchCancel.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java index 9a6bd6faddec..3470396f2246 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class TablesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesUpsert.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java index b7172bcbfb3e..fe32da02fdc3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java @@ -10,7 +10,7 @@ public final class TablesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java index 05d356b11506..f6bfae9fd13e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java @@ -10,7 +10,7 @@ public final class TablesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java index 15fea02884c7..febeca16cf29 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java @@ -10,7 +10,7 @@ public final class TablesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesList.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java index 8e0515e6611a..1a918e3a070b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java @@ -10,7 +10,7 @@ public final class TablesMigrateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesMigrate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java index ecb767fb0cee..1730a720b476 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java @@ -16,7 +16,7 @@ public final class TablesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * TablesUpsert.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java index 1d4068a6ee85..a35c5fa19ada 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java @@ -10,7 +10,7 @@ public final class UsagesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesListUsages.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java index 69ff88bf84d6..25e8e13b5dcc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java @@ -10,7 +10,7 @@ public final class WorkspacePurgeGetPurgeStatusSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesPurgeOperation.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java index 1dd676c20ecb..8dc84a2c5728 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java @@ -14,7 +14,7 @@ public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesPurgeResourceId.json */ /** @@ -34,7 +34,7 @@ public static void workspacePurgeResourceId(com.azure.resourcemanager.loganalyti /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesPurge.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java index abce117e89b4..bb01b512055a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesCreate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java index dac400c21743..78859526f063 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java @@ -10,7 +10,7 @@ public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesDelete.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java new file mode 100644 index 000000000000..b4bce697534b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.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.loganalytics.generated; + +/** + * Samples for Workspaces Failback. + */ +public final class WorkspacesFailbackSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesFailback.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failback("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java new file mode 100644 index 000000000000..3b91a5f55faa --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.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.loganalytics.generated; + +/** + * Samples for Workspaces Failover. + */ +public final class WorkspacesFailoverSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ + * WorkspacesFailover.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failover("oiautorest6685", "eastus", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java index 845b2fba7be5..bcad3a48411c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesGet.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java index 165d1c4d6af1..3d13ac31a53c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesListByResourceGroup.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java index 535445f0da1b..954fc5e9e1de 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java @@ -10,7 +10,7 @@ public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesSubscriptionList.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java index 9d1fef46d1c6..d9443320ae0d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java @@ -15,7 +15,7 @@ public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ * WorkspacesUpdate.json */ /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java deleted file mode 100644 index 2a0ff4de6028..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.AssociatedWorkspace; - -public final class AssociatedWorkspaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssociatedWorkspace model = BinaryData.fromString( - "{\"workspaceId\":\"pagao\",\"workspaceName\":\"ulpqblylsyxkqjn\",\"resourceId\":\"ervtiagxs\",\"associateDate\":\"zuempsbzkf\"}") - .toObject(AssociatedWorkspace.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssociatedWorkspace model = new AssociatedWorkspace(); - model = BinaryData.fromObject(model).toObject(AssociatedWorkspace.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java deleted file mode 100644 index 13f701c200bb..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.AvailableServiceTierInner; - -public final class AvailableServiceTierInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableServiceTierInner model = BinaryData.fromString( - "{\"serviceTier\":\"Premium\",\"enabled\":true,\"minimumRetention\":2447311563304363726,\"maximumRetention\":2614637191948743156,\"defaultRetention\":5459563894986340273,\"capacityReservationLevel\":7110930774958137161,\"lastSkuUpdate\":\"piexpbtgiw\"}") - .toObject(AvailableServiceTierInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableServiceTierInner model = new AvailableServiceTierInner(); - model = BinaryData.fromObject(model).toObject(AvailableServiceTierInner.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java deleted file mode 100644 index 11fb44320e42..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java +++ /dev/null @@ -1,38 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.AvailableServiceTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.List; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvailableServiceTiersListByWorkspaceWithResponseMockTests { - @Test - public void testListByWorkspaceWithResponse() throws Exception { - String responseStr - = "[{\"serviceTier\":\"CapacityReservation\",\"enabled\":true,\"minimumRetention\":3767644182859901371,\"maximumRetention\":7248546755237746462,\"defaultRetention\":840422895247134750,\"capacityReservationLevel\":8295020029995054755,\"lastSkuUpdate\":\"ujr\"},{\"serviceTier\":\"PerGB2018\",\"enabled\":false,\"minimumRetention\":120736086062160717,\"maximumRetention\":2641992673329436235,\"defaultRetention\":3461505183507942780,\"capacityReservationLevel\":854242813011904996,\"lastSkuUpdate\":\"ikzoeovvtzejetj\"},{\"serviceTier\":\"Free\",\"enabled\":false,\"minimumRetention\":7781117605646169012,\"maximumRetention\":159668866868514414,\"defaultRetention\":7370744360813533838,\"capacityReservationLevel\":700409671675457936,\"lastSkuUpdate\":\"rzvh\"}]"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - List response = manager.availableServiceTiers() - .listByWorkspaceWithResponse("ztlvtmvagbwidqlv", "ukoveofi", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java deleted file mode 100644 index aec477e4178d..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.AzureEntityResource; - -public final class AzureEntityResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureEntityResource model = BinaryData - .fromString("{\"etag\":\"slbi\",\"id\":\"kojgcyzts\",\"name\":\"mznbaeqphch\",\"type\":\"nrnrp\"}") - .toObject(AzureEntityResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureEntityResource model = new AzureEntityResource(); - model = BinaryData.fromObject(model).toObject(AzureEntityResource.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java deleted file mode 100644 index d2daa1af46c4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.AzureResourceProperties; - -public final class AzureResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceProperties model - = BinaryData.fromString("{\"id\":\"sxlzevgbmqj\",\"name\":\"bcypmi\",\"type\":\"w\"}") - .toObject(AzureResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceProperties model = new AzureResourceProperties(); - model = BinaryData.fromObject(model).toObject(AzureResourceProperties.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java deleted file mode 100644 index a404402661f5..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; - -public final class CapacityReservationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapacityReservationProperties model - = BinaryData.fromString("{\"lastSkuUpdate\":\"eyvpnqicvinvkj\",\"minCapacity\":2624293456615314766}") - .toObject(CapacityReservationProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapacityReservationProperties model = new CapacityReservationProperties(); - model = BinaryData.fromObject(model).toObject(CapacityReservationProperties.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java deleted file mode 100644 index 9a2be34cbd19..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java +++ /dev/null @@ -1,30 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.Capacity; -import com.azure.resourcemanager.loganalytics.models.ClusterSku; -import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; -import org.junit.jupiter.api.Assertions; - -public final class ClusterSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterSku model - = BinaryData.fromString("{\"capacity\":2000,\"name\":\"CapacityReservation\"}").toObject(ClusterSku.class); - Assertions.assertEquals(Capacity.TWO_ZERO_ZERO_ZERO, model.capacity()); - Assertions.assertEquals(ClusterSkuNameEnum.CAPACITY_RESERVATION, model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterSku model = new ClusterSku().withCapacity(Capacity.TWO_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION); - model = BinaryData.fromObject(model).toObject(ClusterSku.class); - Assertions.assertEquals(Capacity.TWO_ZERO_ZERO_ZERO, model.capacity()); - Assertions.assertEquals(ClusterSkuNameEnum.CAPACITY_RESERVATION, model.name()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java deleted file mode 100644 index 57864c8d9600..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClustersDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.clusters().delete("rnfxtgddp", "th", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java deleted file mode 100644 index e3f8126a79ec..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java +++ /dev/null @@ -1,40 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.Column; -import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import org.junit.jupiter.api.Assertions; - -public final class ColumnTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Column model = BinaryData.fromString( - "{\"name\":\"q\",\"type\":\"dateTime\",\"dataTypeHint\":\"guid\",\"displayName\":\"jb\",\"description\":\"gaehvvibrxjjst\",\"isDefaultDisplay\":false,\"isHidden\":false}") - .toObject(Column.class); - Assertions.assertEquals("q", model.name()); - Assertions.assertEquals(ColumnTypeEnum.DATE_TIME, model.type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.dataTypeHint()); - Assertions.assertEquals("jb", model.displayName()); - Assertions.assertEquals("gaehvvibrxjjst", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Column model = new Column().withName("q") - .withType(ColumnTypeEnum.DATE_TIME) - .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("jb") - .withDescription("gaehvvibrxjjst"); - model = BinaryData.fromObject(model).toObject(Column.class); - Assertions.assertEquals("q", model.name()); - Assertions.assertEquals(ColumnTypeEnum.DATE_TIME, model.type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.dataTypeHint()); - Assertions.assertEquals("jb", model.displayName()); - Assertions.assertEquals("gaehvvibrxjjst", model.description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java deleted file mode 100644 index 7ac059f116db..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java +++ /dev/null @@ -1,29 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CoreSummary; -import org.junit.jupiter.api.Assertions; - -public final class CoreSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CoreSummary model - = BinaryData.fromString("{\"status\":\"elpcirelsfeaenwa\",\"numberOfDocuments\":6225068900260031070}") - .toObject(CoreSummary.class); - Assertions.assertEquals("elpcirelsfeaenwa", model.status()); - Assertions.assertEquals(6225068900260031070L, model.numberOfDocuments()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CoreSummary model - = new CoreSummary().withStatus("elpcirelsfeaenwa").withNumberOfDocuments(6225068900260031070L); - model = BinaryData.fromObject(model).toObject(CoreSummary.class); - Assertions.assertEquals("elpcirelsfeaenwa", model.status()); - Assertions.assertEquals(6225068900260031070L, model.numberOfDocuments()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java deleted file mode 100644 index 77d446726320..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java +++ /dev/null @@ -1,45 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.DataExportInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataExportInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataExportInner model = BinaryData.fromString( - "{\"properties\":{\"dataExportId\":\"ovm\",\"tableNames\":[\"kacspkw\",\"hzdobpxjmflbvvnc\"],\"destination\":{\"resourceId\":\"kcciwwzjuqkhr\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"ku\"}},\"enable\":false,\"createdDate\":\"kg\",\"lastModifiedDate\":\"auu\"},\"id\":\"mjmvxieduugidyjr\",\"name\":\"f\",\"type\":\"y\"}") - .toObject(DataExportInner.class); - Assertions.assertEquals("ovm", model.dataExportId()); - Assertions.assertEquals("kacspkw", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("kg", model.createdDate()); - Assertions.assertEquals("auu", model.lastModifiedDate()); - Assertions.assertEquals("kcciwwzjuqkhr", model.resourceId()); - Assertions.assertEquals("ku", model.eventHubName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataExportInner model = new DataExportInner().withDataExportId("ovm") - .withTableNames(Arrays.asList("kacspkw", "hzdobpxjmflbvvnc")) - .withEnable(false) - .withCreatedDate("kg") - .withLastModifiedDate("auu") - .withResourceId("kcciwwzjuqkhr") - .withEventHubName("ku"); - model = BinaryData.fromObject(model).toObject(DataExportInner.class); - Assertions.assertEquals("ovm", model.dataExportId()); - Assertions.assertEquals("kacspkw", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("kg", model.createdDate()); - Assertions.assertEquals("auu", model.lastModifiedDate()); - Assertions.assertEquals("kcciwwzjuqkhr", model.resourceId()); - Assertions.assertEquals("ku", model.eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java deleted file mode 100644 index 011824c5d840..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.DataExportInner; -import com.azure.resourcemanager.loganalytics.models.DataExportListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataExportListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataExportListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dataExportId\":\"exfwhy\",\"tableNames\":[\"i\",\"vyvdcs\",\"tynnaamdectehfi\",\"scjeypv\"],\"destination\":{\"resourceId\":\"zrkgqhcjrefovg\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"eyyvxyqjpkcat\"}},\"enable\":false,\"createdDate\":\"jcrcczsqpjhvmda\",\"lastModifiedDate\":\"nysounqe\"},\"id\":\"a\",\"name\":\"oaeupfhyhltrpmo\",\"type\":\"jmcmatuokthfu\"},{\"properties\":{\"dataExportId\":\"odsfcpkvxodpuozm\",\"tableNames\":[\"ydagfuaxbe\",\"yiuokktwh\",\"dxwzywqsmbsurexi\",\"o\"],\"destination\":{\"resourceId\":\"ocfs\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"ddystkiiuxhqy\"}},\"enable\":false,\"createdDate\":\"rrqnbpoczvyifqrv\",\"lastModifiedDate\":\"vjsllrmvvdfw\"},\"id\":\"t\",\"name\":\"pnpulexxbczwtru\",\"type\":\"iqzbq\"}]}") - .toObject(DataExportListResult.class); - Assertions.assertEquals("exfwhy", model.value().get(0).dataExportId()); - Assertions.assertEquals("i", model.value().get(0).tableNames().get(0)); - Assertions.assertEquals(false, model.value().get(0).enable()); - Assertions.assertEquals("jcrcczsqpjhvmda", model.value().get(0).createdDate()); - Assertions.assertEquals("nysounqe", model.value().get(0).lastModifiedDate()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).resourceId()); - Assertions.assertEquals("eyyvxyqjpkcat", model.value().get(0).eventHubName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataExportListResult model = new DataExportListResult().withValue(Arrays.asList( - new DataExportInner().withDataExportId("exfwhy") - .withTableNames(Arrays.asList("i", "vyvdcs", "tynnaamdectehfi", "scjeypv")) - .withEnable(false) - .withCreatedDate("jcrcczsqpjhvmda") - .withLastModifiedDate("nysounqe") - .withResourceId("zrkgqhcjrefovg") - .withEventHubName("eyyvxyqjpkcat"), - new DataExportInner().withDataExportId("odsfcpkvxodpuozm") - .withTableNames(Arrays.asList("ydagfuaxbe", "yiuokktwh", "dxwzywqsmbsurexi", "o")) - .withEnable(false) - .withCreatedDate("rrqnbpoczvyifqrv") - .withLastModifiedDate("vjsllrmvvdfw") - .withResourceId("ocfs") - .withEventHubName("ddystkiiuxhqy"))); - model = BinaryData.fromObject(model).toObject(DataExportListResult.class); - Assertions.assertEquals("exfwhy", model.value().get(0).dataExportId()); - Assertions.assertEquals("i", model.value().get(0).tableNames().get(0)); - Assertions.assertEquals(false, model.value().get(0).enable()); - Assertions.assertEquals("jcrcczsqpjhvmda", model.value().get(0).createdDate()); - Assertions.assertEquals("nysounqe", model.value().get(0).lastModifiedDate()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).resourceId()); - Assertions.assertEquals("eyyvxyqjpkcat", model.value().get(0).eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java deleted file mode 100644 index 02615cd49ba4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java +++ /dev/null @@ -1,45 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.DataExportProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataExportPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataExportProperties model = BinaryData.fromString( - "{\"dataExportId\":\"svexcsonpclhoco\",\"tableNames\":[\"lkevle\",\"gz\"],\"destination\":{\"resourceId\":\"u\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"axkffei\"}},\"enable\":false,\"createdDate\":\"vmezy\",\"lastModifiedDate\":\"hxmzsbbzoggig\"}") - .toObject(DataExportProperties.class); - Assertions.assertEquals("svexcsonpclhoco", model.dataExportId()); - Assertions.assertEquals("lkevle", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("vmezy", model.createdDate()); - Assertions.assertEquals("hxmzsbbzoggig", model.lastModifiedDate()); - Assertions.assertEquals("u", model.resourceId()); - Assertions.assertEquals("axkffei", model.eventHubName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataExportProperties model = new DataExportProperties().withDataExportId("svexcsonpclhoco") - .withTableNames(Arrays.asList("lkevle", "gz")) - .withEnable(false) - .withCreatedDate("vmezy") - .withLastModifiedDate("hxmzsbbzoggig") - .withResourceId("u") - .withEventHubName("axkffei"); - model = BinaryData.fromObject(model).toObject(DataExportProperties.class); - Assertions.assertEquals("svexcsonpclhoco", model.dataExportId()); - Assertions.assertEquals("lkevle", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("vmezy", model.createdDate()); - Assertions.assertEquals("hxmzsbbzoggig", model.lastModifiedDate()); - Assertions.assertEquals("u", model.resourceId()); - Assertions.assertEquals("axkffei", model.eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index fd97979e9f33..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataExport; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataExportsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"dataExportId\":\"lfmk\",\"tableNames\":[\"cazuaw\",\"tzxpuamwabzxrv\",\"cush\",\"phai\"],\"destination\":{\"resourceId\":\"xyasflvgsgzw\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"ihknsmjbl\"}},\"enable\":true,\"createdDate\":\"lnymzotqy\",\"lastModifiedDate\":\"uzcbmqq\"},\"id\":\"xmvwfg\",\"name\":\"ayxonsupeujl\",\"type\":\"qnhcvsqltnzoibg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataExport response = manager.dataExports() - .define("igjkskyrio") - .withExistingWorkspace("hv", "slkvntjl") - .withDataExportId("idsxwaabzmifry") - .withTableNames(Arrays.asList("nmmaxrizkzob", "opxlhslnelxieixy", "llxecwc", "ojphslhc")) - .withEnable(true) - .withCreatedDate("n") - .withLastModifiedDate("ujeickp") - .withResourceId("jutifdwfmvigorqj") - .withEventHubName("raglk") - .create(); - - Assertions.assertEquals("lfmk", response.dataExportId()); - Assertions.assertEquals("cazuaw", response.tableNames().get(0)); - Assertions.assertEquals(true, response.enable()); - Assertions.assertEquals("lnymzotqy", response.createdDate()); - Assertions.assertEquals("uzcbmqq", response.lastModifiedDate()); - Assertions.assertEquals("xyasflvgsgzw", response.resourceId()); - Assertions.assertEquals("ihknsmjbl", response.eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java deleted file mode 100644 index aa6e5e28ee07..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataExportsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.dataExports() - .deleteWithResponse("cfhmlrqryxyn", "nzrdpsovwxz", "ptgoeiybbabp", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java deleted file mode 100644 index 7cc8ab74fe0b..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java +++ /dev/null @@ -1,44 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataExport; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataExportsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"dataExportId\":\"sdaultxij\",\"tableNames\":[\"mfqwa\"],\"destination\":{\"resourceId\":\"nqnm\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"qdqx\"}},\"enable\":false,\"createdDate\":\"gny\",\"lastModifiedDate\":\"sf\"},\"id\":\"svtui\",\"name\":\"zh\",\"type\":\"jqg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataExport response - = manager.dataExports().getWithResponse("jg", "yexaoguy", "i", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("sdaultxij", response.dataExportId()); - Assertions.assertEquals("mfqwa", response.tableNames().get(0)); - Assertions.assertEquals(false, response.enable()); - Assertions.assertEquals("gny", response.createdDate()); - Assertions.assertEquals("sf", response.lastModifiedDate()); - Assertions.assertEquals("nqnm", response.resourceId()); - Assertions.assertEquals("qdqx", response.eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java deleted file mode 100644 index 87c97ad27ebf..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java +++ /dev/null @@ -1,45 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataExport; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataExportsListByWorkspaceMockTests { - @Test - public void testListByWorkspace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"dataExportId\":\"iljhahz\",\"tableNames\":[\"chndbnwie\",\"olewjwi\",\"ubwefqs\",\"ap\"],\"destination\":{\"resourceId\":\"tf\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"ex\"}},\"enable\":true,\"createdDate\":\"xap\",\"lastModifiedDate\":\"og\"},\"id\":\"qnobp\",\"name\":\"dcdab\",\"type\":\"qwpwyawbzasqbuc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.dataExports().listByWorkspace("zejnhl", "kpbz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("iljhahz", response.iterator().next().dataExportId()); - Assertions.assertEquals("chndbnwie", response.iterator().next().tableNames().get(0)); - Assertions.assertEquals(true, response.iterator().next().enable()); - Assertions.assertEquals("xap", response.iterator().next().createdDate()); - Assertions.assertEquals("og", response.iterator().next().lastModifiedDate()); - Assertions.assertEquals("tf", response.iterator().next().resourceId()); - Assertions.assertEquals("ex", response.iterator().next().eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java deleted file mode 100644 index e4167ab17473..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java +++ /dev/null @@ -1,48 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.DataSourceInner; -import com.azure.resourcemanager.loganalytics.models.DataSourceKind; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataSourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataSourceInner model = BinaryData.fromString( - "{\"properties\":\"datakbldngkpocipa\",\"etag\":\"xoegukgjnpiucgy\",\"kind\":\"LinuxChangeTrackingPath\",\"tags\":{\"izcdrqjsd\":\"zntypmrb\",\"cwif\":\"ydnfyhxdeoejz\"},\"id\":\"jttgzf\",\"name\":\"ishc\",\"type\":\"khaj\"}") - .toObject(DataSourceInner.class); - Assertions.assertEquals("xoegukgjnpiucgy", model.etag()); - Assertions.assertEquals(DataSourceKind.LINUX_CHANGE_TRACKING_PATH, model.kind()); - Assertions.assertEquals("zntypmrb", model.tags().get("izcdrqjsd")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataSourceInner model = new DataSourceInner().withProperties("datakbldngkpocipa") - .withEtag("xoegukgjnpiucgy") - .withKind(DataSourceKind.LINUX_CHANGE_TRACKING_PATH) - .withTags(mapOf("izcdrqjsd", "zntypmrb", "cwif", "ydnfyhxdeoejz")); - model = BinaryData.fromObject(model).toObject(DataSourceInner.class); - Assertions.assertEquals("xoegukgjnpiucgy", model.etag()); - Assertions.assertEquals(DataSourceKind.LINUX_CHANGE_TRACKING_PATH, model.kind()); - Assertions.assertEquals("zntypmrb", model.tags().get("izcdrqjsd")); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java deleted file mode 100644 index 6432973976d0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.DataSourceInner; -import com.azure.resourcemanager.loganalytics.models.DataSourceKind; -import com.azure.resourcemanager.loganalytics.models.DataSourceListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataSourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataSourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":\"dataeamdp\",\"etag\":\"g\",\"kind\":\"CustomLog\",\"tags\":{\"ow\":\"uxwgipwho\",\"injep\":\"gshwankixz\"},\"id\":\"ttmrywnuzoqf\",\"name\":\"iyqzrnk\",\"type\":\"qvyxlwhzlsicoho\"},{\"properties\":\"dataqnwvlrya\",\"etag\":\"hheunmmqhgyx\",\"kind\":\"ChangeTrackingDataTypeConfiguration\",\"tags\":{\"conuqszfkbeype\":\"ocukoklyax\"},\"id\":\"rmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"},{\"properties\":\"dataqylihkaetckt\",\"etag\":\"civfsnkymuctq\",\"kind\":\"SqlDataClassification\",\"tags\":{\"fuwutttxf\":\"ebrjcxe\",\"hfnljkyq\":\"jrbirphxepcyv\",\"uujqgidokgjljyo\":\"j\",\"bgsncghkjeszzhb\":\"gvcl\"},\"id\":\"jhtxfvgxbfsmxne\",\"name\":\"mpvecxgodebfqk\",\"type\":\"rbmpukgri\"},{\"properties\":\"dataflz\",\"etag\":\"bxzpuzycisp\",\"kind\":\"CustomLogCollection\",\"tags\":{\"hibnuqqkpika\":\"hmgkbrpyy\",\"buynhijggm\":\"rgvtqag\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}],\"nextLink\":\"tdbhrbnla\"}") - .toObject(DataSourceListResult.class); - Assertions.assertEquals("g", model.value().get(0).etag()); - Assertions.assertEquals(DataSourceKind.CUSTOM_LOG, model.value().get(0).kind()); - Assertions.assertEquals("uxwgipwho", model.value().get(0).tags().get("ow")); - Assertions.assertEquals("tdbhrbnla", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataSourceListResult model - = new DataSourceListResult() - .withValue(Arrays.asList( - new DataSourceInner().withProperties("dataeamdp") - .withEtag("g") - .withKind(DataSourceKind.CUSTOM_LOG) - .withTags(mapOf("ow", "uxwgipwho", "injep", "gshwankixz")), - new DataSourceInner().withProperties("dataqnwvlrya") - .withEtag("hheunmmqhgyx") - .withKind(DataSourceKind.CHANGE_TRACKING_DATA_TYPE_CONFIGURATION) - .withTags(mapOf("conuqszfkbeype", "ocukoklyax")), - new DataSourceInner().withProperties("dataqylihkaetckt") - .withEtag("civfsnkymuctq") - .withKind(DataSourceKind.SQL_DATA_CLASSIFICATION) - .withTags(mapOf("fuwutttxf", "ebrjcxe", "hfnljkyq", "jrbirphxepcyv", "uujqgidokgjljyo", "j", - "bgsncghkjeszzhb", "gvcl")), - new DataSourceInner().withProperties("dataflz") - .withEtag("bxzpuzycisp") - .withKind(DataSourceKind.CUSTOM_LOG_COLLECTION) - .withTags(mapOf("hibnuqqkpika", "hmgkbrpyy", "buynhijggm", "rgvtqag")))) - .withNextLink("tdbhrbnla"); - model = BinaryData.fromObject(model).toObject(DataSourceListResult.class); - Assertions.assertEquals("g", model.value().get(0).etag()); - Assertions.assertEquals(DataSourceKind.CUSTOM_LOG, model.value().get(0).kind()); - Assertions.assertEquals("uxwgipwho", model.value().get(0).tags().get("ow")); - Assertions.assertEquals("tdbhrbnla", model.nextLink()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c82310019a03..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,61 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataSource; -import com.azure.resourcemanager.loganalytics.models.DataSourceKind; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataSourcesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":\"dataejjtbxqmul\",\"etag\":\"lxqzvn\",\"kind\":\"ChangeTrackingDataTypeConfiguration\",\"tags\":{\"qbsms\":\"ycucrwnamikzeb\",\"kzruswh\":\"ziqgfuh\",\"ycjsx\":\"hczznvf\",\"xqhndvnoamlds\":\"wwixzvumw\"},\"id\":\"haohdjhhflzokxc\",\"name\":\"xpelnjetagltsx\",\"type\":\"atftgzpnpbsw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataSource response = manager.dataSources() - .define("jx") - .withExistingWorkspace("bffmbmxz", "rgywwp") - .withProperties("datanptfujgi") - .withKind(DataSourceKind.LINUX_SYSLOG) - .withTags(mapOf("gehkfkimrtixokff", "mxswvruunzz", "qwhix", "yinljqe", "i", "onsts")) - .withEtag("aaoepttaqut") - .create(); - - Assertions.assertEquals("lxqzvn", response.etag()); - Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_DATA_TYPE_CONFIGURATION, response.kind()); - Assertions.assertEquals("ycucrwnamikzeb", response.tags().get("qbsms")); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java deleted file mode 100644 index d578c9558375..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataSourcesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.dataSources() - .deleteWithResponse("xgnxfyqonmpqoxwd", "fdbxiqxeiiqbim", "tmwwi", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java deleted file mode 100644 index 59d8090c48f3..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,42 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataSource; -import com.azure.resourcemanager.loganalytics.models.DataSourceKind; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataSourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":\"datakbwvqvxkdiv\",\"etag\":\"heb\",\"kind\":\"ChangeTrackingRegistry\",\"tags\":{\"gi\":\"bzuwfmdurag\",\"igkxkbsazga\":\"vcjfelisdjubggb\",\"apvu\":\"gacyrcmjdmspo\",\"zjedmstkvnlv\":\"rylniofrzg\"},\"id\":\"bcuiiz\",\"name\":\"ktwfa\",\"type\":\"snvpdibmi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataSource response = manager.dataSources() - .getWithResponse("h", "hfqpofv", "bcblemb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("heb", response.etag()); - Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_REGISTRY, response.kind()); - Assertions.assertEquals("bzuwfmdurag", response.tags().get("gi")); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java deleted file mode 100644 index 00be625a916f..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java +++ /dev/null @@ -1,42 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataSource; -import com.azure.resourcemanager.loganalytics.models.DataSourceKind; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DataSourcesListByWorkspaceMockTests { - @Test - public void testListByWorkspace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":\"datalfwyfwlwxjwetn\",\"etag\":\"ihclafzv\",\"kind\":\"WindowsPerformanceCounter\",\"tags\":{\"tcmwqkchc\":\"trsqqw\"},\"id\":\"waxfewzjkj\",\"name\":\"xfdeqvhpsyl\",\"type\":\"ksh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.dataSources() - .listByWorkspace("ostbzbkiwb", "qnyophzfyls", "crpfbcunez", "cez", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ihclafzv", response.iterator().next().etag()); - Assertions.assertEquals(DataSourceKind.WINDOWS_PERFORMANCE_COUNTER, response.iterator().next().kind()); - Assertions.assertEquals("trsqqw", response.iterator().next().tags().get("tcmwqkchc")); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java deleted file mode 100644 index 0a2347b703b1..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java +++ /dev/null @@ -1,63 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.Workspace; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeletedWorkspacesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"customerId\":\"qyn\",\"sku\":{\"name\":\"Standalone\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"aq\"},\"retentionInDays\":530847681,\"workspaceCapping\":{\"dailyQuotaGb\":80.1550882239485,\"quotaNextResetTime\":\"hwddkvbxgkq\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"w\",\"modifiedDate\":\"dacarvvlfnty\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"erohzrsqalsxkdn\",\"scopeId\":\"apfgsdpcvessm\"},{\"resourceId\":\"h\",\"scopeId\":\"uipldqq\"},{\"resourceId\":\"ekvalblhtjq\",\"scopeId\":\"yvwehtaemxh\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"ivzrrryveimipsk\",\"disableLocalAuth\":true,\"\":{\"tjvv\":\"datavfuzka\"}},\"defaultDataCollectionRuleResourceId\":\"xwigsye\"},\"identity\":{\"principalId\":\"dsmjtgr\",\"tenantId\":\"dgkkile\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ygbdgwumgxdgdhpa\":{\"principalId\":\"mknhwtbbaedor\",\"clientId\":\"mqfl\"},\"tefhexcgjokjl\":{\"principalId\":\"dexjddvjs\",\"clientId\":\"wotmmwllcolsrsxa\"}}},\"systemData\":{\"createdBy\":\"v\",\"createdByType\":\"Key\",\"createdAt\":\"2021-11-03T13:01:45Z\",\"lastModifiedBy\":\"peeksnbksdqhjv\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-07-06T01:14:39Z\"},\"etag\":\"lkhhu\",\"location\":\"tcpoqma\",\"tags\":{\"jkxyb\":\"qjwgoknlej\",\"jbzten\":\"fdb\"},\"id\":\"vkzykjtjknsxf\",\"name\":\"us\",\"type\":\"cdp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.deletedWorkspaces().listByResourceGroup("djus", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tcpoqma", response.iterator().next().location()); - Assertions.assertEquals("qjwgoknlej", response.iterator().next().tags().get("jkxyb")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("lkhhu", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(530847681, response.iterator().next().retentionInDays()); - Assertions.assertEquals(80.1550882239485D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - response.iterator().next().publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, - response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(false, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("ivzrrryveimipsk", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("xwigsye", response.iterator().next().defaultDataCollectionRuleResourceId()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java deleted file mode 100644 index 891c3528ebe5..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java +++ /dev/null @@ -1,62 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.Workspace; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeletedWorkspacesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"customerId\":\"ztwhghmupg\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"xabb\"},\"retentionInDays\":1038396263,\"workspaceCapping\":{\"dailyQuotaGb\":38.243065707057745,\"quotaNextResetTime\":\"bbklqpxzuca\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"wwnlzafwxudgnh\",\"modifiedDate\":\"okrtalvnb\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"lvdjjukyr\",\"scopeId\":\"qo\"},{\"resourceId\":\"ahhxhqfaqnvzoqg\",\"scopeId\":\"pem\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"ejdtxptl\",\"disableLocalAuth\":true,\"\":{\"j\":\"dataomew\",\"uhqawmoaianc\":\"datatl\",\"blxydkxr\":\"datanvodrrs\"}},\"defaultDataCollectionRuleResourceId\":\"vbxiwkgfbqlj\"},\"identity\":{\"principalId\":\"hychocokuleh\",\"tenantId\":\"qlrqffaweyurk\",\"type\":\"key\",\"userAssignedIdentities\":{\"rxmrgchbapx\":{\"principalId\":\"xra\",\"clientId\":\"uqd\"},\"bajbuscgduusi\":{\"principalId\":\"y\",\"clientId\":\"j\"},\"kyxl\":{\"principalId\":\"cblevpmc\",\"clientId\":\"jy\"},\"vdwnapfdqwowft\":{\"principalId\":\"sjgkzzltafh\",\"clientId\":\"ffovwmbjlzqsczp\"}}},\"systemData\":{\"createdBy\":\"uwjtks\",\"createdByType\":\"Key\",\"createdAt\":\"2021-07-07T02:15:20Z\",\"lastModifiedBy\":\"y\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-04-28T02:09:32Z\"},\"etag\":\"q\",\"location\":\"hvyeldotj\",\"tags\":{\"spkxkdt\":\"wiswskukjtasbvw\",\"vtwknvgmmbugt\":\"fkndl\",\"kueatgroeshoy\":\"watmqa\",\"kfaoytehq\":\"zcbyfq\"},\"id\":\"uvjmv\",\"name\":\"mtdwcky\",\"type\":\"roejnndl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.deletedWorkspaces().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hvyeldotj", response.iterator().next().location()); - Assertions.assertEquals("wiswskukjtasbvw", response.iterator().next().tags().get("spkxkdt")); - Assertions.assertEquals(IdentityType.KEY, response.iterator().next().identity().type()); - Assertions.assertEquals("q", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(1038396263, response.iterator().next().retentionInDays()); - Assertions.assertEquals(38.243065707057745D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - response.iterator().next().publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(true, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("ejdtxptl", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("vbxiwkgfbqlj", response.iterator().next().defaultDataCollectionRuleResourceId()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java deleted file mode 100644 index 3a73f10f1616..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java +++ /dev/null @@ -1,25 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.DestinationMetadata; -import org.junit.jupiter.api.Assertions; - -public final class DestinationMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DestinationMetadata model - = BinaryData.fromString("{\"eventHubName\":\"uknvudwti\"}").toObject(DestinationMetadata.class); - Assertions.assertEquals("uknvudwti", model.eventHubName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DestinationMetadata model = new DestinationMetadata().withEventHubName("uknvudwti"); - model = BinaryData.fromObject(model).toObject(DestinationMetadata.class); - Assertions.assertEquals("uknvudwti", model.eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java deleted file mode 100644 index 4d08fdd12af4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java +++ /dev/null @@ -1,29 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.Destination; -import org.junit.jupiter.api.Assertions; - -public final class DestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Destination model = BinaryData - .fromString( - "{\"resourceId\":\"xwburvjxxjns\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"koen\"}}") - .toObject(Destination.class); - Assertions.assertEquals("xwburvjxxjns", model.resourceId()); - Assertions.assertEquals("koen", model.eventHubName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Destination model = new Destination().withResourceId("xwburvjxxjns").withEventHubName("koen"); - model = BinaryData.fromObject(model).toObject(Destination.class); - Assertions.assertEquals("xwburvjxxjns", model.resourceId()); - Assertions.assertEquals("koen", model.eventHubName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java deleted file mode 100644 index 7b433126c9b0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GatewaysDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.gateways().deleteWithResponse("jwtrhtgvgzp", "rrkolawjmjs", "wro", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java deleted file mode 100644 index c7ff9ea8ee6d..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java +++ /dev/null @@ -1,43 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.Identity; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = BinaryData.fromString( - "{\"principalId\":\"yl\",\"tenantId\":\"ool\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"urdoi\":{\"principalId\":\"iwkkbn\",\"clientId\":\"rywvtylbfpn\"}}}") - .toObject(Identity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("urdoi", new UserIdentityProperties())); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java deleted file mode 100644 index 9b26c589211a..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java +++ /dev/null @@ -1,31 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.IntelligencePackInner; -import org.junit.jupiter.api.Assertions; - -public final class IntelligencePackInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IntelligencePackInner model - = BinaryData.fromString("{\"name\":\"xmyskp\",\"enabled\":true,\"displayName\":\"btkcxywnytnrsyn\"}") - .toObject(IntelligencePackInner.class); - Assertions.assertEquals("xmyskp", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("btkcxywnytnrsyn", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IntelligencePackInner model - = new IntelligencePackInner().withName("xmyskp").withEnabled(true).withDisplayName("btkcxywnytnrsyn"); - model = BinaryData.fromObject(model).toObject(IntelligencePackInner.class); - Assertions.assertEquals("xmyskp", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("btkcxywnytnrsyn", model.displayName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java deleted file mode 100644 index 5f7ab2cf0601..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class IntelligencePacksDisableWithResponseMockTests { - @Test - public void testDisableWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.intelligencePacks() - .disableWithResponse("e", "loccsrmozihm", "pgawtxxpkyjcxcjx", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java deleted file mode 100644 index f9cf202b49cd..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class IntelligencePacksEnableWithResponseMockTests { - @Test - public void testEnableWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.intelligencePacks() - .enableWithResponse("rytfmpcycil", "mcayk", "gnoxuztrksx", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java deleted file mode 100644 index 5055a4ea2785..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java +++ /dev/null @@ -1,42 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.IntelligencePack; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.List; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class IntelligencePacksListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "[{\"name\":\"zvoamktc\",\"enabled\":false,\"displayName\":\"mgbzahgxqdlyrtl\"},{\"name\":\"ap\",\"enabled\":false,\"displayName\":\"katbhjm\"},{\"name\":\"nbsoqeqalarv\",\"enabled\":true,\"displayName\":\"nbtgfebwl\"}]"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - List response = manager.intelligencePacks() - .listWithResponse("pndfcpfnznt", "jtwkjaos", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zvoamktc", response.get(0).name()); - Assertions.assertEquals(false, response.get(0).enabled()); - Assertions.assertEquals("mgbzahgxqdlyrtl", response.get(0).displayName()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java deleted file mode 100644 index a19e21dc77ed..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java +++ /dev/null @@ -1,50 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LinkedServiceInner; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LinkedServiceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedServiceInner model = BinaryData.fromString( - "{\"properties\":{\"resourceId\":\"idybyxczf\",\"writeAccessResourceId\":\"haaxdbabphl\",\"provisioningState\":\"ProvisioningAccount\"},\"tags\":{\"azt\":\"ktsthsucocmny\"},\"id\":\"bt\",\"name\":\"wrqpue\",\"type\":\"ckzywbiexzfeyue\"}") - .toObject(LinkedServiceInner.class); - Assertions.assertEquals("ktsthsucocmny", model.tags().get("azt")); - Assertions.assertEquals("idybyxczf", model.resourceId()); - Assertions.assertEquals("haaxdbabphl", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedServiceInner model = new LinkedServiceInner().withTags(mapOf("azt", "ktsthsucocmny")) - .withResourceId("idybyxczf") - .withWriteAccessResourceId("haaxdbabphl") - .withProvisioningState(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT); - model = BinaryData.fromObject(model).toObject(LinkedServiceInner.class); - Assertions.assertEquals("ktsthsucocmny", model.tags().get("azt")); - Assertions.assertEquals("idybyxczf", model.resourceId()); - Assertions.assertEquals("haaxdbabphl", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT, model.provisioningState()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java deleted file mode 100644 index c02e8f9b63bc..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java +++ /dev/null @@ -1,57 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LinkedServiceInner; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LinkedServiceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedServiceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resourceId\":\"aepdkzjanc\",\"writeAccessResourceId\":\"rhdwbavxbniw\",\"provisioningState\":\"Deleting\"},\"tags\":{\"ytxhp\":\"tsdbpgn\"},\"id\":\"xbzpfzab\",\"name\":\"lcuhxwtctyqiklb\",\"type\":\"ovplw\"},{\"properties\":{\"resourceId\":\"hvgyuguosvmk\",\"writeAccessResourceId\":\"sxqu\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"lpvlopw\":\"gmgsxnkjzkde\"},\"id\":\"yighxpk\",\"name\":\"wzbaiue\",\"type\":\"baumnyqupedeoj\"}]}") - .toObject(LinkedServiceListResult.class); - Assertions.assertEquals("tsdbpgn", model.value().get(0).tags().get("ytxhp")); - Assertions.assertEquals("aepdkzjanc", model.value().get(0).resourceId()); - Assertions.assertEquals("rhdwbavxbniw", model.value().get(0).writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, model.value().get(0).provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedServiceListResult model = new LinkedServiceListResult().withValue(Arrays.asList( - new LinkedServiceInner().withTags(mapOf("ytxhp", "tsdbpgn")) - .withResourceId("aepdkzjanc") - .withWriteAccessResourceId("rhdwbavxbniw") - .withProvisioningState(LinkedServiceEntityStatus.DELETING), - new LinkedServiceInner().withTags(mapOf("lpvlopw", "gmgsxnkjzkde")) - .withResourceId("hvgyuguosvmk") - .withWriteAccessResourceId("sxqu") - .withProvisioningState(LinkedServiceEntityStatus.SUCCEEDED))); - model = BinaryData.fromObject(model).toObject(LinkedServiceListResult.class); - Assertions.assertEquals("tsdbpgn", model.value().get(0).tags().get("ytxhp")); - Assertions.assertEquals("aepdkzjanc", model.value().get(0).resourceId()); - Assertions.assertEquals("rhdwbavxbniw", model.value().get(0).writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, model.value().get(0).provisioningState()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java deleted file mode 100644 index 1921880c37b5..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LinkedServiceProperties; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; -import org.junit.jupiter.api.Assertions; - -public final class LinkedServicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedServiceProperties model = BinaryData - .fromString( - "{\"resourceId\":\"ibx\",\"writeAccessResourceId\":\"wbhqwal\",\"provisioningState\":\"Updating\"}") - .toObject(LinkedServiceProperties.class); - Assertions.assertEquals("ibx", model.resourceId()); - Assertions.assertEquals("wbhqwal", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedServiceProperties model = new LinkedServiceProperties().withResourceId("ibx") - .withWriteAccessResourceId("wbhqwal") - .withProvisioningState(LinkedServiceEntityStatus.UPDATING); - model = BinaryData.fromObject(model).toObject(LinkedServiceProperties.class); - Assertions.assertEquals("ibx", model.resourceId()); - Assertions.assertEquals("wbhqwal", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java deleted file mode 100644 index 8aa374bd1815..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,62 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LinkedService; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedServicesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"resourceId\":\"psw\",\"writeAccessResourceId\":\"mvkhlggd\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"jfpgpicrmn\":\"qkzszuwiwtglxxh\",\"mqgjsxvpq\":\"hr\",\"bakclacjfrnxous\":\"bfrmbodthsqqgvri\"},\"id\":\"au\",\"name\":\"lwvsgm\",\"type\":\"ohqfzizv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LinkedService response = manager.linkedServices() - .define("yp") - .withExistingWorkspace("aglqivbgkcvkh", "zvuqdflvon") - .withTags(mapOf("fgpikqm", "bgqjxgpnrhgo")) - .withResourceId("ubcpzgpxti") - .withWriteAccessResourceId("j") - .withProvisioningState(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT) - .create(); - - Assertions.assertEquals("qkzszuwiwtglxxh", response.tags().get("jfpgpicrmn")); - Assertions.assertEquals("psw", response.resourceId()); - Assertions.assertEquals("mvkhlggd", response.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.SUCCEEDED, response.provisioningState()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java deleted file mode 100644 index e12a213a1bd0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java +++ /dev/null @@ -1,42 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LinkedService; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedServicesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr - = "{\"properties\":{\"resourceId\":\"mjjyuojq\",\"writeAccessResourceId\":\"baxk\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"jkwrusnkq\":\"nlb\",\"hdenxaulk\":\"hsyrqunj\",\"xuckpggqoweyir\":\"akdkifmjnnawtqab\"},\"id\":\"hlisngw\",\"name\":\"lqqmpiz\",\"type\":\"uwnpqxpxiwfcng\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LinkedService response - = manager.linkedServices().delete("bmhyreeudz", "av", "pdqmjxlyyzglgouw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nlb", response.tags().get("jkwrusnkq")); - Assertions.assertEquals("mjjyuojq", response.resourceId()); - Assertions.assertEquals("baxk", response.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.SUCCEEDED, response.provisioningState()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java deleted file mode 100644 index cc7e7adb9e22..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LinkedService; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedServicesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"resourceId\":\"atzv\",\"writeAccessResourceId\":\"glbyvi\",\"provisioningState\":\"Updating\"},\"tags\":{\"fbkgozxwopdby\":\"rxkjzwrgxffmshk\",\"zqaclna\":\"p\"},\"id\":\"xbiygnugjknfsmf\",\"name\":\"ttuxuuyilflqoiqu\",\"type\":\"rehmr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LinkedService response = manager.linkedServices() - .getWithResponse("saasiixtmkzj", "kv", "irhgfgrwsdp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rxkjzwrgxffmshk", response.tags().get("fbkgozxwopdby")); - Assertions.assertEquals("atzv", response.resourceId()); - Assertions.assertEquals("glbyvi", response.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, response.provisioningState()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java deleted file mode 100644 index c3737d885ea1..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java +++ /dev/null @@ -1,43 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LinkedService; -import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedServicesListByWorkspaceMockTests { - @Test - public void testListByWorkspace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"resourceId\":\"njle\",\"writeAccessResourceId\":\"xsmrpddouifamow\",\"provisioningState\":\"Deleting\"},\"tags\":{\"tmaaj\":\"knlqwzdvpiwhxqsz\",\"bmzyospsps\":\"uhuxylrjvmtyg\",\"fkyjpmspbpssdfpp\":\"c\"},\"id\":\"ogtieyujtvczkcny\",\"name\":\"rxmunjdxvgln\",\"type\":\"vxlx\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.linkedServices().listByWorkspace("jhvsujztczyt", "jtwhauunf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("knlqwzdvpiwhxqsz", response.iterator().next().tags().get("tmaaj")); - Assertions.assertEquals("njle", response.iterator().next().resourceId()); - Assertions.assertEquals("xsmrpddouifamow", response.iterator().next().writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, response.iterator().next().provisioningState()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c1bcb4df7e9e..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,43 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataSourceType; -import com.azure.resourcemanager.loganalytics.models.LinkedStorageAccountsResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedStorageAccountsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"dataSourceType\":\"Alerts\",\"storageAccountIds\":[\"k\",\"jqirwrw\",\"ooxf\",\"i\"]},\"id\":\"hx\",\"name\":\"rsnewmozqvbubqma\",\"type\":\"hsycxhxzgaz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LinkedStorageAccountsResource response = manager.linkedStorageAccounts() - .define(DataSourceType.QUERY) - .withExistingWorkspace("jipnwj", "ujqlafcbahh") - .withStorageAccountIds(Arrays.asList("iyjwpfilkmkkho")) - .create(); - - Assertions.assertEquals("k", response.storageAccountIds().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java deleted file mode 100644 index 40493a52e050..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataSourceType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedStorageAccountsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.linkedStorageAccounts() - .deleteWithResponse("xmmkjs", "thnwpzte", DataSourceType.QUERY, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java deleted file mode 100644 index d10dd144a0b4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.DataSourceType; -import com.azure.resourcemanager.loganalytics.models.LinkedStorageAccountsResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedStorageAccountsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"wvxwlmzqwmvt\",\"njmxmcuqudtcvcl\",\"ynpdkvgfab\"]},\"id\":\"iyji\",\"name\":\"uzphdugnei\",\"type\":\"n\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LinkedStorageAccountsResource response = manager.linkedStorageAccounts() - .getWithResponse("vmribiat", "gplucfotangcfhny", DataSourceType.CUSTOM_LOGS, - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wvxwlmzqwmvt", response.storageAccountIds().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java deleted file mode 100644 index aa5e03209483..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java +++ /dev/null @@ -1,39 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LinkedStorageAccountsResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LinkedStorageAccountsListByWorkspaceMockTests { - @Test - public void testListByWorkspace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"d\",\"urrxxgewpktv\",\"ylkmqp\"]},\"id\":\"o\",\"name\":\"hlfbcgwgc\",\"type\":\"oxoebqi\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.linkedStorageAccounts().listByWorkspace("gox", "jiuqhibtozi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("d", response.iterator().next().storageAccountIds().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java deleted file mode 100644 index dd4162a279cc..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LinkedStorageAccountsResourceInner; -import com.azure.resourcemanager.loganalytics.models.LinkedStorageAccountsListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LinkedStorageAccountsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedStorageAccountsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"vce\",\"vei\",\"ovnotyfjfcnjbkcn\",\"dhbt\"]},\"id\":\"kphywpnvjto\",\"name\":\"nermcl\",\"type\":\"plpho\"},{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"pabgyeps\",\"jta\"]},\"id\":\"qugxywpmueefjzwf\",\"name\":\"kqujidsuyono\",\"type\":\"glaocq\"},{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"g\",\"udxytlmoyrx\",\"wfudwpzntxhdzhl\",\"qj\"]},\"id\":\"hckfrlhrx\",\"name\":\"bkyvp\",\"type\":\"ca\"},{\"properties\":{\"dataSourceType\":\"CustomLogs\",\"storageAccountIds\":[\"zka\"]},\"id\":\"kuwbcrnwb\",\"name\":\"ehhseyvjusrts\",\"type\":\"hspkdeemao\"}]}") - .toObject(LinkedStorageAccountsListResult.class); - Assertions.assertEquals("vce", model.value().get(0).storageAccountIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedStorageAccountsListResult model = new LinkedStorageAccountsListResult().withValue(Arrays.asList( - new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("vce", "vei", "ovnotyfjfcnjbkcn", "dhbt")), - new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("pabgyeps", "jta")), - new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("g", "udxytlmoyrx", "wfudwpzntxhdzhl", "qj")), - new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("zka")))); - model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsListResult.class); - Assertions.assertEquals("vce", model.value().get(0).storageAccountIds().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java deleted file mode 100644 index 9832736ff713..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java +++ /dev/null @@ -1,28 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LinkedStorageAccountsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LinkedStorageAccountsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedStorageAccountsProperties model - = BinaryData.fromString("{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"sx\"]}") - .toObject(LinkedStorageAccountsProperties.class); - Assertions.assertEquals("sx", model.storageAccountIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedStorageAccountsProperties model - = new LinkedStorageAccountsProperties().withStorageAccountIds(Arrays.asList("sx")); - model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsProperties.class); - Assertions.assertEquals("sx", model.storageAccountIds().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java deleted file mode 100644 index 66a4b51c423d..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java +++ /dev/null @@ -1,28 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LinkedStorageAccountsResourceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LinkedStorageAccountsResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedStorageAccountsResourceInner model = BinaryData.fromString( - "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"hsmtxpsiebtfhvp\",\"sapskr\",\"qmhjjdhtld\"]},\"id\":\"kyzxuutk\",\"name\":\"cwscwsvlx\",\"type\":\"togt\"}") - .toObject(LinkedStorageAccountsResourceInner.class); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.storageAccountIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedStorageAccountsResourceInner model = new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("hsmtxpsiebtfhvp", "sapskr", "qmhjjdhtld")); - model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsResourceInner.class); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.storageAccountIds().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java deleted file mode 100644 index f562a725ec27..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java +++ /dev/null @@ -1,43 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackInner model = BinaryData.fromString( - "{\"properties\":{\"queryPackId\":\"ijbpzvgnwzsymgl\",\"timeCreated\":\"2021-09-05T16:59:27Z\",\"timeModified\":\"2021-02-27T08:20:44Z\",\"provisioningState\":\"ohdbihanufh\"},\"location\":\"cbjy\",\"tags\":{\"xwczbyscnp\":\"ithxqhabifpi\"},\"id\":\"x\",\"name\":\"hiv\",\"type\":\"qniwbybrkxvdumj\"}") - .toObject(LogAnalyticsQueryPackInner.class); - Assertions.assertEquals("cbjy", model.location()); - Assertions.assertEquals("ithxqhabifpi", model.tags().get("xwczbyscnp")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackInner model - = new LogAnalyticsQueryPackInner().withLocation("cbjy").withTags(mapOf("xwczbyscnp", "ithxqhabifpi")); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackInner.class); - Assertions.assertEquals("cbjy", model.location()); - Assertions.assertEquals("ithxqhabifpi", model.tags().get("xwczbyscnp")); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java deleted file mode 100644 index 9bbc678f07ca..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"queryPackId\":\"hq\",\"timeCreated\":\"2021-08-01T15:29:09Z\",\"timeModified\":\"2021-10-26T10:24:19Z\",\"provisioningState\":\"ybczmehmtzo\"},\"location\":\"bsphrupidgsybbe\",\"tags\":{\"xaobhdxbmtqioqjz\":\"hoycm\"},\"id\":\"htbmuf\",\"name\":\"ownoizhw\",\"type\":\"rxybqsoq\"},{\"properties\":{\"queryPackId\":\"gkdmb\",\"timeCreated\":\"2021-12-03T16:46:54Z\",\"timeModified\":\"2021-03-24T06:15:27Z\",\"provisioningState\":\"c\"},\"location\":\"fp\",\"tags\":{\"qqjnqgl\":\"rbt\",\"foooj\":\"qgn\",\"saagdf\":\"wifsq\"},\"id\":\"glzlhjxrifkwmrv\",\"name\":\"tsizntocipaoua\",\"type\":\"psqucmpoyf\"},{\"properties\":{\"queryPackId\":\"fogknygjofjdde\",\"timeCreated\":\"2020-12-22T06:05:56Z\",\"timeModified\":\"2021-06-07T09:35:57Z\",\"provisioningState\":\"pewnw\"},\"location\":\"eitjz\",\"tags\":{\"hs\":\"usarhmofc\",\"xukcdmpar\":\"yurkdtmlxhekuksj\"},\"id\":\"ryuanzwuxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"}],\"nextLink\":\"nryrtihf\"}") - .toObject(LogAnalyticsQueryPackListResult.class); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).location()); - Assertions.assertEquals("hoycm", model.value().get(0).tags().get("xaobhdxbmtqioqjz")); - Assertions.assertEquals("nryrtihf", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackListResult model = new LogAnalyticsQueryPackListResult().withValue(Arrays.asList( - new LogAnalyticsQueryPackInner().withLocation("bsphrupidgsybbe") - .withTags(mapOf("xaobhdxbmtqioqjz", "hoycm")), - new LogAnalyticsQueryPackInner().withLocation("fp") - .withTags(mapOf("qqjnqgl", "rbt", "foooj", "qgn", "saagdf", "wifsq")), - new LogAnalyticsQueryPackInner().withLocation("eitjz") - .withTags(mapOf("hs", "usarhmofc", "xukcdmpar", "yurkdtmlxhekuksj")))) - .withNextLink("nryrtihf"); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackListResult.class); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).location()); - Assertions.assertEquals("hoycm", model.value().get(0).tags().get("xaobhdxbmtqioqjz")); - Assertions.assertEquals("nryrtihf", model.nextLink()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java deleted file mode 100644 index 0083d9b1c802..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackProperties; - -public final class LogAnalyticsQueryPackPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackProperties model = BinaryData.fromString( - "{\"queryPackId\":\"tfwvukxgaudc\",\"timeCreated\":\"2021-06-07T10:34:36Z\",\"timeModified\":\"2021-03-15T16:07:05Z\",\"provisioningState\":\"cnyejhkryhtnapcz\"}") - .toObject(LogAnalyticsQueryPackProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackProperties model = new LogAnalyticsQueryPackProperties(); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackProperties.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java deleted file mode 100644 index 06a46115ccdf..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java +++ /dev/null @@ -1,61 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackQueryInner; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackQueryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackQueryInner model = BinaryData.fromString( - "{\"properties\":{\"id\":\"qwpgrjbzn\",\"displayName\":\"rcjxvsnbyxqabn\",\"timeCreated\":\"2021-06-16T16:14:14Z\",\"timeModified\":\"2020-12-28T20:56:17Z\",\"author\":\"shurzafbljjgpbto\",\"description\":\"jmkljavbqidtqajz\",\"body\":\"ulpkudjkrl\",\"related\":{\"categories\":[\"hfepgzgqex\"],\"resourceTypes\":[\"c\",\"scpai\",\"rhhbcs\",\"l\"],\"solutions\":[\"a\",\"tjaodxobnb\"]},\"tags\":{\"mexgstxgcp\":[\"pxokajionp\"]},\"properties\":\"datagmaajrm\"},\"id\":\"jwzrl\",\"name\":\"mcl\",\"type\":\"ijcoejctb\"}") - .toObject(LogAnalyticsQueryPackQueryInner.class); - Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); - Assertions.assertEquals("jmkljavbqidtqajz", model.description()); - Assertions.assertEquals("ulpkudjkrl", model.body()); - Assertions.assertEquals("hfepgzgqex", model.related().categories().get(0)); - Assertions.assertEquals("c", model.related().resourceTypes().get(0)); - Assertions.assertEquals("a", model.related().solutions().get(0)); - Assertions.assertEquals("pxokajionp", model.tags().get("mexgstxgcp").get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryInner model = new LogAnalyticsQueryPackQueryInner().withDisplayName("rcjxvsnbyxqabn") - .withDescription("jmkljavbqidtqajz") - .withBody("ulpkudjkrl") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("hfepgzgqex")) - .withResourceTypes(Arrays.asList("c", "scpai", "rhhbcs", "l")) - .withSolutions(Arrays.asList("a", "tjaodxobnb"))) - .withTags(mapOf("mexgstxgcp", Arrays.asList("pxokajionp"))) - .withProperties("datagmaajrm"); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryInner.class); - Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); - Assertions.assertEquals("jmkljavbqidtqajz", model.description()); - Assertions.assertEquals("ulpkudjkrl", model.body()); - Assertions.assertEquals("hfepgzgqex", model.related().categories().get(0)); - Assertions.assertEquals("c", model.related().resourceTypes().get(0)); - Assertions.assertEquals("a", model.related().solutions().get(0)); - Assertions.assertEquals("pxokajionp", model.tags().get("mexgstxgcp").get(0)); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java deleted file mode 100644 index bdf11fd483c3..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java +++ /dev/null @@ -1,94 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackQueryInner; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryListResult; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackQueryListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackQueryListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"id\":\"yhuybbkpod\",\"displayName\":\"po\",\"timeCreated\":\"2021-05-29T14:24:22Z\",\"timeModified\":\"2021-09-25T10:25:19Z\",\"author\":\"amiheognarxz\",\"description\":\"heotusiv\",\"body\":\"evcciqihnhun\",\"related\":{\"categories\":[\"zrnf\",\"gxg\"],\"resourceTypes\":[\"emv\",\"zfkufubljofx\",\"eofjaeqjh\",\"jbasvmsmjqulngs\"],\"solutions\":[\"bybkzgcwrwclxx\",\"rljdouskcqv\",\"ocrcjdk\",\"tnhxbn\"]},\"tags\":{\"yqduujit\":[\"sqrglssainq\",\"jwnzlljfmp\",\"eebvmgxsab\"],\"nhutjeltmrldhugj\":[\"czdzev\",\"dhkrwpdappdsbdk\",\"wrwjfeu\"]},\"properties\":\"datadatqxhocdgeabl\"},\"id\":\"huticndvkao\",\"name\":\"yiftyhxhuro\",\"type\":\"tyxolniwpwc\"},{\"properties\":{\"id\":\"kgiawxklryplwck\",\"displayName\":\"asy\",\"timeCreated\":\"2021-10-21T22:29:11Z\",\"timeModified\":\"2021-07-26T02:42:45Z\",\"author\":\"sgcbac\",\"description\":\"ejk\",\"body\":\"tynqgoul\",\"related\":{\"categories\":[\"i\",\"wyqkgfgibm\",\"dgak\"],\"resourceTypes\":[\"rxybz\"],\"solutions\":[\"dqytbciqfouflmm\"]},\"tags\":{\"spwgcuertumkdosv\":[\"modmglougpb\",\"wtmutduq\",\"ta\"]},\"properties\":\"datahbmdgbbjfdd\"},\"id\":\"bmbexppbhtqqro\",\"name\":\"p\",\"type\":\"s\"},{\"properties\":{\"id\":\"qux\",\"displayName\":\"gjyjgzjaoyfhrtxi\",\"timeCreated\":\"2021-04-23T04:18:15Z\",\"timeModified\":\"2021-08-05T02:52:01Z\",\"author\":\"jysvl\",\"description\":\"uvfqawrlyxwj\",\"body\":\"cpr\",\"related\":{\"categories\":[\"xgjvtbv\"],\"resourceTypes\":[\"szdnr\",\"jq\"],\"solutions\":[\"muouqfp\",\"wzwbnguitn\",\"uizga\",\"x\"]},\"tags\":{\"idf\":[\"uckyf\",\"hr\"],\"pvkmijcmmxdcuf\":[\"wdzuhtymwisd\",\"fthwxmnteiwa\"],\"dwzjeiach\":[\"srp\",\"mzidnsezcxtb\",\"sgfyccsnew\"],\"pyqr\":[\"osfln\",\"osfqpteehzzv\"]},\"properties\":\"dataz\"},\"id\":\"pvswjdkirso\",\"name\":\"qxhcrmn\",\"type\":\"jtckwhdso\"}],\"nextLink\":\"yip\"}") - .toObject(LogAnalyticsQueryPackQueryListResult.class); - Assertions.assertEquals("po", model.value().get(0).displayName()); - Assertions.assertEquals("heotusiv", model.value().get(0).description()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).body()); - Assertions.assertEquals("zrnf", model.value().get(0).related().categories().get(0)); - Assertions.assertEquals("emv", model.value().get(0).related().resourceTypes().get(0)); - Assertions.assertEquals("bybkzgcwrwclxx", model.value().get(0).related().solutions().get(0)); - Assertions.assertEquals("sqrglssainq", model.value().get(0).tags().get("yqduujit").get(0)); - Assertions.assertEquals("yip", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryListResult model - = new LogAnalyticsQueryPackQueryListResult() - .withValue( - Arrays - .asList( - new LogAnalyticsQueryPackQueryInner().withDisplayName("po") - .withDescription("heotusiv") - .withBody("evcciqihnhun") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("zrnf", "gxg")) - .withResourceTypes( - Arrays.asList("emv", "zfkufubljofx", "eofjaeqjh", "jbasvmsmjqulngs")) - .withSolutions(Arrays.asList("bybkzgcwrwclxx", "rljdouskcqv", "ocrcjdk", "tnhxbn"))) - .withTags(mapOf("yqduujit", Arrays.asList("sqrglssainq", "jwnzlljfmp", "eebvmgxsab"), - "nhutjeltmrldhugj", Arrays.asList("czdzev", "dhkrwpdappdsbdk", "wrwjfeu"))) - .withProperties("datadatqxhocdgeabl"), - new LogAnalyticsQueryPackQueryInner().withDisplayName("asy") - .withDescription("ejk") - .withBody("tynqgoul") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("i", "wyqkgfgibm", "dgak")) - .withResourceTypes(Arrays.asList("rxybz")) - .withSolutions(Arrays.asList("dqytbciqfouflmm"))) - .withTags(mapOf("spwgcuertumkdosv", Arrays.asList("modmglougpb", "wtmutduq", "ta"))) - .withProperties("datahbmdgbbjfdd"), - new LogAnalyticsQueryPackQueryInner().withDisplayName("gjyjgzjaoyfhrtxi") - .withDescription("uvfqawrlyxwj") - .withBody("cpr") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("xgjvtbv")) - .withResourceTypes(Arrays.asList("szdnr", "jq")) - .withSolutions(Arrays.asList("muouqfp", "wzwbnguitn", "uizga", "x"))) - .withTags(mapOf("idf", Arrays.asList("uckyf", "hr"), "pvkmijcmmxdcuf", - Arrays.asList("wdzuhtymwisd", "fthwxmnteiwa"), "dwzjeiach", - Arrays.asList("srp", "mzidnsezcxtb", "sgfyccsnew"), "pyqr", - Arrays.asList("osfln", "osfqpteehzzv"))) - .withProperties("dataz"))) - .withNextLink("yip"); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryListResult.class); - Assertions.assertEquals("po", model.value().get(0).displayName()); - Assertions.assertEquals("heotusiv", model.value().get(0).description()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).body()); - Assertions.assertEquals("zrnf", model.value().get(0).related().categories().get(0)); - Assertions.assertEquals("emv", model.value().get(0).related().resourceTypes().get(0)); - Assertions.assertEquals("bybkzgcwrwclxx", model.value().get(0).related().solutions().get(0)); - Assertions.assertEquals("sqrglssainq", model.value().get(0).tags().get("yqduujit").get(0)); - Assertions.assertEquals("yip", model.nextLink()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java deleted file mode 100644 index 5f1816304495..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackQueryPropertiesRelatedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackQueryPropertiesRelated model = BinaryData.fromString( - "{\"categories\":[\"tthzrvqd\"],\"resourceTypes\":[\"hjybigehoqfbo\"],\"solutions\":[\"anyktzlcuiywg\",\"ywgndrv\",\"nhzgpphrcgyn\",\"ocpecfvmmco\"]}") - .toObject(LogAnalyticsQueryPackQueryPropertiesRelated.class); - Assertions.assertEquals("tthzrvqd", model.categories().get(0)); - Assertions.assertEquals("hjybigehoqfbo", model.resourceTypes().get(0)); - Assertions.assertEquals("anyktzlcuiywg", model.solutions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryPropertiesRelated model - = new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("tthzrvqd")) - .withResourceTypes(Arrays.asList("hjybigehoqfbo")) - .withSolutions(Arrays.asList("anyktzlcuiywg", "ywgndrv", "nhzgpphrcgyn", "ocpecfvmmco")); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryPropertiesRelated.class); - Assertions.assertEquals("tthzrvqd", model.categories().get(0)); - Assertions.assertEquals("hjybigehoqfbo", model.resourceTypes().get(0)); - Assertions.assertEquals("anyktzlcuiywg", model.solutions().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java deleted file mode 100644 index be3ea54f5034..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java +++ /dev/null @@ -1,63 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackQueryProperties; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackQueryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackQueryProperties model = BinaryData.fromString( - "{\"id\":\"s\",\"displayName\":\"sycbkbfk\",\"timeCreated\":\"2021-04-13T09:52:22Z\",\"timeModified\":\"2021-02-11T20:09:09Z\",\"author\":\"xxppofm\",\"description\":\"x\",\"body\":\"fjpgddtocjjxhvp\",\"related\":{\"categories\":[\"xhdzxibqeojnx\"],\"resourceTypes\":[\"vddntwn\",\"eic\",\"twnpzaoqvuhrhcf\",\"cyddglmjthjqk\"],\"solutions\":[\"eicxmqciwqvhkhi\",\"uigdtopbobjog\",\"m\",\"w\"]},\"tags\":{\"gvdfgiotkftutq\":[\"uhrzayvvt\"]},\"properties\":\"datangxlefgugnxkrxdq\"}") - .toObject(LogAnalyticsQueryPackQueryProperties.class); - Assertions.assertEquals("sycbkbfk", model.displayName()); - Assertions.assertEquals("x", model.description()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.body()); - Assertions.assertEquals("xhdzxibqeojnx", model.related().categories().get(0)); - Assertions.assertEquals("vddntwn", model.related().resourceTypes().get(0)); - Assertions.assertEquals("eicxmqciwqvhkhi", model.related().solutions().get(0)); - Assertions.assertEquals("uhrzayvvt", model.tags().get("gvdfgiotkftutq").get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryProperties model - = new LogAnalyticsQueryPackQueryProperties().withDisplayName("sycbkbfk") - .withDescription("x") - .withBody("fjpgddtocjjxhvp") - .withRelated( - new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("xhdzxibqeojnx")) - .withResourceTypes(Arrays.asList("vddntwn", "eic", "twnpzaoqvuhrhcf", "cyddglmjthjqk")) - .withSolutions(Arrays.asList("eicxmqciwqvhkhi", "uigdtopbobjog", "m", "w"))) - .withTags(mapOf("gvdfgiotkftutq", Arrays.asList("uhrzayvvt"))) - .withProperties("datangxlefgugnxkrxdq"); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryProperties.class); - Assertions.assertEquals("sycbkbfk", model.displayName()); - Assertions.assertEquals("x", model.description()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.body()); - Assertions.assertEquals("xhdzxibqeojnx", model.related().categories().get(0)); - Assertions.assertEquals("vddntwn", model.related().resourceTypes().get(0)); - Assertions.assertEquals("eicxmqciwqvhkhi", model.related().solutions().get(0)); - Assertions.assertEquals("uhrzayvvt", model.tags().get("gvdfgiotkftutq").get(0)); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java deleted file mode 100644 index c39cfaf402d7..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackQuerySearchPropertiesRelated model = BinaryData.fromString( - "{\"categories\":[\"owgujjugwdkcglhs\"],\"resourceTypes\":[\"jdyggdtji\"],\"solutions\":[\"kuofqweykhme\"]}") - .toObject(LogAnalyticsQueryPackQuerySearchPropertiesRelated.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.categories().get(0)); - Assertions.assertEquals("jdyggdtji", model.resourceTypes().get(0)); - Assertions.assertEquals("kuofqweykhme", model.solutions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackQuerySearchPropertiesRelated model - = new LogAnalyticsQueryPackQuerySearchPropertiesRelated().withCategories(Arrays.asList("owgujjugwdkcglhs")) - .withResourceTypes(Arrays.asList("jdyggdtji")) - .withSolutions(Arrays.asList("kuofqweykhme")); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQuerySearchPropertiesRelated.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.categories().get(0)); - Assertions.assertEquals("jdyggdtji", model.resourceTypes().get(0)); - Assertions.assertEquals("kuofqweykhme", model.solutions().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java deleted file mode 100644 index 71d88a2658ff..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java +++ /dev/null @@ -1,55 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchProperties; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class LogAnalyticsQueryPackQuerySearchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsQueryPackQuerySearchProperties model = BinaryData.fromString( - "{\"related\":{\"categories\":[\"c\",\"wnfnbacf\",\"onlebxetqgtzxdpn\",\"bqqwxrj\"],\"resourceTypes\":[\"llnwsubi\"],\"solutions\":[\"ampmngnz\",\"c\",\"aqw\",\"ochcbonqvpkvl\"]},\"tags\":{\"enjbdlwtgrhp\":[\"ea\",\"eipheoflokeyy\"],\"masxazjpqyegu\":[\"pj\"],\"cftadeh\":[\"hb\",\"xhejjzzvdud\",\"wdslfhotwmcy\",\"pwlbjnpg\"],\"xdn\":[\"ltyfsop\",\"usue\",\"nzwdejba\",\"orxzdmohctbqvud\"]}}") - .toObject(LogAnalyticsQueryPackQuerySearchProperties.class); - Assertions.assertEquals("c", model.related().categories().get(0)); - Assertions.assertEquals("llnwsubi", model.related().resourceTypes().get(0)); - Assertions.assertEquals("ampmngnz", model.related().solutions().get(0)); - Assertions.assertEquals("ea", model.tags().get("enjbdlwtgrhp").get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsQueryPackQuerySearchProperties model = new LogAnalyticsQueryPackQuerySearchProperties() - .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() - .withCategories(Arrays.asList("c", "wnfnbacf", "onlebxetqgtzxdpn", "bqqwxrj")) - .withResourceTypes(Arrays.asList("llnwsubi")) - .withSolutions(Arrays.asList("ampmngnz", "c", "aqw", "ochcbonqvpkvl"))) - .withTags(mapOf("enjbdlwtgrhp", Arrays.asList("ea", "eipheoflokeyy"), "masxazjpqyegu", Arrays.asList("pj"), - "cftadeh", Arrays.asList("hb", "xhejjzzvdud", "wdslfhotwmcy", "pwlbjnpg"), "xdn", - Arrays.asList("ltyfsop", "usue", "nzwdejba", "orxzdmohctbqvud"))); - model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQuerySearchProperties.class); - Assertions.assertEquals("c", model.related().categories().get(0)); - Assertions.assertEquals("llnwsubi", model.related().resourceTypes().get(0)); - Assertions.assertEquals("ampmngnz", model.related().solutions().get(0)); - Assertions.assertEquals("ea", model.tags().get("enjbdlwtgrhp").get(0)); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 1120c66992dd..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,44 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; -import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.loganalytics.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"be80a829-4e64-42e8-8144-39a2107e6f7c\",\"tenantId\":\"b2f99afe-ea18-409c-8c3e-b8c6b30c667e\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"y\":{\"principalId\":\"c2094247-fc23-44d9-b2fb-e5752b134ff0\",\"clientId\":\"4d837673-32af-4936-b1b8-c1678c46ffd8\"},\"atdooaojkniod\":{\"principalId\":\"a4d2535b-4098-4a09-b1e0-60b30476302d\",\"clientId\":\"07b997ea-ecde-461d-a172-5a10933b8c37\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("y", new UserAssignedIdentity(), "atdooaojkniod", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java deleted file mode 100644 index 64509598976a..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java +++ /dev/null @@ -1,48 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.ManagementGroupInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ManagementGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagementGroupInner model = BinaryData.fromString( - "{\"properties\":{\"serverCount\":903805755,\"isGateway\":true,\"name\":\"y\",\"id\":\"klwndnhjdauwhv\",\"created\":\"2021-04-27T11:03:59Z\",\"dataReceived\":\"2021-08-28T16:11:31Z\",\"version\":\"dhxujznbmpo\",\"sku\":\"wpr\"}}") - .toObject(ManagementGroupInner.class); - Assertions.assertEquals(903805755, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("klwndnhjdauwhv", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T16:11:31Z"), model.dataReceived()); - Assertions.assertEquals("dhxujznbmpo", model.version()); - Assertions.assertEquals("wpr", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagementGroupInner model = new ManagementGroupInner().withServerCount(903805755) - .withIsGateway(true) - .withName("y") - .withId("klwndnhjdauwhv") - .withCreated(OffsetDateTime.parse("2021-04-27T11:03:59Z")) - .withDataReceived(OffsetDateTime.parse("2021-08-28T16:11:31Z")) - .withVersion("dhxujznbmpo") - .withSku("wpr"); - model = BinaryData.fromObject(model).toObject(ManagementGroupInner.class); - Assertions.assertEquals(903805755, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("klwndnhjdauwhv", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T16:11:31Z"), model.dataReceived()); - Assertions.assertEquals("dhxujznbmpo", model.version()); - Assertions.assertEquals("wpr", model.sku()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java deleted file mode 100644 index a0b72ac3c800..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java +++ /dev/null @@ -1,48 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.ManagementGroupProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ManagementGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagementGroupProperties model = BinaryData.fromString( - "{\"serverCount\":741975656,\"isGateway\":true,\"name\":\"alupjm\",\"id\":\"fxobbcsws\",\"created\":\"2021-04-25T18:58:37Z\",\"dataReceived\":\"2021-09-18T23:40:57Z\",\"version\":\"lrbpbewtghfgbl\",\"sku\":\"wxzvlvqhjkb\"}") - .toObject(ManagementGroupProperties.class); - Assertions.assertEquals(741975656, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("alupjm", model.name()); - Assertions.assertEquals("fxobbcsws", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T18:58:37Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T23:40:57Z"), model.dataReceived()); - Assertions.assertEquals("lrbpbewtghfgbl", model.version()); - Assertions.assertEquals("wxzvlvqhjkb", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagementGroupProperties model = new ManagementGroupProperties().withServerCount(741975656) - .withIsGateway(true) - .withName("alupjm") - .withId("fxobbcsws") - .withCreated(OffsetDateTime.parse("2021-04-25T18:58:37Z")) - .withDataReceived(OffsetDateTime.parse("2021-09-18T23:40:57Z")) - .withVersion("lrbpbewtghfgbl") - .withSku("wxzvlvqhjkb"); - model = BinaryData.fromObject(model).toObject(ManagementGroupProperties.class); - Assertions.assertEquals(741975656, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("alupjm", model.name()); - Assertions.assertEquals("fxobbcsws", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T18:58:37Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T23:40:57Z"), model.dataReceived()); - Assertions.assertEquals("lrbpbewtghfgbl", model.version()); - Assertions.assertEquals("wxzvlvqhjkb", model.sku()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java deleted file mode 100644 index accd55f70333..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java +++ /dev/null @@ -1,47 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.ManagementGroup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagementGroupsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"serverCount\":1980561633,\"isGateway\":false,\"name\":\"tcjuahokqto\",\"id\":\"auxofshfph\",\"created\":\"2021-08-16T03:23:29Z\",\"dataReceived\":\"2021-07-09T19:35:04Z\",\"version\":\"iywzejy\",\"sku\":\"slwkojpl\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.managementGroups().list("taboidvmf", "hppubowsepdfgkmt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(1980561633, response.iterator().next().serverCount()); - Assertions.assertEquals(false, response.iterator().next().isGateway()); - Assertions.assertEquals("tcjuahokqto", response.iterator().next().name()); - Assertions.assertEquals("auxofshfph", response.iterator().next().id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T03:23:29Z"), response.iterator().next().created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-09T19:35:04Z"), - response.iterator().next().dataReceived()); - Assertions.assertEquals("iywzejy", response.iterator().next().version()); - Assertions.assertEquals("slwkojpl", response.iterator().next().sku()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java deleted file mode 100644 index ba8915de7029..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java +++ /dev/null @@ -1,27 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.MetricName; -import org.junit.jupiter.api.Assertions; - -public final class MetricNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricName model = BinaryData.fromString("{\"value\":\"gdtpnapnyiro\",\"localizedValue\":\"hpigv\"}") - .toObject(MetricName.class); - Assertions.assertEquals("gdtpnapnyiro", model.value()); - Assertions.assertEquals("hpigv", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricName model = new MetricName().withValue("gdtpnapnyiro").withLocalizedValue("hpigv"); - model = BinaryData.fromObject(model).toObject(MetricName.class); - Assertions.assertEquals("gdtpnapnyiro", model.value()); - Assertions.assertEquals("hpigv", model.localizedValue()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java deleted file mode 100644 index 658596d1c0f9..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java +++ /dev/null @@ -1,35 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"znqntoru\",\"resource\":\"gsahmkycgrauw\",\"operation\":\"etaebu\",\"description\":\"vdmovsmzlxwabm\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("znqntoru", model.provider()); - Assertions.assertEquals("gsahmkycgrauw", model.resource()); - Assertions.assertEquals("etaebu", model.operation()); - Assertions.assertEquals("vdmovsmzlxwabm", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("znqntoru") - .withResource("gsahmkycgrauw") - .withOperation("etaebu") - .withDescription("vdmovsmzlxwabm"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("znqntoru", model.provider()); - Assertions.assertEquals("gsahmkycgrauw", model.resource()); - Assertions.assertEquals("etaebu", model.operation()); - Assertions.assertEquals("vdmovsmzlxwabm", model.description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java deleted file mode 100644 index 0c58020760f3..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java +++ /dev/null @@ -1,39 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.OperationInner; -import com.azure.resourcemanager.loganalytics.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"vxb\",\"display\":{\"provider\":\"udutnco\",\"resource\":\"r\",\"operation\":\"qtvcofudflvkgj\",\"description\":\"gdknnqv\"}}") - .toObject(OperationInner.class); - Assertions.assertEquals("vxb", model.name()); - Assertions.assertEquals("udutnco", model.display().provider()); - Assertions.assertEquals("r", model.display().resource()); - Assertions.assertEquals("qtvcofudflvkgj", model.display().operation()); - Assertions.assertEquals("gdknnqv", model.display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("vxb") - .withDisplay(new OperationDisplay().withProvider("udutnco") - .withResource("r") - .withOperation("qtvcofudflvkgj") - .withDescription("gdknnqv")); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("vxb", model.name()); - Assertions.assertEquals("udutnco", model.display().provider()); - Assertions.assertEquals("r", model.display().resource()); - Assertions.assertEquals("qtvcofudflvkgj", model.display().operation()); - Assertions.assertEquals("gdknnqv", model.display().description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java deleted file mode 100644 index c98a9d19a474..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java +++ /dev/null @@ -1,42 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.OperationInner; -import com.azure.resourcemanager.loganalytics.models.OperationDisplay; -import com.azure.resourcemanager.loganalytics.models.OperationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"xzfe\",\"display\":{\"provider\":\"ppriol\",\"resource\":\"rjaltolmncw\",\"operation\":\"bqwcsdbnwdcf\",\"description\":\"cqdpfuv\"}}],\"nextLink\":\"sbjjc\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("xzfe", model.value().get(0).name()); - Assertions.assertEquals("ppriol", model.value().get(0).display().provider()); - Assertions.assertEquals("rjaltolmncw", model.value().get(0).display().resource()); - Assertions.assertEquals("bqwcsdbnwdcf", model.value().get(0).display().operation()); - Assertions.assertEquals("cqdpfuv", model.value().get(0).display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model - = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("xzfe") - .withDisplay(new OperationDisplay().withProvider("ppriol") - .withResource("rjaltolmncw") - .withOperation("bqwcsdbnwdcf") - .withDescription("cqdpfuv")))); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("xzfe", model.value().get(0).name()); - Assertions.assertEquals("ppriol", model.value().get(0).display().provider()); - Assertions.assertEquals("rjaltolmncw", model.value().get(0).display().resource()); - Assertions.assertEquals("bqwcsdbnwdcf", model.value().get(0).display().operation()); - Assertions.assertEquals("cqdpfuv", model.value().get(0).display().description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java deleted file mode 100644 index 3afabcdaf67d..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java +++ /dev/null @@ -1,42 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"xkykxdssjp\",\"display\":{\"provider\":\"ucfx\",\"resource\":\"kkflrmymyincqlhr\",\"operation\":\"wslmiiiovgqcg\",\"description\":\"ugqkctotiowlxteq\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xkykxdssjp", response.iterator().next().name()); - Assertions.assertEquals("ucfx", response.iterator().next().display().provider()); - Assertions.assertEquals("kkflrmymyincqlhr", response.iterator().next().display().resource()); - Assertions.assertEquals("wslmiiiovgqcg", response.iterator().next().display().operation()); - Assertions.assertEquals("ugqkctotiowlxteq", response.iterator().next().display().description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java deleted file mode 100644 index 653f54965b40..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java +++ /dev/null @@ -1,29 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkScopedResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkScopedResource model - = BinaryData.fromString("{\"resourceId\":\"iakp\",\"scopeId\":\"qqmtedltmmji\"}") - .toObject(PrivateLinkScopedResource.class); - Assertions.assertEquals("iakp", model.resourceId()); - Assertions.assertEquals("qqmtedltmmji", model.scopeId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkScopedResource model - = new PrivateLinkScopedResource().withResourceId("iakp").withScopeId("qqmtedltmmji"); - model = BinaryData.fromObject(model).toObject(PrivateLinkScopedResource.class); - Assertions.assertEquals("iakp", model.resourceId()); - Assertions.assertEquals("qqmtedltmmji", model.scopeId()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java deleted file mode 100644 index 24e1bf1eae46..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueriesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.queries().deleteWithResponse("jdfqwmkyoqufdvr", "zslzojhp", "tfnmdx", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java deleted file mode 100644 index 1eee646bd614..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueriesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"id\":\"woycqucwyha\",\"displayName\":\"nomdrkywuhpsv\",\"timeCreated\":\"2021-05-26T05:35:58Z\",\"timeModified\":\"2021-01-31T05:51:43Z\",\"author\":\"lwexxwl\",\"description\":\"niexzsrzpgepq\",\"body\":\"yb\",\"related\":{\"categories\":[\"gdakchz\",\"vl\",\"xqnrkcxk\"],\"resourceTypes\":[\"nxm\"],\"solutions\":[\"xs\",\"qrntv\",\"wijpsttexoqqpwc\"]},\"tags\":{\"ndy\":[\"mhruncuwm\",\"spkcdqzh\",\"ctddun\"],\"boxjumvq\":[\"chrqb\",\"jjrcgegydc\"]},\"properties\":\"datalihrraiouaubr\"},\"id\":\"loqxfuojrngif\",\"name\":\"z\",\"type\":\"sccbiuimzd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LogAnalyticsQueryPackQuery response = manager.queries() - .getWithResponse("cqpbtuo", "xesz", "bbelawumuaslzk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("nomdrkywuhpsv", response.displayName()); - Assertions.assertEquals("niexzsrzpgepq", response.description()); - Assertions.assertEquals("yb", response.body()); - Assertions.assertEquals("gdakchz", response.related().categories().get(0)); - Assertions.assertEquals("nxm", response.related().resourceTypes().get(0)); - Assertions.assertEquals("xs", response.related().solutions().get(0)); - Assertions.assertEquals("mhruncuwm", response.tags().get("ndy").get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java deleted file mode 100644 index cebe44dbb225..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java +++ /dev/null @@ -1,45 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueriesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"id\":\"rcxfailcfxwmdb\",\"displayName\":\"xdfgsftufqobr\",\"timeCreated\":\"2021-06-10T09:16:23Z\",\"timeModified\":\"2021-07-03T04:16:46Z\",\"author\":\"cc\",\"description\":\"nhxk\",\"body\":\"zvytnrzvuljraaer\",\"related\":{\"categories\":[\"qgukkjqnv\"],\"resourceTypes\":[\"ylaxxulcdi\",\"dosfjbjsvgjrw\"],\"solutions\":[\"vyc\",\"t\",\"c\",\"xgccknfnw\"]},\"tags\":{\"z\":[\"vpdvjdhttzae\",\"edxihchrphkmcrj\",\"qnsdfzpbgtgky\",\"kdghrjeuutlwx\"],\"oajvgcxtxjcs\":[\"hokvbwnh\",\"tqlgehgppi\",\"ifhpf\"],\"q\":[\"afidltugsres\",\"kssjhoiftxfk\",\"wegprh\",\"tillucbiqtg\"]},\"properties\":\"datamcwsldrizetpwb\"},\"id\":\"lllibph\",\"name\":\"zmizakakan\",\"type\":\"p\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.queries() - .list("vodhtn", "irudh", 522814180418790552L, false, "sckdlp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xdfgsftufqobr", response.iterator().next().displayName()); - Assertions.assertEquals("nhxk", response.iterator().next().description()); - Assertions.assertEquals("zvytnrzvuljraaer", response.iterator().next().body()); - Assertions.assertEquals("qgukkjqnv", response.iterator().next().related().categories().get(0)); - Assertions.assertEquals("ylaxxulcdi", response.iterator().next().related().resourceTypes().get(0)); - Assertions.assertEquals("vyc", response.iterator().next().related().solutions().get(0)); - Assertions.assertEquals("vpdvjdhttzae", response.iterator().next().tags().get("z").get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java deleted file mode 100644 index a5166c94e183..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java +++ /dev/null @@ -1,70 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueriesPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"id\":\"gcmjkavl\",\"displayName\":\"or\",\"timeCreated\":\"2021-09-10T10:34:34Z\",\"timeModified\":\"2021-06-02T13:00:05Z\",\"author\":\"dtzfjltfvnzcy\",\"description\":\"otp\",\"body\":\"opv\",\"related\":{\"categories\":[\"zq\",\"qqihedsvqwthmk\"],\"resourceTypes\":[\"cysihs\",\"qcwdhoh\"],\"solutions\":[\"mcdzsufcohdxbz\",\"mcmuapc\",\"hdbevwqqxeyskon\"]},\"tags\":{\"ezrxcczurtleipqx\":[\"kfkbgbzbowxeqocl\",\"mygvkzqkj\",\"eokbze\"],\"nzvdfbzdixzmq\":[\"wvz\"],\"bostzel\":[\"odawopqhewjptmcg\"]},\"properties\":\"datala\"},\"id\":\"tmzlbiojlv\",\"name\":\"rbbpneqvcwwyy\",\"type\":\"mochpprprsnmok\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LogAnalyticsQueryPackQuery response = manager.queries() - .define("absnmfpp") - .withExistingQueryPack("tngfdgugeyzihgr", "yui") - .withTags(mapOf("asiibmiybnnust", Arrays.asList("gh", "iypoqeyhlqhykprl", "yznuciqd", "mexiitdfuxt"))) - .withDisplayName("yhsgz") - .withDescription("glqgleoh") - .withBody("betnluankrrfxee") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("j")) - .withResourceTypes(Arrays.asList("vbmqzbqq", "lajrnwxacevehj")) - .withSolutions(Arrays.asList("xoafgaoqltfae", "linmfgv"))) - .withProperties("dataljhnmgixhcmav") - .create(); - - Assertions.assertEquals("or", response.displayName()); - Assertions.assertEquals("otp", response.description()); - Assertions.assertEquals("opv", response.body()); - Assertions.assertEquals("zq", response.related().categories().get(0)); - Assertions.assertEquals("cysihs", response.related().resourceTypes().get(0)); - Assertions.assertEquals("mcdzsufcohdxbz", response.related().solutions().get(0)); - Assertions.assertEquals("kfkbgbzbowxeqocl", response.tags().get("ezrxcczurtleipqx").get(0)); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java deleted file mode 100644 index 92aa6353046f..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java +++ /dev/null @@ -1,71 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchProperties; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueriesSearchMockTests { - @Test - public void testSearch() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"id\":\"heioqa\",\"displayName\":\"hvseufuqyrx\",\"timeCreated\":\"2021-03-18T00:27:23Z\",\"timeModified\":\"2020-12-31T00:49:04Z\",\"author\":\"lsismjqfrd\",\"description\":\"amqu\",\"body\":\"iosrsjuivfcdis\",\"related\":{\"categories\":[\"xzhczexrxz\",\"ujrtrhqvwr\"],\"resourceTypes\":[\"h\"],\"solutions\":[\"nzonzl\",\"piqywnc\",\"jtszcof\",\"zehtdhgb\"]},\"tags\":{\"bccxjmonfdgn\":[\"eljeamurvzmlovua\",\"ashcxlpmjerbdk\",\"lvidizozs\"],\"uqj\":[\"cypuuwwlt\"]},\"properties\":\"datazenkeifzzhmkd\"},\"id\":\"vflyhbxcu\",\"name\":\"hxgsrboldfor\",\"type\":\"wjlvizbfhfov\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.queries() - .search("jzhajoy", "hjlmu", - new LogAnalyticsQueryPackQuerySearchProperties() - .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() - .withCategories(Arrays.asList("rimrs", "pteecjme")) - .withResourceTypes(Arrays.asList("stvasylwxdzaumw")) - .withSolutions(Arrays.asList("hguuf", "zboyjathwt"))) - .withTags(mapOf("mwmdxmebwjscjpa", Arrays.asList("a"), "ekpndzaapmudq", - Arrays.asList("xveabf", "xnmwmqtibxyijddt", "qcttadijaeukmrsi"), "e", - Arrays.asList("qwigpibudqwyxe"))), - 5927921282145979607L, true, "zznrtffyaqi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hvseufuqyrx", response.iterator().next().displayName()); - Assertions.assertEquals("amqu", response.iterator().next().description()); - Assertions.assertEquals("iosrsjuivfcdis", response.iterator().next().body()); - Assertions.assertEquals("xzhczexrxz", response.iterator().next().related().categories().get(0)); - Assertions.assertEquals("h", response.iterator().next().related().resourceTypes().get(0)); - Assertions.assertEquals("nzonzl", response.iterator().next().related().solutions().get(0)); - Assertions.assertEquals("eljeamurvzmlovua", response.iterator().next().tags().get("bccxjmonfdgn").get(0)); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 5d446e46190b..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,57 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueryPacksCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"queryPackId\":\"nlsvxeiz\",\"timeCreated\":\"2021-09-15T09:10:38Z\",\"timeModified\":\"2021-10-15T15:15:24Z\",\"provisioningState\":\"srmffeycxcktpiym\"},\"location\":\"rteeamm\",\"tags\":{\"rtkgdojbmxvavref\":\"ekkkzd\",\"jpxtxsuwprtuj\":\"eesvecu\",\"itvtzeexavo\":\"sawddjibabxvi\",\"dmdqb\":\"tfgle\"},\"id\":\"pypqtgsfj\",\"name\":\"cbslhhx\",\"type\":\"db\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LogAnalyticsQueryPack response = manager.queryPacks() - .define("vbkbxgomf") - .withRegion("zkgimsid") - .withExistingResourceGroup("nsymoyqhlwigd") - .withTags(mapOf("hpqgatjeaahhvj", "icddyvvjskgfmocw", "jjidjk", "hnakzyb")) - .create(); - - Assertions.assertEquals("rteeamm", response.location()); - Assertions.assertEquals("ekkkzd", response.tags().get("rtkgdojbmxvavref")); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java deleted file mode 100644 index 5805a5f8e9f9..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java +++ /dev/null @@ -1,57 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests { - @Test - public void testCreateOrUpdateWithoutNameWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"queryPackId\":\"xukuqgsj\",\"timeCreated\":\"2021-08-01T00:57:39Z\",\"timeModified\":\"2021-06-29T21:31:03Z\",\"provisioningState\":\"gketwzhhzjhf\"},\"location\":\"mhv\",\"tags\":{\"qsxvmhf\":\"vgpmun\"},\"id\":\"uzjyihsasbhudypo\",\"name\":\"yue\",\"type\":\"slynsqyrpfoo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LogAnalyticsQueryPack response = manager.queryPacks() - .createOrUpdateWithoutNameWithResponse("fiwrxgkn", - new LogAnalyticsQueryPackInner().withLocation("gzdjtxvzf").withTags(mapOf("aqvlgafcqusr", "v")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("mhv", response.location()); - Assertions.assertEquals("vgpmun", response.tags().get("qsxvmhf")); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 5db48519b0d3..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,35 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueryPacksDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.queryPacks() - .deleteByResourceGroupWithResponse("rlttymsjnygqdnfw", "zdzgtilaxhnfhqly", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 4635a85ab2c9..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,40 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueryPacksGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"queryPackId\":\"pgclrciv\",\"timeCreated\":\"2021-01-12T06:52:04Z\",\"timeModified\":\"2020-12-22T20:01:29Z\",\"provisioningState\":\"kenx\"},\"location\":\"m\",\"tags\":{\"oqvm\":\"frpmpdnqqskaw\"},\"id\":\"bnpqfrtqlkzme\",\"name\":\"nitgvkxlz\",\"type\":\"qdrfegcealzxwhc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LogAnalyticsQueryPack response = manager.queryPacks() - .getByResourceGroupWithResponse("ijouwivkxoyzunb", "xxrtikvc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("m", response.location()); - Assertions.assertEquals("frpmpdnqqskaw", response.tags().get("oqvm")); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java deleted file mode 100644 index 0e8fd6299f34..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java +++ /dev/null @@ -1,40 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueryPacksListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"queryPackId\":\"aomylwea\",\"timeCreated\":\"2021-12-02T19:30Z\",\"timeModified\":\"2021-02-22T04:35:52Z\",\"provisioningState\":\"thwwn\"},\"location\":\"jhlfzswpchwahf\",\"tags\":{\"ncxykxhdjhlimm\":\"snfepgfewetwlyx\",\"cjzhqi\":\"cxfhbcporxv\",\"ftjuh\":\"xfpxtgqscja\"},\"id\":\"qaz\",\"name\":\"mtggu\",\"type\":\"pijrajcivmmghf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.queryPacks().listByResourceGroup("oaimlnw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jhlfzswpchwahf", response.iterator().next().location()); - Assertions.assertEquals("snfepgfewetwlyx", response.iterator().next().tags().get("ncxykxhdjhlimm")); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java deleted file mode 100644 index e80c92f3388b..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java +++ /dev/null @@ -1,39 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QueryPacksListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"queryPackId\":\"pkxztmoobkl\",\"timeCreated\":\"2021-05-25T12:15:23Z\",\"timeModified\":\"2021-09-03T03:39:31Z\",\"provisioningState\":\"cwq\"},\"location\":\"pimaqxzhemjyh\",\"tags\":{\"lkb\":\"jswtwkozzwc\"},\"id\":\"wpfaj\",\"name\":\"jwltlwtjjgu\",\"type\":\"talhsnvkcdmxzr\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.queryPacks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pimaqxzhemjyh", response.iterator().next().location()); - Assertions.assertEquals("jswtwkozzwc", response.iterator().next().tags().get("lkb")); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java deleted file mode 100644 index 7bb9c15f45e0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java +++ /dev/null @@ -1,44 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.QueryPacksResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class QueryPacksResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueryPacksResource model = BinaryData.fromString( - "{\"location\":\"lokjyemkk\",\"tags\":{\"ejspodmail\":\"pjoxzjnch\",\"yahux\":\"ydehoj\",\"vcputegj\":\"npmqnjaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"id\":\"odjpslwejd\",\"name\":\"vwryoqpso\",\"type\":\"cctazakljlahbc\"}") - .toObject(QueryPacksResource.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryPacksResource model = new QueryPacksResource().withLocation("lokjyemkk") - .withTags(mapOf("ejspodmail", "pjoxzjnch", "yahux", "ydehoj", "vcputegj", "npmqnjaqwixjspro", - "uuvmkjozkrwfnd", "wmfdatscmdvpjhul")); - model = BinaryData.fromObject(model).toObject(QueryPacksResource.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java deleted file mode 100644 index b37076c3ed16..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.RestoredLogs; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class RestoredLogsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RestoredLogs model = BinaryData.fromString( - "{\"startRestoreTime\":\"2021-08-18T12:02:08Z\",\"endRestoreTime\":\"2021-10-23T03:32:09Z\",\"sourceTable\":\"zydvfvf\",\"azureAsyncOperationId\":\"naeo\"}") - .toObject(RestoredLogs.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T12:02:08Z"), model.startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T03:32:09Z"), model.endRestoreTime()); - Assertions.assertEquals("zydvfvf", model.sourceTable()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RestoredLogs model = new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-08-18T12:02:08Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-10-23T03:32:09Z")) - .withSourceTable("zydvfvf"); - model = BinaryData.fromObject(model).toObject(RestoredLogs.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T12:02:08Z"), model.startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T03:32:09Z"), model.endRestoreTime()); - Assertions.assertEquals("zydvfvf", model.sourceTable()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java deleted file mode 100644 index e9b3a05e3a98..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.ResultStatistics; - -public final class ResultStatisticsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResultStatistics model - = BinaryData.fromString("{\"progress\":40.47698,\"ingestedRecords\":1226403170,\"scannedGb\":23.974842}") - .toObject(ResultStatistics.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResultStatistics model = new ResultStatistics(); - model = BinaryData.fromObject(model).toObject(ResultStatistics.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java deleted file mode 100644 index f3d67547b9b4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java +++ /dev/null @@ -1,51 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchInner; -import com.azure.resourcemanager.loganalytics.models.Tag; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SavedSearchInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SavedSearchInner model = BinaryData.fromString( - "{\"etag\":\"xc\",\"properties\":{\"category\":\"sbfov\",\"displayName\":\"srruvwbhsqfsubcg\",\"query\":\"birx\",\"functionAlias\":\"ybsrfbjfdtwss\",\"functionParameters\":\"ftpvjzbexil\",\"version\":8368126717708512338,\"tags\":[{\"name\":\"nvwpmqtaruouj\",\"value\":\"kcjhwqytjrybnwj\"}]},\"id\":\"wgdrjervnaenqp\",\"name\":\"hin\",\"type\":\"oygmift\"}") - .toObject(SavedSearchInner.class); - Assertions.assertEquals("xc", model.etag()); - Assertions.assertEquals("sbfov", model.category()); - Assertions.assertEquals("srruvwbhsqfsubcg", model.displayName()); - Assertions.assertEquals("birx", model.query()); - Assertions.assertEquals("ybsrfbjfdtwss", model.functionAlias()); - Assertions.assertEquals("ftpvjzbexil", model.functionParameters()); - Assertions.assertEquals(8368126717708512338L, model.version()); - Assertions.assertEquals("nvwpmqtaruouj", model.tags().get(0).name()); - Assertions.assertEquals("kcjhwqytjrybnwj", model.tags().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SavedSearchInner model = new SavedSearchInner().withEtag("xc") - .withCategory("sbfov") - .withDisplayName("srruvwbhsqfsubcg") - .withQuery("birx") - .withFunctionAlias("ybsrfbjfdtwss") - .withFunctionParameters("ftpvjzbexil") - .withVersion(8368126717708512338L) - .withTags(Arrays.asList(new Tag().withName("nvwpmqtaruouj").withValue("kcjhwqytjrybnwj"))); - model = BinaryData.fromObject(model).toObject(SavedSearchInner.class); - Assertions.assertEquals("xc", model.etag()); - Assertions.assertEquals("sbfov", model.category()); - Assertions.assertEquals("srruvwbhsqfsubcg", model.displayName()); - Assertions.assertEquals("birx", model.query()); - Assertions.assertEquals("ybsrfbjfdtwss", model.functionAlias()); - Assertions.assertEquals("ftpvjzbexil", model.functionParameters()); - Assertions.assertEquals(8368126717708512338L, model.version()); - Assertions.assertEquals("nvwpmqtaruouj", model.tags().get(0).name()); - Assertions.assertEquals("kcjhwqytjrybnwj", model.tags().get(0).value()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java deleted file mode 100644 index 48746c228292..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java +++ /dev/null @@ -1,50 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchProperties; -import com.azure.resourcemanager.loganalytics.models.Tag; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SavedSearchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SavedSearchProperties model = BinaryData.fromString( - "{\"category\":\"nzdndslgna\",\"displayName\":\"qig\",\"query\":\"nduhavhqlkthum\",\"functionAlias\":\"olbgycduiertgccy\",\"functionParameters\":\"aolps\",\"version\":1053709421770726696,\"tags\":[{\"name\":\"mdnbbglzpswiy\",\"value\":\"mcwyhzdxssadb\"},{\"name\":\"mnvdfzn\",\"value\":\"daodvxzbncblyl\"},{\"name\":\"stdbhhxsrzdzu\",\"value\":\"erscdntne\"}]}") - .toObject(SavedSearchProperties.class); - Assertions.assertEquals("nzdndslgna", model.category()); - Assertions.assertEquals("qig", model.displayName()); - Assertions.assertEquals("nduhavhqlkthum", model.query()); - Assertions.assertEquals("olbgycduiertgccy", model.functionAlias()); - Assertions.assertEquals("aolps", model.functionParameters()); - Assertions.assertEquals(1053709421770726696L, model.version()); - Assertions.assertEquals("mdnbbglzpswiy", model.tags().get(0).name()); - Assertions.assertEquals("mcwyhzdxssadb", model.tags().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SavedSearchProperties model = new SavedSearchProperties().withCategory("nzdndslgna") - .withDisplayName("qig") - .withQuery("nduhavhqlkthum") - .withFunctionAlias("olbgycduiertgccy") - .withFunctionParameters("aolps") - .withVersion(1053709421770726696L) - .withTags(Arrays.asList(new Tag().withName("mdnbbglzpswiy").withValue("mcwyhzdxssadb"), - new Tag().withName("mnvdfzn").withValue("daodvxzbncblyl"), - new Tag().withName("stdbhhxsrzdzu").withValue("erscdntne"))); - model = BinaryData.fromObject(model).toObject(SavedSearchProperties.class); - Assertions.assertEquals("nzdndslgna", model.category()); - Assertions.assertEquals("qig", model.displayName()); - Assertions.assertEquals("nduhavhqlkthum", model.query()); - Assertions.assertEquals("olbgycduiertgccy", model.functionAlias()); - Assertions.assertEquals("aolps", model.functionParameters()); - Assertions.assertEquals(1053709421770726696L, model.version()); - Assertions.assertEquals("mdnbbglzpswiy", model.tags().get(0).name()); - Assertions.assertEquals("mcwyhzdxssadb", model.tags().get(0).value()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 7cb0ef1ba341..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,59 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.SavedSearch; -import com.azure.resourcemanager.loganalytics.models.Tag; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SavedSearchesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"refqy\",\"properties\":{\"category\":\"qotoihiqakydiwfb\",\"displayName\":\"kwpzdqtvh\",\"query\":\"spodaqax\",\"functionAlias\":\"pie\",\"functionParameters\":\"bebjfu\",\"version\":8153035996823274813,\"tags\":[{\"name\":\"h\",\"value\":\"lpnfpubntnb\"},{\"name\":\"tzviqsowsaaelcat\",\"value\":\"cjuhplrvkm\"},{\"name\":\"cwmjvlg\",\"value\":\"ggcvk\"}]},\"id\":\"y\",\"name\":\"izrzb\",\"type\":\"psfxsf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SavedSearch response = manager.savedSearches() - .define("ikcyyc") - .withExistingWorkspace("khlowkxxpv", "rdfjmzsyzfhotl") - .withCategory("hv") - .withDisplayName("uic") - .withQuery("hvtrrmhwrbfdpyf") - .withTags(Arrays.asList(new Tag().withName("ooclutnp").withValue("memczjkmmyk"), - new Tag().withName("ujxsglhsr").withValue("rye"))) - .withEtag("nsjlpjrtws") - .withFunctionAlias("bhvjglr") - .withFunctionParameters("uyzlw") - .withVersion(5515716031108163936L) - .create(); - - Assertions.assertEquals("refqy", response.etag()); - Assertions.assertEquals("qotoihiqakydiwfb", response.category()); - Assertions.assertEquals("kwpzdqtvh", response.displayName()); - Assertions.assertEquals("spodaqax", response.query()); - Assertions.assertEquals("pie", response.functionAlias()); - Assertions.assertEquals("bebjfu", response.functionParameters()); - Assertions.assertEquals(8153035996823274813L, response.version()); - Assertions.assertEquals("h", response.tags().get(0).name()); - Assertions.assertEquals("lpnfpubntnb", response.tags().get(0).value()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java deleted file mode 100644 index 75719dae958f..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SavedSearchesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.savedSearches() - .deleteWithResponse("fcsserxhtvsox", "lwntsjgqrs", "y", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java deleted file mode 100644 index c8563f46f382..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java +++ /dev/null @@ -1,47 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.SavedSearch; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SavedSearchesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"gm\",\"properties\":{\"category\":\"rwahzjmucftbyr\",\"displayName\":\"lrohkpig\",\"query\":\"fusuckzmkwklsno\",\"functionAlias\":\"xmqeqalh\",\"functionParameters\":\"nhg\",\"version\":2571955917130233939,\"tags\":[{\"name\":\"fsvkhgbvqtanarfd\",\"value\":\"pukhpyrne\"},{\"name\":\"zjcpeogk\",\"value\":\"nmg\"}]},\"id\":\"ro\",\"name\":\"xddbhfhpfpaz\",\"type\":\"zoyw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SavedSearch response = manager.savedSearches() - .getWithResponse("ruuuybnch", "szizoyuelyetndnb", "qyggagfl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gm", response.etag()); - Assertions.assertEquals("rwahzjmucftbyr", response.category()); - Assertions.assertEquals("lrohkpig", response.displayName()); - Assertions.assertEquals("fusuckzmkwklsno", response.query()); - Assertions.assertEquals("xmqeqalh", response.functionAlias()); - Assertions.assertEquals("nhg", response.functionParameters()); - Assertions.assertEquals(2571955917130233939L, response.version()); - Assertions.assertEquals("fsvkhgbvqtanarfd", response.tags().get(0).name()); - Assertions.assertEquals("pukhpyrne", response.tags().get(0).value()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java deleted file mode 100644 index 3ab8a59de174..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java +++ /dev/null @@ -1,47 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.SavedSearchesListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SavedSearchesListByWorkspaceWithResponseMockTests { - @Test - public void testListByWorkspaceWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"xh\",\"properties\":{\"category\":\"sd\",\"displayName\":\"ugwbsreurfqkf\",\"query\":\"arenlvhhtklnvnaf\",\"functionAlias\":\"kyfede\",\"functionParameters\":\"bo\",\"version\":5433915956599731708,\"tags\":[{\"name\":\"p\",\"value\":\"kkhminqcymczngn\"}]},\"id\":\"dxxewuninv\",\"name\":\"db\",\"type\":\"h\"},{\"etag\":\"dtvqe\",\"properties\":{\"category\":\"rqctmxxdtdd\",\"displayName\":\"flhuytxzv\",\"query\":\"zna\",\"functionAlias\":\"bannovvoxczytp\",\"functionParameters\":\"nwvroevytlyokrr\",\"version\":4414369503729973449,\"tags\":[{\"name\":\"nsa\",\"value\":\"bcrymodizrx\"},{\"name\":\"lobdxna\",\"value\":\"pmkmlmvevfx\"},{\"name\":\"op\",\"value\":\"hbzxli\"},{\"name\":\"hrdd\",\"value\":\"tfgxqbawpcb\"}]},\"id\":\"nzqcy\",\"name\":\"napqo\",\"type\":\"yuicdhzbdy\"},{\"etag\":\"wgbdvibidmhmwffp\",\"properties\":{\"category\":\"fmuvapckccr\",\"displayName\":\"vwe\",\"query\":\"oxoyyukp\",\"functionAlias\":\"immoiroqboshbrag\",\"functionParameters\":\"yyrmfsvbp\",\"version\":3531624930963004551,\"tags\":[{\"name\":\"ppdbwnupgahxkum\",\"value\":\"sjcaacfdmmcpugm\"},{\"name\":\"hqepvufhbzehewh\",\"value\":\"qhnlbqnbld\"}]},\"id\":\"eaclgschorimk\",\"name\":\"srrm\",\"type\":\"ucsofldpuviyf\"},{\"etag\":\"abeolhbhlvbm\",\"properties\":{\"category\":\"uqibsxtkcu\",\"displayName\":\"fbsfarfsiow\",\"query\":\"kjxnqpvwgfstmhq\",\"functionAlias\":\"izmdksa\",\"functionParameters\":\"fcluqvo\",\"version\":8904305259908062937,\"tags\":[{\"name\":\"mr\",\"value\":\"vwg\"}]},\"id\":\"wwpbmzgwesyd\",\"name\":\"xwefohecbvopwndy\",\"type\":\"leallklm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SavedSearchesListResult response = manager.savedSearches() - .listByWorkspaceWithResponse("xhpdulontacnpqwt", "htuevrhrljy", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xh", response.value().get(0).etag()); - Assertions.assertEquals("sd", response.value().get(0).category()); - Assertions.assertEquals("ugwbsreurfqkf", response.value().get(0).displayName()); - Assertions.assertEquals("arenlvhhtklnvnaf", response.value().get(0).query()); - Assertions.assertEquals("kyfede", response.value().get(0).functionAlias()); - Assertions.assertEquals("bo", response.value().get(0).functionParameters()); - Assertions.assertEquals(5433915956599731708L, response.value().get(0).version()); - Assertions.assertEquals("p", response.value().get(0).tags().get(0).name()); - Assertions.assertEquals("kkhminqcymczngn", response.value().get(0).tags().get(0).value()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java deleted file mode 100644 index ba62da5bddc0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java +++ /dev/null @@ -1,83 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchInner; -import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchesListResultInner; -import com.azure.resourcemanager.loganalytics.models.Tag; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SavedSearchesListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SavedSearchesListResultInner model = BinaryData.fromString( - "{\"value\":[{\"etag\":\"abnetshh\",\"properties\":{\"category\":\"zhedplvwiw\",\"displayName\":\"bmwmbesldnkw\",\"query\":\"tppjflcx\",\"functionAlias\":\"aokonzmnsik\",\"functionParameters\":\"kqze\",\"version\":4891735483783264620,\"tags\":[{\"name\":\"fzxmhhvhgureodkw\",\"value\":\"bdagxt\"}]},\"id\":\"bqdxbx\",\"name\":\"akbogqxndlkzgxh\",\"type\":\"ripl\"},{\"etag\":\"odxun\",\"properties\":{\"category\":\"bebxmubyyntwl\",\"displayName\":\"bqtkoievseotgqr\",\"query\":\"ltmuwlauwzizx\",\"functionAlias\":\"pgcjefuzmuvp\",\"functionParameters\":\"tdum\",\"version\":411911013999749991,\"tags\":[{\"name\":\"bmnzbtbhjpgl\",\"value\":\"fgohdneuelfphs\"},{\"name\":\"yhtozfikdowwqu\",\"value\":\"v\"},{\"name\":\"zx\",\"value\":\"lvithhqzonosgg\"},{\"name\":\"hcohfwdsjnk\",\"value\":\"ljuti\"}]},\"id\":\"swacffgdkzz\",\"name\":\"wkfvhqcrailvp\",\"type\":\"ppfufl\"},{\"etag\":\"dmhdlxyjr\",\"properties\":{\"category\":\"sag\",\"displayName\":\"fcnihgwq\",\"query\":\"pnedgf\",\"functionAlias\":\"vkcvqvpkeqd\",\"functionParameters\":\"drhvoodsotbo\",\"version\":596884672630210595,\"tags\":[{\"name\":\"j\",\"value\":\"vnhdldwmgxcxr\"},{\"name\":\"lpmutwuoegrpkhj\",\"value\":\"niyqslui\"}]},\"id\":\"pdggkzzlvm\",\"name\":\"mpaxmodfvuefywsb\",\"type\":\"fvmwy\"},{\"etag\":\"fouyf\",\"properties\":{\"category\":\"aakc\",\"displayName\":\"wiyzvqtmnubexkp\",\"query\":\"ksmond\",\"functionAlias\":\"quxvypomgkop\",\"functionParameters\":\"hojvpajqgxysmocm\",\"version\":3563158574762399534,\"tags\":[{\"name\":\"kcxozapvhelx\",\"value\":\"rgly\"},{\"name\":\"tddckcb\",\"value\":\"uejrjxgc\"},{\"name\":\"qibrhosxsdqrhzoy\",\"value\":\"i\"}]},\"id\":\"m\",\"name\":\"qyib\",\"type\":\"hwflu\"}]}") - .toObject(SavedSearchesListResultInner.class); - Assertions.assertEquals("abnetshh", model.value().get(0).etag()); - Assertions.assertEquals("zhedplvwiw", model.value().get(0).category()); - Assertions.assertEquals("bmwmbesldnkw", model.value().get(0).displayName()); - Assertions.assertEquals("tppjflcx", model.value().get(0).query()); - Assertions.assertEquals("aokonzmnsik", model.value().get(0).functionAlias()); - Assertions.assertEquals("kqze", model.value().get(0).functionParameters()); - Assertions.assertEquals(4891735483783264620L, model.value().get(0).version()); - Assertions.assertEquals("fzxmhhvhgureodkw", model.value().get(0).tags().get(0).name()); - Assertions.assertEquals("bdagxt", model.value().get(0).tags().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SavedSearchesListResultInner model = new SavedSearchesListResultInner().withValue(Arrays.asList( - new SavedSearchInner().withEtag("abnetshh") - .withCategory("zhedplvwiw") - .withDisplayName("bmwmbesldnkw") - .withQuery("tppjflcx") - .withFunctionAlias("aokonzmnsik") - .withFunctionParameters("kqze") - .withVersion(4891735483783264620L) - .withTags(Arrays.asList(new Tag().withName("fzxmhhvhgureodkw").withValue("bdagxt"))), - new SavedSearchInner().withEtag("odxun") - .withCategory("bebxmubyyntwl") - .withDisplayName("bqtkoievseotgqr") - .withQuery("ltmuwlauwzizx") - .withFunctionAlias("pgcjefuzmuvp") - .withFunctionParameters("tdum") - .withVersion(411911013999749991L) - .withTags(Arrays.asList(new Tag().withName("bmnzbtbhjpgl").withValue("fgohdneuelfphs"), - new Tag().withName("yhtozfikdowwqu").withValue("v"), - new Tag().withName("zx").withValue("lvithhqzonosgg"), - new Tag().withName("hcohfwdsjnk").withValue("ljuti"))), - new SavedSearchInner().withEtag("dmhdlxyjr") - .withCategory("sag") - .withDisplayName("fcnihgwq") - .withQuery("pnedgf") - .withFunctionAlias("vkcvqvpkeqd") - .withFunctionParameters("drhvoodsotbo") - .withVersion(596884672630210595L) - .withTags(Arrays.asList(new Tag().withName("j").withValue("vnhdldwmgxcxr"), - new Tag().withName("lpmutwuoegrpkhj").withValue("niyqslui"))), - new SavedSearchInner().withEtag("fouyf") - .withCategory("aakc") - .withDisplayName("wiyzvqtmnubexkp") - .withQuery("ksmond") - .withFunctionAlias("quxvypomgkop") - .withFunctionParameters("hojvpajqgxysmocm") - .withVersion(3563158574762399534L) - .withTags(Arrays.asList(new Tag().withName("kcxozapvhelx").withValue("rgly"), - new Tag().withName("tddckcb").withValue("uejrjxgc"), - new Tag().withName("qibrhosxsdqrhzoy").withValue("i"))))); - model = BinaryData.fromObject(model).toObject(SavedSearchesListResultInner.class); - Assertions.assertEquals("abnetshh", model.value().get(0).etag()); - Assertions.assertEquals("zhedplvwiw", model.value().get(0).category()); - Assertions.assertEquals("bmwmbesldnkw", model.value().get(0).displayName()); - Assertions.assertEquals("tppjflcx", model.value().get(0).query()); - Assertions.assertEquals("aokonzmnsik", model.value().get(0).functionAlias()); - Assertions.assertEquals("kqze", model.value().get(0).functionParameters()); - Assertions.assertEquals(4891735483783264620L, model.value().get(0).version()); - Assertions.assertEquals("fzxmhhvhgureodkw", model.value().get(0).tags().get(0).name()); - Assertions.assertEquals("bdagxt", model.value().get(0).tags().get(0).value()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java deleted file mode 100644 index 4b0668991e30..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java +++ /dev/null @@ -1,57 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.Column; -import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import com.azure.resourcemanager.loganalytics.models.Schema; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Schema model = BinaryData.fromString( - "{\"name\":\"r\",\"displayName\":\"ukiscvwmzhw\",\"description\":\"efaxvxilc\",\"columns\":[{\"name\":\"hnze\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"fzqlqhycavod\",\"description\":\"xdbeesmieknl\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"wiuagydwqf\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"giagtcojo\",\"description\":\"wogfnzjvu\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"uxylfsbtkadpy\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"gkbugrjqct\",\"description\":\"cmisofie\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"yqdhcuplcplcw\",\"type\":\"int\",\"dataTypeHint\":\"armPath\",\"displayName\":\"lhzdsqtzb\",\"description\":\"gnowcjhfgmveca\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"teyowclu\",\"type\":\"real\",\"dataTypeHint\":\"guid\",\"displayName\":\"vgqouwifzmpj\",\"description\":\"ivqikfxcvhr\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"grttikteusqczk\",\"type\":\"real\",\"dataTypeHint\":\"ip\",\"displayName\":\"byjaffmmf\",\"description\":\"cqc\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"categories\":[\"rtalmet\"],\"labels\":[\"gdslqxihhrmoo\",\"z\"],\"source\":\"customer\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"cxa\",\"zhyrpeto\",\"e\",\"joxslhvnhla\"]}") - .toObject(Schema.class); - Assertions.assertEquals("r", model.name()); - Assertions.assertEquals("ukiscvwmzhw", model.displayName()); - Assertions.assertEquals("efaxvxilc", model.description()); - Assertions.assertEquals("hnze", model.columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.GUID, model.columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.IP, model.columns().get(0).dataTypeHint()); - Assertions.assertEquals("fzqlqhycavod", model.columns().get(0).displayName()); - Assertions.assertEquals("xdbeesmieknl", model.columns().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Schema model = new Schema().withName("r") - .withDisplayName("ukiscvwmzhw") - .withDescription("efaxvxilc") - .withColumns(Arrays.asList( - new Column().withName("hnze") - .withType(ColumnTypeEnum.GUID) - .withDataTypeHint(ColumnDataTypeHintEnum.IP) - .withDisplayName("fzqlqhycavod") - .withDescription("xdbeesmieknl"), - new Column().withName("wiuagydwqf") - .withType(ColumnTypeEnum.INT) - .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("giagtcojo") - .withDescription("wogfnzjvu"))); - model = BinaryData.fromObject(model).toObject(Schema.class); - Assertions.assertEquals("r", model.name()); - Assertions.assertEquals("ukiscvwmzhw", model.displayName()); - Assertions.assertEquals("efaxvxilc", model.description()); - Assertions.assertEquals("hnze", model.columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.GUID, model.columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.IP, model.columns().get(0).dataTypeHint()); - Assertions.assertEquals("fzqlqhycavod", model.columns().get(0).displayName()); - Assertions.assertEquals("xdbeesmieknl", model.columns().get(0).description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java deleted file mode 100644 index 8116903943b4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java +++ /dev/null @@ -1,65 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.SearchGetSchemaResponse; -import com.azure.resourcemanager.loganalytics.models.SearchSortEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"metadata\":{\"requestId\":\"lg\",\"resultType\":\"txd\",\"total\":7982443333722102241,\"top\":2221953429879798985,\"id\":\"zvlnsnnjz\",\"coreSummaries\":[{\"status\":\"olpy\",\"numberOfDocuments\":117086894031994632},{\"status\":\"xqzragp\",\"numberOfDocuments\":5124334742263421163},{\"status\":\"t\",\"numberOfDocuments\":5064204054792112038},{\"status\":\"a\",\"numberOfDocuments\":1817616718311848555}],\"status\":\"jchcsrlzknmzla\",\"startTime\":\"2021-01-20T21:47:05Z\",\"lastUpdated\":\"2021-11-08T10:57:25Z\",\"eTag\":\"vnphc\",\"sort\":[{\"name\":\"pjhmqrhvthl\",\"order\":\"desc\"}],\"requestTime\":1106480050332233961,\"aggregatedValueField\":\"mlzzhzdtxetlgyd\",\"aggregatedGroupingFields\":\"qvlnnpxybafiqgea\",\"sum\":3246800772078835427,\"max\":7730272397217059241,\"schema\":{\"name\":\"klbyulidwcw\",\"version\":1795651624}},\"value\":[{\"name\":\"o\",\"displayName\":\"hj\",\"type\":\"wgdnqzbr\",\"indexed\":true,\"stored\":true,\"facet\":false,\"ownerType\":[\"zmtksjci\",\"digsxcdgl\"]}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SearchGetSchemaResponse response - = manager.schemas().getWithResponse("cdxfzzzwyjafitl", "guyn", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("lg", response.metadata().searchId()); - Assertions.assertEquals("txd", response.metadata().resultType()); - Assertions.assertEquals(7982443333722102241L, response.metadata().total()); - Assertions.assertEquals(2221953429879798985L, response.metadata().top()); - Assertions.assertEquals("zvlnsnnjz", response.metadata().id()); - Assertions.assertEquals("olpy", response.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(117086894031994632L, response.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("jchcsrlzknmzla", response.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T21:47:05Z"), response.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-08T10:57:25Z"), response.metadata().lastUpdated()); - Assertions.assertEquals("vnphc", response.metadata().etag()); - Assertions.assertEquals("pjhmqrhvthl", response.metadata().sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.DESC, response.metadata().sort().get(0).order()); - Assertions.assertEquals(1106480050332233961L, response.metadata().requestTime()); - Assertions.assertEquals("mlzzhzdtxetlgyd", response.metadata().aggregatedValueField()); - Assertions.assertEquals("qvlnnpxybafiqgea", response.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(3246800772078835427L, response.metadata().sum()); - Assertions.assertEquals(7730272397217059241L, response.metadata().max()); - Assertions.assertEquals("klbyulidwcw", response.metadata().schema().name()); - Assertions.assertEquals(1795651624, response.metadata().schema().version()); - Assertions.assertEquals("o", response.value().get(0).name()); - Assertions.assertEquals("hj", response.value().get(0).displayName()); - Assertions.assertEquals("wgdnqzbr", response.value().get(0).type()); - Assertions.assertEquals(true, response.value().get(0).indexed()); - Assertions.assertEquals(true, response.value().get(0).stored()); - Assertions.assertEquals(false, response.value().get(0).facet()); - Assertions.assertEquals("zmtksjci", response.value().get(0).ownerType().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java deleted file mode 100644 index 216dfe67397e..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java +++ /dev/null @@ -1,138 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.SearchGetSchemaResponseInner; -import com.azure.resourcemanager.loganalytics.models.CoreSummary; -import com.azure.resourcemanager.loganalytics.models.SearchMetadata; -import com.azure.resourcemanager.loganalytics.models.SearchMetadataSchema; -import com.azure.resourcemanager.loganalytics.models.SearchSchemaValue; -import com.azure.resourcemanager.loganalytics.models.SearchSort; -import com.azure.resourcemanager.loganalytics.models.SearchSortEnum; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SearchGetSchemaResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SearchGetSchemaResponseInner model = BinaryData.fromString( - "{\"metadata\":{\"requestId\":\"enwash\",\"resultType\":\"dtkcnqxwbpokulp\",\"total\":4256703090352932350,\"top\":8748295195867506861,\"id\":\"pqiiobyuqe\",\"coreSummaries\":[{\"status\":\"pqwcciuqgbdbutau\",\"numberOfDocuments\":4381546425309848486},{\"status\":\"kuwhh\",\"numberOfDocuments\":8532271889690426142},{\"status\":\"ojoxafnndlp\",\"numberOfDocuments\":3311442512942014453}],\"status\":\"o\",\"startTime\":\"2021-07-02T22:41:48Z\",\"lastUpdated\":\"2021-10-22T11:40:28Z\",\"eTag\":\"h\",\"sort\":[{\"name\":\"pwdreqnovvqf\",\"order\":\"asc\"},{\"name\":\"xywsuws\",\"order\":\"asc\"},{\"name\":\"dsytgadgvr\",\"order\":\"desc\"},{\"name\":\"neqn\",\"order\":\"desc\"}],\"requestTime\":5080605539580294993,\"aggregatedValueField\":\"uu\",\"aggregatedGroupingFields\":\"fqka\",\"sum\":8183486072070109381,\"max\":1237347078053939435,\"schema\":{\"name\":\"bjibwwiftohq\",\"version\":1205462118}},\"value\":[{\"name\":\"sgplsakn\",\"displayName\":\"fsynljphuop\",\"type\":\"dlqiyntorzih\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"w\",\"rmslyzrpzbchckqq\"]},{\"name\":\"ioxiysuiizyn\",\"displayName\":\"dy\",\"type\":\"rwyhqmibzyhwitsm\",\"indexed\":false,\"stored\":true,\"facet\":true,\"ownerType\":[\"cdpu\",\"nzgmwznmabik\"]},{\"name\":\"orgjhxbldt\",\"displayName\":\"wrlkdmtn\",\"type\":\"ok\",\"indexed\":true,\"stored\":false,\"facet\":false,\"ownerType\":[\"yhgsy\"]},{\"name\":\"ogjltdtbnnhad\",\"displayName\":\"crkvcikhnv\",\"type\":\"mqg\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"ik\",\"wggxkallat\"]}]}") - .toObject(SearchGetSchemaResponseInner.class); - Assertions.assertEquals("enwash", model.metadata().searchId()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.metadata().resultType()); - Assertions.assertEquals(4256703090352932350L, model.metadata().total()); - Assertions.assertEquals(8748295195867506861L, model.metadata().top()); - Assertions.assertEquals("pqiiobyuqe", model.metadata().id()); - Assertions.assertEquals("pqwcciuqgbdbutau", model.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(4381546425309848486L, model.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("o", model.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T22:41:48Z"), model.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T11:40:28Z"), model.metadata().lastUpdated()); - Assertions.assertEquals("h", model.metadata().etag()); - Assertions.assertEquals("pwdreqnovvqf", model.metadata().sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.metadata().sort().get(0).order()); - Assertions.assertEquals(5080605539580294993L, model.metadata().requestTime()); - Assertions.assertEquals("uu", model.metadata().aggregatedValueField()); - Assertions.assertEquals("fqka", model.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(8183486072070109381L, model.metadata().sum()); - Assertions.assertEquals(1237347078053939435L, model.metadata().max()); - Assertions.assertEquals("bjibwwiftohq", model.metadata().schema().name()); - Assertions.assertEquals(1205462118, model.metadata().schema().version()); - Assertions.assertEquals("sgplsakn", model.value().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.value().get(0).displayName()); - Assertions.assertEquals("dlqiyntorzih", model.value().get(0).type()); - Assertions.assertEquals(false, model.value().get(0).indexed()); - Assertions.assertEquals(false, model.value().get(0).stored()); - Assertions.assertEquals(false, model.value().get(0).facet()); - Assertions.assertEquals("w", model.value().get(0).ownerType().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SearchGetSchemaResponseInner model = new SearchGetSchemaResponseInner() - .withMetadata(new SearchMetadata().withSearchId("enwash") - .withResultType("dtkcnqxwbpokulp") - .withTotal(4256703090352932350L) - .withTop(8748295195867506861L) - .withId("pqiiobyuqe") - .withCoreSummaries(Arrays.asList( - new CoreSummary().withStatus("pqwcciuqgbdbutau").withNumberOfDocuments(4381546425309848486L), - new CoreSummary().withStatus("kuwhh").withNumberOfDocuments(8532271889690426142L), - new CoreSummary().withStatus("ojoxafnndlp").withNumberOfDocuments(3311442512942014453L))) - .withStatus("o") - .withStartTime(OffsetDateTime.parse("2021-07-02T22:41:48Z")) - .withLastUpdated(OffsetDateTime.parse("2021-10-22T11:40:28Z")) - .withEtag("h") - .withSort(Arrays.asList(new SearchSort().withName("pwdreqnovvqf").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("xywsuws").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("dsytgadgvr").withOrder(SearchSortEnum.DESC), - new SearchSort().withName("neqn").withOrder(SearchSortEnum.DESC))) - .withRequestTime(5080605539580294993L) - .withAggregatedValueField("uu") - .withAggregatedGroupingFields("fqka") - .withSum(8183486072070109381L) - .withMax(1237347078053939435L) - .withSchema(new SearchMetadataSchema().withName("bjibwwiftohq").withVersion(1205462118))) - .withValue(Arrays.asList( - new SearchSchemaValue().withName("sgplsakn") - .withDisplayName("fsynljphuop") - .withType("dlqiyntorzih") - .withIndexed(false) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("w", "rmslyzrpzbchckqq")), - new SearchSchemaValue().withName("ioxiysuiizyn") - .withDisplayName("dy") - .withType("rwyhqmibzyhwitsm") - .withIndexed(false) - .withStored(true) - .withFacet(true) - .withOwnerType(Arrays.asList("cdpu", "nzgmwznmabik")), - new SearchSchemaValue().withName("orgjhxbldt") - .withDisplayName("wrlkdmtn") - .withType("ok") - .withIndexed(true) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("yhgsy")), - new SearchSchemaValue().withName("ogjltdtbnnhad") - .withDisplayName("crkvcikhnv") - .withType("mqg") - .withIndexed(false) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("ik", "wggxkallat")))); - model = BinaryData.fromObject(model).toObject(SearchGetSchemaResponseInner.class); - Assertions.assertEquals("enwash", model.metadata().searchId()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.metadata().resultType()); - Assertions.assertEquals(4256703090352932350L, model.metadata().total()); - Assertions.assertEquals(8748295195867506861L, model.metadata().top()); - Assertions.assertEquals("pqiiobyuqe", model.metadata().id()); - Assertions.assertEquals("pqwcciuqgbdbutau", model.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(4381546425309848486L, model.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("o", model.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T22:41:48Z"), model.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T11:40:28Z"), model.metadata().lastUpdated()); - Assertions.assertEquals("h", model.metadata().etag()); - Assertions.assertEquals("pwdreqnovvqf", model.metadata().sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.metadata().sort().get(0).order()); - Assertions.assertEquals(5080605539580294993L, model.metadata().requestTime()); - Assertions.assertEquals("uu", model.metadata().aggregatedValueField()); - Assertions.assertEquals("fqka", model.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(8183486072070109381L, model.metadata().sum()); - Assertions.assertEquals(1237347078053939435L, model.metadata().max()); - Assertions.assertEquals("bjibwwiftohq", model.metadata().schema().name()); - Assertions.assertEquals(1205462118, model.metadata().schema().version()); - Assertions.assertEquals("sgplsakn", model.value().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.value().get(0).displayName()); - Assertions.assertEquals("dlqiyntorzih", model.value().get(0).type()); - Assertions.assertEquals(false, model.value().get(0).indexed()); - Assertions.assertEquals(false, model.value().get(0).stored()); - Assertions.assertEquals(false, model.value().get(0).facet()); - Assertions.assertEquals("w", model.value().get(0).ownerType().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java deleted file mode 100644 index eb39d2f3c679..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java +++ /dev/null @@ -1,27 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.SearchMetadataSchema; -import org.junit.jupiter.api.Assertions; - -public final class SearchMetadataSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SearchMetadataSchema model = BinaryData.fromString("{\"name\":\"jhwuaanozjos\",\"version\":1082355314}") - .toObject(SearchMetadataSchema.class); - Assertions.assertEquals("jhwuaanozjos", model.name()); - Assertions.assertEquals(1082355314, model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SearchMetadataSchema model = new SearchMetadataSchema().withName("jhwuaanozjos").withVersion(1082355314); - model = BinaryData.fromObject(model).toObject(SearchMetadataSchema.class); - Assertions.assertEquals("jhwuaanozjos", model.name()); - Assertions.assertEquals(1082355314, model.version()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java deleted file mode 100644 index d94203f802ab..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java +++ /dev/null @@ -1,88 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CoreSummary; -import com.azure.resourcemanager.loganalytics.models.SearchMetadata; -import com.azure.resourcemanager.loganalytics.models.SearchMetadataSchema; -import com.azure.resourcemanager.loganalytics.models.SearchSort; -import com.azure.resourcemanager.loganalytics.models.SearchSortEnum; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SearchMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SearchMetadata model = BinaryData.fromString( - "{\"requestId\":\"lwuip\",\"resultType\":\"cjzkzivgvvcna\",\"total\":8913535749004515550,\"top\":5279516661370439683,\"id\":\"mueedndrdvstk\",\"coreSummaries\":[{\"status\":\"chea\",\"numberOfDocuments\":3646125258806158004}],\"status\":\"tdaaygdvwvg\",\"startTime\":\"2021-06-07T06:53:10Z\",\"lastUpdated\":\"2021-10-23T00:12:41Z\",\"eTag\":\"xrtfudxep\",\"sort\":[{\"name\":\"agvrvmnpkuk\",\"order\":\"asc\"},{\"name\":\"dblx\",\"order\":\"desc\"}],\"requestTime\":7611617377471579634,\"aggregatedValueField\":\"hfjx\",\"aggregatedGroupingFields\":\"szkkfoqre\",\"sum\":8338807266312513089,\"max\":2185206310902116436,\"schema\":{\"name\":\"wneaiv\",\"version\":322973840}}") - .toObject(SearchMetadata.class); - Assertions.assertEquals("lwuip", model.searchId()); - Assertions.assertEquals("cjzkzivgvvcna", model.resultType()); - Assertions.assertEquals(8913535749004515550L, model.total()); - Assertions.assertEquals(5279516661370439683L, model.top()); - Assertions.assertEquals("mueedndrdvstk", model.id()); - Assertions.assertEquals("chea", model.coreSummaries().get(0).status()); - Assertions.assertEquals(3646125258806158004L, model.coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("tdaaygdvwvg", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T06:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T00:12:41Z"), model.lastUpdated()); - Assertions.assertEquals("xrtfudxep", model.etag()); - Assertions.assertEquals("agvrvmnpkuk", model.sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.sort().get(0).order()); - Assertions.assertEquals(7611617377471579634L, model.requestTime()); - Assertions.assertEquals("hfjx", model.aggregatedValueField()); - Assertions.assertEquals("szkkfoqre", model.aggregatedGroupingFields()); - Assertions.assertEquals(8338807266312513089L, model.sum()); - Assertions.assertEquals(2185206310902116436L, model.max()); - Assertions.assertEquals("wneaiv", model.schema().name()); - Assertions.assertEquals(322973840, model.schema().version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SearchMetadata model = new SearchMetadata().withSearchId("lwuip") - .withResultType("cjzkzivgvvcna") - .withTotal(8913535749004515550L) - .withTop(5279516661370439683L) - .withId("mueedndrdvstk") - .withCoreSummaries( - Arrays.asList(new CoreSummary().withStatus("chea").withNumberOfDocuments(3646125258806158004L))) - .withStatus("tdaaygdvwvg") - .withStartTime(OffsetDateTime.parse("2021-06-07T06:53:10Z")) - .withLastUpdated(OffsetDateTime.parse("2021-10-23T00:12:41Z")) - .withEtag("xrtfudxep") - .withSort(Arrays.asList(new SearchSort().withName("agvrvmnpkuk").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("dblx").withOrder(SearchSortEnum.DESC))) - .withRequestTime(7611617377471579634L) - .withAggregatedValueField("hfjx") - .withAggregatedGroupingFields("szkkfoqre") - .withSum(8338807266312513089L) - .withMax(2185206310902116436L) - .withSchema(new SearchMetadataSchema().withName("wneaiv").withVersion(322973840)); - model = BinaryData.fromObject(model).toObject(SearchMetadata.class); - Assertions.assertEquals("lwuip", model.searchId()); - Assertions.assertEquals("cjzkzivgvvcna", model.resultType()); - Assertions.assertEquals(8913535749004515550L, model.total()); - Assertions.assertEquals(5279516661370439683L, model.top()); - Assertions.assertEquals("mueedndrdvstk", model.id()); - Assertions.assertEquals("chea", model.coreSummaries().get(0).status()); - Assertions.assertEquals(3646125258806158004L, model.coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("tdaaygdvwvg", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T06:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T00:12:41Z"), model.lastUpdated()); - Assertions.assertEquals("xrtfudxep", model.etag()); - Assertions.assertEquals("agvrvmnpkuk", model.sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.sort().get(0).order()); - Assertions.assertEquals(7611617377471579634L, model.requestTime()); - Assertions.assertEquals("hfjx", model.aggregatedValueField()); - Assertions.assertEquals("szkkfoqre", model.aggregatedGroupingFields()); - Assertions.assertEquals(8338807266312513089L, model.sum()); - Assertions.assertEquals(2185206310902116436L, model.max()); - Assertions.assertEquals("wneaiv", model.schema().name()); - Assertions.assertEquals(322973840, model.schema().version()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java deleted file mode 100644 index ba8ec02b5961..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java +++ /dev/null @@ -1,39 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.SearchResults; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SearchResultsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SearchResults model = BinaryData.fromString( - "{\"query\":\"fffwafqroudaspav\",\"description\":\"hrv\",\"limit\":901509130,\"startSearchTime\":\"2021-12-01T01:47:09Z\",\"endSearchTime\":\"2021-08-09T03:45:34Z\",\"sourceTable\":\"dhcxgkmoy\",\"azureAsyncOperationId\":\"dyuib\"}") - .toObject(SearchResults.class); - Assertions.assertEquals("fffwafqroudaspav", model.query()); - Assertions.assertEquals("hrv", model.description()); - Assertions.assertEquals(901509130, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T01:47:09Z"), model.startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T03:45:34Z"), model.endSearchTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SearchResults model = new SearchResults().withQuery("fffwafqroudaspav") - .withDescription("hrv") - .withLimit(901509130) - .withStartSearchTime(OffsetDateTime.parse("2021-12-01T01:47:09Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-08-09T03:45:34Z")); - model = BinaryData.fromObject(model).toObject(SearchResults.class); - Assertions.assertEquals("fffwafqroudaspav", model.query()); - Assertions.assertEquals("hrv", model.description()); - Assertions.assertEquals(901509130, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T01:47:09Z"), model.startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T03:45:34Z"), model.endSearchTime()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java deleted file mode 100644 index 1dde59a006c6..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java +++ /dev/null @@ -1,45 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.SearchSchemaValue; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SearchSchemaValueTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SearchSchemaValue model = BinaryData.fromString( - "{\"name\":\"ulpjr\",\"displayName\":\"ag\",\"type\":\"vimjwos\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"skfc\",\"tq\",\"miekkezzikhlyfjh\",\"gqggebdunygae\"]}") - .toObject(SearchSchemaValue.class); - Assertions.assertEquals("ulpjr", model.name()); - Assertions.assertEquals("ag", model.displayName()); - Assertions.assertEquals("vimjwos", model.type()); - Assertions.assertEquals(false, model.indexed()); - Assertions.assertEquals(false, model.stored()); - Assertions.assertEquals(false, model.facet()); - Assertions.assertEquals("skfc", model.ownerType().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SearchSchemaValue model = new SearchSchemaValue().withName("ulpjr") - .withDisplayName("ag") - .withType("vimjwos") - .withIndexed(false) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("skfc", "tq", "miekkezzikhlyfjh", "gqggebdunygae")); - model = BinaryData.fromObject(model).toObject(SearchSchemaValue.class); - Assertions.assertEquals("ulpjr", model.name()); - Assertions.assertEquals("ag", model.displayName()); - Assertions.assertEquals("vimjwos", model.type()); - Assertions.assertEquals(false, model.indexed()); - Assertions.assertEquals(false, model.stored()); - Assertions.assertEquals(false, model.facet()); - Assertions.assertEquals("skfc", model.ownerType().get(0)); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java deleted file mode 100644 index 2cdc6d74a93c..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java +++ /dev/null @@ -1,27 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.SearchSort; -import com.azure.resourcemanager.loganalytics.models.SearchSortEnum; -import org.junit.jupiter.api.Assertions; - -public final class SearchSortTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SearchSort model = BinaryData.fromString("{\"name\":\"kl\",\"order\":\"desc\"}").toObject(SearchSort.class); - Assertions.assertEquals("kl", model.name()); - Assertions.assertEquals(SearchSortEnum.DESC, model.order()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SearchSort model = new SearchSort().withName("kl").withOrder(SearchSortEnum.DESC); - model = BinaryData.fromObject(model).toObject(SearchSort.class); - Assertions.assertEquals("kl", model.name()); - Assertions.assertEquals(SearchSortEnum.DESC, model.order()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java deleted file mode 100644 index 655116fd9ba7..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageInsightConfigsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.storageInsightConfigs() - .deleteWithResponse("jjvpilguooqja", "m", "itgueiookjbs", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java deleted file mode 100644 index 6912c6597be4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java +++ /dev/null @@ -1,28 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.StorageInsightState; -import com.azure.resourcemanager.loganalytics.models.StorageInsightStatus; -import org.junit.jupiter.api.Assertions; - -public final class StorageInsightStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageInsightStatus model - = BinaryData.fromString("{\"state\":\"OK\",\"description\":\"n\"}").toObject(StorageInsightStatus.class); - Assertions.assertEquals(StorageInsightState.OK, model.state()); - Assertions.assertEquals("n", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageInsightStatus model = new StorageInsightStatus().withState(StorageInsightState.OK).withDescription("n"); - model = BinaryData.fromObject(model).toObject(StorageInsightStatus.class); - Assertions.assertEquals(StorageInsightState.OK, model.state()); - Assertions.assertEquals("n", model.description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java deleted file mode 100644 index 69d013603667..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java +++ /dev/null @@ -1,43 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CreatedByType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SystemDataAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemDataAutoGenerated model = BinaryData.fromString( - "{\"createdBy\":\"dntwjchrdgo\",\"createdByType\":\"User\",\"createdAt\":\"2021-10-03T14:03:48Z\",\"lastModifiedBy\":\"ctondz\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-02-01T20:04:58Z\"}") - .toObject(SystemDataAutoGenerated.class); - Assertions.assertEquals("dntwjchrdgo", model.createdBy()); - Assertions.assertEquals(CreatedByType.USER, model.createdByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T14:03:48Z"), model.createdAt()); - Assertions.assertEquals("ctondz", model.lastModifiedBy()); - Assertions.assertEquals(CreatedByType.USER, model.lastModifiedByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:04:58Z"), model.lastModifiedAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemDataAutoGenerated model = new SystemDataAutoGenerated().withCreatedBy("dntwjchrdgo") - .withCreatedByType(CreatedByType.USER) - .withCreatedAt(OffsetDateTime.parse("2021-10-03T14:03:48Z")) - .withLastModifiedBy("ctondz") - .withLastModifiedByType(CreatedByType.USER) - .withLastModifiedAt(OffsetDateTime.parse("2021-02-01T20:04:58Z")); - model = BinaryData.fromObject(model).toObject(SystemDataAutoGenerated.class); - Assertions.assertEquals("dntwjchrdgo", model.createdBy()); - Assertions.assertEquals(CreatedByType.USER, model.createdByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T14:03:48Z"), model.createdAt()); - Assertions.assertEquals("ctondz", model.lastModifiedBy()); - Assertions.assertEquals(CreatedByType.USER, model.lastModifiedByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:04:58Z"), model.lastModifiedAt()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java deleted file mode 100644 index cdca0715099d..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java +++ /dev/null @@ -1,95 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; -import com.azure.resourcemanager.loganalytics.models.Column; -import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import com.azure.resourcemanager.loganalytics.models.RestoredLogs; -import com.azure.resourcemanager.loganalytics.models.Schema; -import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TableInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableInner model = BinaryData.fromString( - "{\"properties\":{\"retentionInDays\":744996388,\"totalRetentionInDays\":1739983778,\"archiveRetentionInDays\":1797695866,\"searchResults\":{\"query\":\"vjlfrqtt\",\"description\":\"jlkatnwxy\",\"limit\":2086170636,\"startSearchTime\":\"2021-07-06T16:40:26Z\",\"endSearchTime\":\"2021-05-28T18:08:40Z\",\"sourceTable\":\"fku\",\"azureAsyncOperationId\":\"cxkdmligovi\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-07-15T21:34:15Z\",\"endRestoreTime\":\"2021-12-03T21:08:29Z\",\"sourceTable\":\"oaz\",\"azureAsyncOperationId\":\"u\"},\"resultStatistics\":{\"progress\":46.173687,\"ingestedRecords\":1776042141,\"scannedGb\":38.299255},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"ybfhjxa\",\"schema\":{\"name\":\"jgslordilmyww\",\"displayName\":\"gkxnyedabg\",\"description\":\"udtjuewbc\",\"columns\":[{\"name\":\"uwhcjyxccybv\",\"type\":\"int\",\"dataTypeHint\":\"guid\",\"displayName\":\"udzpxgwjplmagstc\",\"description\":\"hpfkyrkdbdgi\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"nwqjnoba\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"iacegfnmn\",\"description\":\"pmvmemfnczdwvv\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"hpodbzev\",\"type\":\"long\",\"dataTypeHint\":\"uri\",\"displayName\":\"ukuv\",\"description\":\"cswsmystul\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"vlerchpqbmfpjba\",\"type\":\"dynamic\",\"dataTypeHint\":\"ip\",\"displayName\":\"xsspuunnoxyhk\",\"description\":\"qddrihpfhoqcaae\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jvlpjxxkzbr\",\"type\":\"guid\",\"dataTypeHint\":\"guid\",\"displayName\":\"siykzkdncjdxonbz\",\"description\":\"gculap\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"ogtqxepnylbf\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"tlvofq\",\"description\":\"vfcibyfmowux\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"xfzwi\"],\"labels\":[\"zjb\",\"yzsxjrkambtrne\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"vldspa\",\"tjb\",\"kdmflvestmjlx\",\"ril\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"pxlktwkuziycsl\",\"createdByType\":\"Key\",\"createdAt\":\"2021-08-14T04:43:23Z\",\"lastModifiedBy\":\"tcktyhjtqedcgzu\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-03-09T05:15:02Z\"},\"id\":\"qzz\",\"name\":\"rjvpglydzgkrvqee\",\"type\":\"toepryu\"}") - .toObject(TableInner.class); - Assertions.assertEquals(744996388, model.retentionInDays()); - Assertions.assertEquals(1739983778, model.totalRetentionInDays()); - Assertions.assertEquals("vjlfrqtt", model.searchResults().query()); - Assertions.assertEquals("jlkatnwxy", model.searchResults().description()); - Assertions.assertEquals(2086170636, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T16:40:26Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T18:08:40Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T21:34:15Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T21:08:29Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("oaz", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.plan()); - Assertions.assertEquals("jgslordilmyww", model.schema().name()); - Assertions.assertEquals("gkxnyedabg", model.schema().displayName()); - Assertions.assertEquals("udtjuewbc", model.schema().description()); - Assertions.assertEquals("uwhcjyxccybv", model.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.INT, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("udzpxgwjplmagstc", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("hpfkyrkdbdgi", model.schema().columns().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableInner model = new TableInner().withRetentionInDays(744996388) - .withTotalRetentionInDays(1739983778) - .withSearchResults(new SearchResults().withQuery("vjlfrqtt") - .withDescription("jlkatnwxy") - .withLimit(2086170636) - .withStartSearchTime(OffsetDateTime.parse("2021-07-06T16:40:26Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-05-28T18:08:40Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-15T21:34:15Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-12-03T21:08:29Z")) - .withSourceTable("oaz")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("jgslordilmyww") - .withDisplayName("gkxnyedabg") - .withDescription("udtjuewbc") - .withColumns(Arrays.asList( - new Column().withName("uwhcjyxccybv") - .withType(ColumnTypeEnum.INT) - .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("udzpxgwjplmagstc") - .withDescription("hpfkyrkdbdgi"), - new Column().withName("nwqjnoba") - .withType(ColumnTypeEnum.INT) - .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("iacegfnmn") - .withDescription("pmvmemfnczdwvv")))); - model = BinaryData.fromObject(model).toObject(TableInner.class); - Assertions.assertEquals(744996388, model.retentionInDays()); - Assertions.assertEquals(1739983778, model.totalRetentionInDays()); - Assertions.assertEquals("vjlfrqtt", model.searchResults().query()); - Assertions.assertEquals("jlkatnwxy", model.searchResults().description()); - Assertions.assertEquals(2086170636, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T16:40:26Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T18:08:40Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T21:34:15Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T21:08:29Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("oaz", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.plan()); - Assertions.assertEquals("jgslordilmyww", model.schema().name()); - Assertions.assertEquals("gkxnyedabg", model.schema().displayName()); - Assertions.assertEquals("udtjuewbc", model.schema().description()); - Assertions.assertEquals("uwhcjyxccybv", model.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.INT, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("udzpxgwjplmagstc", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("hpfkyrkdbdgi", model.schema().columns().get(0).description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java deleted file mode 100644 index 3ed057b6cffe..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java +++ /dev/null @@ -1,89 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.TableProperties; -import com.azure.resourcemanager.loganalytics.models.Column; -import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import com.azure.resourcemanager.loganalytics.models.RestoredLogs; -import com.azure.resourcemanager.loganalytics.models.Schema; -import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TablePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableProperties model = BinaryData.fromString( - "{\"retentionInDays\":479918870,\"totalRetentionInDays\":2045022432,\"archiveRetentionInDays\":1783841206,\"searchResults\":{\"query\":\"o\",\"description\":\"vf\",\"limit\":1925116648,\"startSearchTime\":\"2021-10-04T03:30Z\",\"endSearchTime\":\"2021-11-05T03:00:16Z\",\"sourceTable\":\"f\",\"azureAsyncOperationId\":\"z\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-04-24T01:32:22Z\",\"endRestoreTime\":\"2021-11-03T23:30:17Z\",\"sourceTable\":\"cx\",\"azureAsyncOperationId\":\"t\"},\"resultStatistics\":{\"progress\":39.374405,\"ingestedRecords\":675680646,\"scannedGb\":64.79667},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"mldgxobfirc\",\"schema\":{\"name\":\"kciayzri\",\"displayName\":\"hya\",\"description\":\"vjlboxqvk\",\"columns\":[{\"name\":\"ho\",\"type\":\"boolean\",\"dataTypeHint\":\"guid\",\"displayName\":\"wdigumbnraauz\",\"description\":\"tj\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"zwwva\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"fonkphhqyikvyla\",\"description\":\"avluwmncs\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"bvpoekrsgsgbdhu\",\"type\":\"dynamic\",\"dataTypeHint\":\"uri\",\"displayName\":\"gkynscliqh\",\"description\":\"h\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"kubotppnvdxz\",\"type\":\"dateTime\",\"dataTypeHint\":\"guid\",\"displayName\":\"bbc\",\"description\":\"qagt\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"categories\":[\"qojpy\"],\"labels\":[\"trdcnifmzzs\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"xmprafwg\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false}") - .toObject(TableProperties.class); - Assertions.assertEquals(479918870, model.retentionInDays()); - Assertions.assertEquals(2045022432, model.totalRetentionInDays()); - Assertions.assertEquals("o", model.searchResults().query()); - Assertions.assertEquals("vf", model.searchResults().description()); - Assertions.assertEquals(1925116648, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T03:30Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T03:00:16Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T01:32:22Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T23:30:17Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("cx", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.BASIC, model.plan()); - Assertions.assertEquals("kciayzri", model.schema().name()); - Assertions.assertEquals("hya", model.schema().displayName()); - Assertions.assertEquals("vjlboxqvk", model.schema().description()); - Assertions.assertEquals("ho", model.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.BOOLEAN, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("wdigumbnraauz", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("tj", model.schema().columns().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableProperties model = new TableProperties().withRetentionInDays(479918870) - .withTotalRetentionInDays(2045022432) - .withSearchResults(new SearchResults().withQuery("o") - .withDescription("vf") - .withLimit(1925116648) - .withStartSearchTime(OffsetDateTime.parse("2021-10-04T03:30Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-11-05T03:00:16Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-04-24T01:32:22Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-11-03T23:30:17Z")) - .withSourceTable("cx")) - .withPlan(TablePlanEnum.BASIC) - .withSchema(new Schema().withName("kciayzri") - .withDisplayName("hya") - .withDescription("vjlboxqvk") - .withColumns(Arrays.asList(new Column().withName("ho") - .withType(ColumnTypeEnum.BOOLEAN) - .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("wdigumbnraauz") - .withDescription("tj")))); - model = BinaryData.fromObject(model).toObject(TableProperties.class); - Assertions.assertEquals(479918870, model.retentionInDays()); - Assertions.assertEquals(2045022432, model.totalRetentionInDays()); - Assertions.assertEquals("o", model.searchResults().query()); - Assertions.assertEquals("vf", model.searchResults().description()); - Assertions.assertEquals(1925116648, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T03:30Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T03:00:16Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T01:32:22Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T23:30:17Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("cx", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.BASIC, model.plan()); - Assertions.assertEquals("kciayzri", model.schema().name()); - Assertions.assertEquals("hya", model.schema().displayName()); - Assertions.assertEquals("vjlboxqvk", model.schema().description()); - Assertions.assertEquals("ho", model.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.BOOLEAN, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("wdigumbnraauz", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("tj", model.schema().columns().get(0).description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java deleted file mode 100644 index 8fc39e4f9123..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TablesCancelSearchWithResponseMockTests { - @Test - public void testCancelSearchWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.tables().cancelSearchWithResponse("myltj", "rspxklur", "clf", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java deleted file mode 100644 index a5218a99664d..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,93 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.Column; -import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import com.azure.resourcemanager.loganalytics.models.RestoredLogs; -import com.azure.resourcemanager.loganalytics.models.Schema; -import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.Table; -import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TablesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"retentionInDays\":480341295,\"totalRetentionInDays\":27190578,\"archiveRetentionInDays\":1086111273,\"searchResults\":{\"query\":\"lidftujwjj\",\"description\":\"wbeqrkuor\",\"limit\":1870712650,\"startSearchTime\":\"2021-06-02T06:21:30Z\",\"endSearchTime\":\"2021-02-07T15:13:54Z\",\"sourceTable\":\"mdvhazcvjy\",\"azureAsyncOperationId\":\"qswbqerzwx\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-02-23T19:01:43Z\",\"endRestoreTime\":\"2021-05-09T17:49:27Z\",\"sourceTable\":\"ukvlb\",\"azureAsyncOperationId\":\"tgdstyouambe\"},\"resultStatistics\":{\"progress\":89.09465,\"ingestedRecords\":1285281809,\"scannedGb\":14.380062},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"mut\",\"schema\":{\"name\":\"eyguq\",\"displayName\":\"ijiitns\",\"description\":\"lz\",\"columns\":[{\"name\":\"grijwaiufanrayb\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"oj\",\"description\":\"dgrhydkygywezs\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"ygzmxieqvdsmak\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"hyhxa\",\"description\":\"bx\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"tblxpkkwjdjodqhy\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"emehllizh\",\"description\":\"umoqodkad\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"categories\":[\"qladywrxwhydtlu\",\"vadswzs\",\"uyem\",\"owuowh\"],\"labels\":[\"nwyrmouv\"],\"source\":\"customer\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"trfowtdvr\",\"mvlihcvjdrqcrjid\",\"ftukvhd\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"zd\",\"createdByType\":\"Application\",\"createdAt\":\"2021-03-22T04:05:19Z\",\"lastModifiedBy\":\"xhafratqx\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-11-30T03:06:43Z\"},\"id\":\"umzznvalqjrhuz\",\"name\":\"fxonjtpusllywp\",\"type\":\"tiotzb\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Table response = manager.tables() - .define("oytzpose") - .withExistingWorkspace("xa", "n") - .withRetentionInDays(1606592668) - .withTotalRetentionInDays(1200171262) - .withSearchResults(new SearchResults().withQuery("aupxvpi") - .withDescription("f") - .withLimit(479705193) - .withStartSearchTime(OffsetDateTime.parse("2021-06-27T21:10:54Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-06-24T09:11:48Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-31T20:24:08Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-02-02T20:49:05Z")) - .withSourceTable("xwetwkdrcyrucpc")) - .withPlan(TablePlanEnum.BASIC) - .withSchema(new Schema().withName("dnelqkaad") - .withDisplayName("nwf") - .withDescription("nniyopetxi") - .withColumns(Arrays.asList( - new Column().withName("lyxnucaephb") - .withType(ColumnTypeEnum.GUID) - .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("tv") - .withDescription("sdtcjbctvivuzqym"), - new Column().withName("tgitsqhzvbrzc") - .withType(ColumnTypeEnum.DYNAMIC) - .withDataTypeHint(ColumnDataTypeHintEnum.IP) - .withDisplayName("ndscxmxeatk") - .withDescription("mwnrdj")))) - .create(); - - Assertions.assertEquals(480341295, response.retentionInDays()); - Assertions.assertEquals(27190578, response.totalRetentionInDays()); - Assertions.assertEquals("lidftujwjj", response.searchResults().query()); - Assertions.assertEquals("wbeqrkuor", response.searchResults().description()); - Assertions.assertEquals(1870712650, response.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-02T06:21:30Z"), - response.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T15:13:54Z"), response.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T19:01:43Z"), - response.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T17:49:27Z"), response.restoredLogs().endRestoreTime()); - Assertions.assertEquals("ukvlb", response.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, response.plan()); - Assertions.assertEquals("eyguq", response.schema().name()); - Assertions.assertEquals("ijiitns", response.schema().displayName()); - Assertions.assertEquals("lz", response.schema().description()); - Assertions.assertEquals("grijwaiufanrayb", response.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.REAL, response.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.ARM_PATH, response.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("oj", response.schema().columns().get(0).displayName()); - Assertions.assertEquals("dgrhydkygywezs", response.schema().columns().get(0).description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java deleted file mode 100644 index 823a115012ca..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TablesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.tables().delete("rkgwltxeqip", "gzdyimsfayorp", "avkjog", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java deleted file mode 100644 index ef1834667e11..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java +++ /dev/null @@ -1,62 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import com.azure.resourcemanager.loganalytics.models.Table; -import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TablesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"retentionInDays\":1168808481,\"totalRetentionInDays\":248802373,\"archiveRetentionInDays\":564672857,\"searchResults\":{\"query\":\"buhzacaq\",\"description\":\"ltcoqc\",\"limit\":1004609054,\"startSearchTime\":\"2021-06-10T09:18:11Z\",\"endSearchTime\":\"2021-04-18T12:03:07Z\",\"sourceTable\":\"kuejk\",\"azureAsyncOperationId\":\"bizt\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-09-28T22:56:41Z\",\"endRestoreTime\":\"2021-06-13T10:08:38Z\",\"sourceTable\":\"vjufycsjmlbe\",\"azureAsyncOperationId\":\"ej\"},\"resultStatistics\":{\"progress\":97.11777,\"ingestedRecords\":859653726,\"scannedGb\":22.48292},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"tudaw\",\"schema\":{\"name\":\"felqerpptc\",\"displayName\":\"qnzmnhiil\",\"description\":\"lwcjgckbbcccgzpr\",\"columns\":[{\"name\":\"yuffatsgf\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"byubhiqdxyurnpn\",\"description\":\"zafccnuhiigb\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"vxva\",\"type\":\"real\",\"dataTypeHint\":\"guid\",\"displayName\":\"lbnb\",\"description\":\"vhcs\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"aeaovur\",\"type\":\"dateTime\",\"dataTypeHint\":\"uri\",\"displayName\":\"bdweade\",\"description\":\"mwntopagttmvmma\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"kjztjiuazjcgmxi\",\"type\":\"string\",\"dataTypeHint\":\"armPath\",\"displayName\":\"cpdltkrlg\",\"description\":\"tbdrvcqgue\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"qdurelyujlfyoum\",\"type\":\"dateTime\",\"dataTypeHint\":\"ip\",\"displayName\":\"lcdi\",\"description\":\"tajbrz\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"ci\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"utgjcyz\",\"description\":\"jdnrqjbt\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"aqbzgyhfwwvuatbw\",\"type\":\"guid\",\"dataTypeHint\":\"guid\",\"displayName\":\"uliyslpkcv\",\"description\":\"f\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"myw\",\"type\":\"guid\",\"dataTypeHint\":\"uri\",\"displayName\":\"miciij\",\"description\":\"kzfbojxjmcsmyq\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"nkwywzwofa\",\"ickduoiqta\",\"t\"],\"labels\":[\"kn\",\"rwzawnvs\",\"cfhzagxnvhycv\",\"imwrzregzgyufu\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"kzkdhmeott\",\"w\",\"yos\",\"wwhnhjtfvpn\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"ynudqllzsa\",\"createdByType\":\"Key\",\"createdAt\":\"2021-01-28T04:04:17Z\",\"lastModifiedBy\":\"eehuxiqhzlray\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-06-28T07:28:45Z\"},\"id\":\"kihmxrfdsajredn\",\"name\":\"yyshtuwgmevua\",\"type\":\"pwzyi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Table response = manager.tables() - .getWithResponse("ubn", "itpkpztrgdg", "vcoqraswugyxpqi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1168808481, response.retentionInDays()); - Assertions.assertEquals(248802373, response.totalRetentionInDays()); - Assertions.assertEquals("buhzacaq", response.searchResults().query()); - Assertions.assertEquals("ltcoqc", response.searchResults().description()); - Assertions.assertEquals(1004609054, response.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T09:18:11Z"), - response.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T12:03:07Z"), response.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T22:56:41Z"), - response.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T10:08:38Z"), response.restoredLogs().endRestoreTime()); - Assertions.assertEquals("vjufycsjmlbe", response.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, response.plan()); - Assertions.assertEquals("felqerpptc", response.schema().name()); - Assertions.assertEquals("qnzmnhiil", response.schema().displayName()); - Assertions.assertEquals("lwcjgckbbcccgzpr", response.schema().description()); - Assertions.assertEquals("yuffatsgf", response.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.STRING, response.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.URI, response.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("byubhiqdxyurnpn", response.schema().columns().get(0).displayName()); - Assertions.assertEquals("zafccnuhiigb", response.schema().columns().get(0).description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java deleted file mode 100644 index 412e46fd379a..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java +++ /dev/null @@ -1,65 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; -import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum; -import com.azure.resourcemanager.loganalytics.models.Table; -import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TablesListByWorkspaceMockTests { - @Test - public void testListByWorkspace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"retentionInDays\":143517524,\"totalRetentionInDays\":1172309322,\"archiveRetentionInDays\":1559182660,\"searchResults\":{\"query\":\"mmfz\",\"description\":\"fwxrzxmdew\",\"limit\":1373177035,\"startSearchTime\":\"2021-04-20T22:50:05Z\",\"endSearchTime\":\"2021-01-08T17:25:29Z\",\"sourceTable\":\"bjazejwwviy\",\"azureAsyncOperationId\":\"ps\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-20T14:34:31Z\",\"endRestoreTime\":\"2021-01-22T13:49:23Z\",\"sourceTable\":\"jxsqwjhqkbiwetp\",\"azureAsyncOperationId\":\"ycyqiqyhgfsetzl\"},\"resultStatistics\":{\"progress\":37.550117,\"ingestedRecords\":207278850,\"scannedGb\":68.76575},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"jpziu\",\"schema\":{\"name\":\"zkkdtnhqs\",\"displayName\":\"ljselp\",\"description\":\"bafvafhlbylcc\",\"columns\":[{\"name\":\"rhyzdf\",\"type\":\"real\",\"dataTypeHint\":\"uri\",\"displayName\":\"ltdb\",\"description\":\"irrhv\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"pqigtuujwouhd\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"bjb\",\"description\":\"jybvit\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"znumtggmuwdchoz\",\"type\":\"long\",\"dataTypeHint\":\"armPath\",\"displayName\":\"lv\",\"description\":\"oakizvoai\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"uwiguyxlyk\",\"type\":\"boolean\",\"dataTypeHint\":\"armPath\",\"displayName\":\"cwxhmpej\",\"description\":\"ke\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"vkcqhr\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"ccrmmk\",\"description\":\"pijubyq\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"frkemyildudxja\",\"cowvfdjkp\",\"xphlkksnmg\",\"vyfijdkzuqnw\"],\"labels\":[\"huqol\",\"ah\",\"uqwqulsutrjbhxyk\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"ugdrftbc\",\"exreu\",\"uowtljvfwhrea\",\"khyxvrqtvbcz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"epjpfs\",\"createdByType\":\"ManagedIdentity\",\"createdAt\":\"2021-11-01T10:59:42Z\",\"lastModifiedBy\":\"ngpszngafpg\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-07-27T16:28:59Z\"},\"id\":\"cj\",\"name\":\"jcngoadyed\",\"type\":\"zrgjfok\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.tables().listByWorkspace("upnqrmgjfb", "kuwxeoiojfizfavk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(143517524, response.iterator().next().retentionInDays()); - Assertions.assertEquals(1172309322, response.iterator().next().totalRetentionInDays()); - Assertions.assertEquals("mmfz", response.iterator().next().searchResults().query()); - Assertions.assertEquals("fwxrzxmdew", response.iterator().next().searchResults().description()); - Assertions.assertEquals(1373177035, response.iterator().next().searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T22:50:05Z"), - response.iterator().next().searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-08T17:25:29Z"), - response.iterator().next().searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T14:34:31Z"), - response.iterator().next().restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T13:49:23Z"), - response.iterator().next().restoredLogs().endRestoreTime()); - Assertions.assertEquals("jxsqwjhqkbiwetp", response.iterator().next().restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.BASIC, response.iterator().next().plan()); - Assertions.assertEquals("zkkdtnhqs", response.iterator().next().schema().name()); - Assertions.assertEquals("ljselp", response.iterator().next().schema().displayName()); - Assertions.assertEquals("bafvafhlbylcc", response.iterator().next().schema().description()); - Assertions.assertEquals("rhyzdf", response.iterator().next().schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.REAL, response.iterator().next().schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.URI, - response.iterator().next().schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("ltdb", response.iterator().next().schema().columns().get(0).displayName()); - Assertions.assertEquals("irrhv", response.iterator().next().schema().columns().get(0).description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java deleted file mode 100644 index fd41a98a5f76..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java +++ /dev/null @@ -1,113 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; -import com.azure.resourcemanager.loganalytics.models.Column; -import com.azure.resourcemanager.loganalytics.models.RestoredLogs; -import com.azure.resourcemanager.loganalytics.models.Schema; -import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; -import com.azure.resourcemanager.loganalytics.models.TablesListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TablesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TablesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"retentionInDays\":1152356837,\"totalRetentionInDays\":230467636,\"archiveRetentionInDays\":1993035285,\"searchResults\":{\"query\":\"fmviklby\",\"description\":\"khbejdznxc\",\"limit\":2045200930,\"startSearchTime\":\"2021-03-13T18:49:59Z\",\"endSearchTime\":\"2020-12-24T21:57:15Z\",\"sourceTable\":\"volvtn\",\"azureAsyncOperationId\":\"qfzgemjdftul\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-05T22:04:39Z\",\"endRestoreTime\":\"2021-04-12T02:20:30Z\",\"sourceTable\":\"amtmcz\",\"azureAsyncOperationId\":\"m\"},\"resultStatistics\":{\"progress\":45.98984,\"ingestedRecords\":1157846345,\"scannedGb\":57.057808},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"ssxmojms\",\"schema\":{\"name\":\"jpr\",\"displayName\":\"wcfzqljyxgt\",\"description\":\"heyd\",\"columns\":[{},{},{},{}],\"standardColumns\":[{},{},{}],\"categories\":[\"xmaehvbbxu\"],\"labels\":[\"ltfnhtbaxkgx\",\"wrck\",\"yklyhpluodpvruud\"],\"source\":\"microsoft\",\"tableType\":\"Microsoft\",\"tableSubType\":\"Classic\",\"solutions\":[\"tgk\",\"stvdxeclz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true},\"systemData\":{\"createdBy\":\"h\",\"createdByType\":\"ManagedIdentity\",\"createdAt\":\"2021-07-07T17:09:43Z\",\"lastModifiedBy\":\"dlwwqfbumlkxt\",\"lastModifiedByType\":\"Key\",\"lastModifiedAt\":\"2021-08-10T18:01:13Z\"},\"id\":\"mlmbtxhwgfwsrta\",\"name\":\"coezbrhubskh\",\"type\":\"dyg\"},{\"properties\":{\"retentionInDays\":328293320,\"totalRetentionInDays\":1039197688,\"archiveRetentionInDays\":870237510,\"searchResults\":{\"query\":\"vleo\",\"description\":\"ml\",\"limit\":16475569,\"startSearchTime\":\"2021-06-03T05:33:27Z\",\"endSearchTime\":\"2021-06-07T14:08:39Z\",\"sourceTable\":\"vyvnqqyb\",\"azureAsyncOperationId\":\"yeua\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-05-25T11:37:10Z\",\"endRestoreTime\":\"2021-04-19T19:49:12Z\",\"sourceTable\":\"gzslesjcbhernnti\",\"azureAsyncOperationId\":\"djc\"},\"resultStatistics\":{\"progress\":67.018715,\"ingestedRecords\":584080581,\"scannedGb\":39.08969},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"gohbuffkmrq\",\"schema\":{\"name\":\"vhmxtdrjfu\",\"displayName\":\"coebjvewzcj\",\"description\":\"m\",\"columns\":[{},{},{},{}],\"standardColumns\":[{},{},{},{}],\"categories\":[\"adraufactkahzo\",\"ajjziuxxpshne\",\"kulfg\",\"lqubkwdlen\"],\"labels\":[\"utujba\",\"pjuohminyfl\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"DataCollectionRuleBased\",\"solutions\":[\"pklvxw\",\"ygdxpgpqchis\"]},\"provisioningState\":\"InProgress\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true},\"systemData\":{\"createdBy\":\"xgibbda\",\"createdByType\":\"User\",\"createdAt\":\"2021-04-14T22:25:17Z\",\"lastModifiedBy\":\"zauorsuk\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-09-20T10:27:45Z\"},\"id\":\"plhlvnuuepzlrp\",\"name\":\"wzsoldweyuqdunv\",\"type\":\"nnrwrbiork\"},{\"properties\":{\"retentionInDays\":476504183,\"totalRetentionInDays\":681185824,\"archiveRetentionInDays\":1038080670,\"searchResults\":{\"query\":\"nhxmsi\",\"description\":\"omi\",\"limit\":1723847557,\"startSearchTime\":\"2021-10-29T08:24:04Z\",\"endSearchTime\":\"2021-01-25T20:05:05Z\",\"sourceTable\":\"iqndieuzaofj\",\"azureAsyncOperationId\":\"vcyy\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-05-03T11:29:59Z\",\"endRestoreTime\":\"2021-05-09T21:38:39Z\",\"sourceTable\":\"cubiipuipw\",\"azureAsyncOperationId\":\"onmacjekniz\"},\"resultStatistics\":{\"progress\":38.670307,\"ingestedRecords\":1591499316,\"scannedGb\":21.702797},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"gmblrri\",\"schema\":{\"name\":\"wdxsm\",\"displayName\":\"cwrwfs\",\"description\":\"fnynszqujizdvoqy\",\"columns\":[{},{},{},{}],\"standardColumns\":[{}],\"categories\":[\"blgyavutpthj\",\"xoi\",\"msksbp\"],\"labels\":[\"qolj\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"ffgcvizqz\",\"wlvwlyoupf\",\"fbkjubdyhgkfmi\"]},\"provisioningState\":\"Updating\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"sttktlahbqa\",\"createdByType\":\"Key\",\"createdAt\":\"2021-10-13T12:53:05Z\",\"lastModifiedBy\":\"ukxit\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-06-28T23:57:13Z\"},\"id\":\"qqqxhrnxrx\",\"name\":\"pjui\",\"type\":\"av\"}]}") - .toObject(TablesListResult.class); - Assertions.assertEquals(1152356837, model.value().get(0).retentionInDays()); - Assertions.assertEquals(230467636, model.value().get(0).totalRetentionInDays()); - Assertions.assertEquals("fmviklby", model.value().get(0).searchResults().query()); - Assertions.assertEquals("khbejdznxc", model.value().get(0).searchResults().description()); - Assertions.assertEquals(2045200930, model.value().get(0).searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T18:49:59Z"), - model.value().get(0).searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T21:57:15Z"), - model.value().get(0).searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T22:04:39Z"), - model.value().get(0).restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T02:20:30Z"), - model.value().get(0).restoredLogs().endRestoreTime()); - Assertions.assertEquals("amtmcz", model.value().get(0).restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.value().get(0).plan()); - Assertions.assertEquals("jpr", model.value().get(0).schema().name()); - Assertions.assertEquals("wcfzqljyxgt", model.value().get(0).schema().displayName()); - Assertions.assertEquals("heyd", model.value().get(0).schema().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TablesListResult model = new TablesListResult().withValue(Arrays.asList( - new TableInner().withRetentionInDays(1152356837) - .withTotalRetentionInDays(230467636) - .withSearchResults(new SearchResults().withQuery("fmviklby") - .withDescription("khbejdznxc") - .withLimit(2045200930) - .withStartSearchTime(OffsetDateTime.parse("2021-03-13T18:49:59Z")) - .withEndSearchTime(OffsetDateTime.parse("2020-12-24T21:57:15Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-11-05T22:04:39Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-04-12T02:20:30Z")) - .withSourceTable("amtmcz")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("jpr") - .withDisplayName("wcfzqljyxgt") - .withDescription("heyd") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))), - new TableInner().withRetentionInDays(328293320) - .withTotalRetentionInDays(1039197688) - .withSearchResults(new SearchResults().withQuery("vleo") - .withDescription("ml") - .withLimit(16475569) - .withStartSearchTime(OffsetDateTime.parse("2021-06-03T05:33:27Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-06-07T14:08:39Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-05-25T11:37:10Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-04-19T19:49:12Z")) - .withSourceTable("gzslesjcbhernnti")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("vhmxtdrjfu") - .withDisplayName("coebjvewzcj") - .withDescription("m") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))), - new TableInner().withRetentionInDays(476504183) - .withTotalRetentionInDays(681185824) - .withSearchResults(new SearchResults().withQuery("nhxmsi") - .withDescription("omi") - .withLimit(1723847557) - .withStartSearchTime(OffsetDateTime.parse("2021-10-29T08:24:04Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-01-25T20:05:05Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-05-03T11:29:59Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-05-09T21:38:39Z")) - .withSourceTable("cubiipuipw")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("wdxsm") - .withDisplayName("cwrwfs") - .withDescription("fnynszqujizdvoqy") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))))); - model = BinaryData.fromObject(model).toObject(TablesListResult.class); - Assertions.assertEquals(1152356837, model.value().get(0).retentionInDays()); - Assertions.assertEquals(230467636, model.value().get(0).totalRetentionInDays()); - Assertions.assertEquals("fmviklby", model.value().get(0).searchResults().query()); - Assertions.assertEquals("khbejdznxc", model.value().get(0).searchResults().description()); - Assertions.assertEquals(2045200930, model.value().get(0).searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T18:49:59Z"), - model.value().get(0).searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T21:57:15Z"), - model.value().get(0).searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T22:04:39Z"), - model.value().get(0).restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T02:20:30Z"), - model.value().get(0).restoredLogs().endRestoreTime()); - Assertions.assertEquals("amtmcz", model.value().get(0).restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.value().get(0).plan()); - Assertions.assertEquals("jpr", model.value().get(0).schema().name()); - Assertions.assertEquals("wcfzqljyxgt", model.value().get(0).schema().displayName()); - Assertions.assertEquals("heyd", model.value().get(0).schema().description()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java deleted file mode 100644 index 3872b158eb39..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TablesMigrateWithResponseMockTests { - @Test - public void testMigrateWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.tables().migrateWithResponse("sl", "bnsmjkwynqxaek", "sykvwjtqpke", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java deleted file mode 100644 index af7fd1879930..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java +++ /dev/null @@ -1,27 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.Tag; -import org.junit.jupiter.api.Assertions; - -public final class TagTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Tag model - = BinaryData.fromString("{\"name\":\"fiwjmygtdssls\",\"value\":\"tmweriofzpyq\"}").toObject(Tag.class); - Assertions.assertEquals("fiwjmygtdssls", model.name()); - Assertions.assertEquals("tmweriofzpyq", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Tag model = new Tag().withName("fiwjmygtdssls").withValue("tmweriofzpyq"); - model = BinaryData.fromObject(model).toObject(Tag.class); - Assertions.assertEquals("fiwjmygtdssls", model.name()); - Assertions.assertEquals("tmweriofzpyq", model.value()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java deleted file mode 100644 index cb53b4fa5d85..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java +++ /dev/null @@ -1,41 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.TagsResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagsResource model = BinaryData.fromString( - "{\"tags\":{\"jakhmsbzjh\":\"fdfdosygexpa\",\"hqtrgqjbpf\":\"rzevdphlxaol\",\"tfell\":\"fsinzgvfcjrwzoxx\",\"lxofpdvhpfxxypin\":\"wfzitonpeqfpjk\"}}") - .toObject(TagsResource.class); - Assertions.assertEquals("fdfdosygexpa", model.tags().get("jakhmsbzjh")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagsResource model = new TagsResource().withTags(mapOf("jakhmsbzjh", "fdfdosygexpa", "hqtrgqjbpf", - "rzevdphlxaol", "tfell", "fsinzgvfcjrwzoxx", "lxofpdvhpfxxypin", "wfzitonpeqfpjk")); - model = BinaryData.fromObject(model).toObject(TagsResource.class); - Assertions.assertEquals("fdfdosygexpa", model.tags().get("jakhmsbzjh")); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java deleted file mode 100644 index fa04531153b7..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java +++ /dev/null @@ -1,46 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.UsageMetricInner; -import com.azure.resourcemanager.loganalytics.models.MetricName; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class UsageMetricInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageMetricInner model = BinaryData.fromString( - "{\"name\":{\"value\":\"yjsflhhcaalnji\",\"localizedValue\":\"sxyawjoyaqcs\"},\"unit\":\"jpkiidzyexznelix\",\"currentValue\":16.42737179588487,\"limit\":65.0090874045316,\"nextResetTime\":\"2021-01-11T05:27:37Z\",\"quotaPeriod\":\"nxknalaulp\"}") - .toObject(UsageMetricInner.class); - Assertions.assertEquals("yjsflhhcaalnji", model.name().value()); - Assertions.assertEquals("sxyawjoyaqcs", model.name().localizedValue()); - Assertions.assertEquals("jpkiidzyexznelix", model.unit()); - Assertions.assertEquals(16.42737179588487D, model.currentValue()); - Assertions.assertEquals(65.0090874045316D, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T05:27:37Z"), model.nextResetTime()); - Assertions.assertEquals("nxknalaulp", model.quotaPeriod()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageMetricInner model = new UsageMetricInner() - .withName(new MetricName().withValue("yjsflhhcaalnji").withLocalizedValue("sxyawjoyaqcs")) - .withUnit("jpkiidzyexznelix") - .withCurrentValue(16.42737179588487D) - .withLimit(65.0090874045316D) - .withNextResetTime(OffsetDateTime.parse("2021-01-11T05:27:37Z")) - .withQuotaPeriod("nxknalaulp"); - model = BinaryData.fromObject(model).toObject(UsageMetricInner.class); - Assertions.assertEquals("yjsflhhcaalnji", model.name().value()); - Assertions.assertEquals("sxyawjoyaqcs", model.name().localizedValue()); - Assertions.assertEquals("jpkiidzyexznelix", model.unit()); - Assertions.assertEquals(16.42737179588487D, model.currentValue()); - Assertions.assertEquals(65.0090874045316D, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T05:27:37Z"), model.nextResetTime()); - Assertions.assertEquals("nxknalaulp", model.quotaPeriod()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java deleted file mode 100644 index b9d7b5598b38..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java +++ /dev/null @@ -1,46 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.UsageMetric; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":{\"value\":\"gtuhxuicbu\",\"localizedValue\":\"mr\"},\"unit\":\"njlx\",\"currentValue\":33.720955848019294,\"limit\":33.504071266925294,\"nextResetTime\":\"2021-07-24T18:32:54Z\",\"quotaPeriod\":\"baqehgpdoh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.usages().list("vuwkasiziesfuugh", "uqfecj", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gtuhxuicbu", response.iterator().next().name().value()); - Assertions.assertEquals("mr", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("njlx", response.iterator().next().unit()); - Assertions.assertEquals(33.720955848019294D, response.iterator().next().currentValue()); - Assertions.assertEquals(33.504071266925294D, response.iterator().next().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-24T18:32:54Z"), - response.iterator().next().nextResetTime()); - Assertions.assertEquals("baqehgpdoh", response.iterator().next().quotaPeriod()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 7fa169399014..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"9a09bc28-de09-4353-9fc8-db8f188d440e\",\"clientId\":\"2a023bcc-682d-4e62-8c52-90b378bd07e0\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java deleted file mode 100644 index 848bc06680c5..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java +++ /dev/null @@ -1,22 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; - -public final class UserIdentityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentityProperties model = BinaryData.fromString("{\"principalId\":\"ithtywu\",\"clientId\":\"cbihwqk\"}") - .toObject(UserIdentityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentityProperties model = new UserIdentityProperties(); - model = BinaryData.fromObject(model).toObject(UserIdentityProperties.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java deleted file mode 100644 index f30f22bd72ac..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java +++ /dev/null @@ -1,26 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceCappingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceCapping model = BinaryData.fromString( - "{\"dailyQuotaGb\":30.97995124606966,\"quotaNextResetTime\":\"nqttezl\",\"dataIngestionStatus\":\"OverQuota\"}") - .toObject(WorkspaceCapping.class); - Assertions.assertEquals(30.97995124606966D, model.dailyQuotaGb()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceCapping model = new WorkspaceCapping().withDailyQuotaGb(30.97995124606966D); - model = BinaryData.fromObject(model).toObject(WorkspaceCapping.class); - Assertions.assertEquals(30.97995124606966D, model.dailyQuotaGb()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java deleted file mode 100644 index a9e3443e9578..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceFeaturesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceFeatures model = BinaryData.fromString( - "{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"wau\",\"disableLocalAuth\":false,\"\":{\"pevzhfst\":\"datagupkvipmdscwxq\",\"pelmcuvhixbjxyf\":\"datatxhojujb\"}}") - .toObject(WorkspaceFeatures.class); - Assertions.assertEquals(false, model.enableDataExport()); - Assertions.assertEquals(false, model.immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wau", model.clusterResourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceFeatures model = new WorkspaceFeatures().withEnableDataExport(false) - .withImmediatePurgeDataOn30Days(false) - .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("wau") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf()); - model = BinaryData.fromObject(model).toObject(WorkspaceFeatures.class); - Assertions.assertEquals(false, model.enableDataExport()); - Assertions.assertEquals(false, model.immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wau", model.clusterResourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java deleted file mode 100644 index 78bf785bc5b7..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java +++ /dev/null @@ -1,100 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.Identity; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; -import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; -import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"customerId\":\"jylwbtlhflsj\",\"sku\":{\"name\":\"PerNode\",\"capacityReservationLevel\":500,\"lastSkuUpdate\":\"jvfbgofelja\"},\"retentionInDays\":728576378,\"workspaceCapping\":{\"dailyQuotaGb\":44.315075801765715,\"quotaNextResetTime\":\"vriiio\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"ghfkvtvsexs\",\"modifiedDate\":\"ueluqhhahhxvrhmz\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"ghftqsxhqxujxuk\",\"scopeId\":\"xdigrjg\"},{\"resourceId\":\"fzdm\",\"scopeId\":\"qtfihwhbotzinga\"},{\"resourceId\":\"pph\",\"scopeId\":\"zqzudph\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"nwcvtbvkayhmtnv\",\"disableLocalAuth\":true,\"\":{\"cjaesgvvs\":\"datakzwpcnpw\",\"wygzlvdnkfxusem\":\"datacyajguqf\",\"pfcqdp\":\"datawzrmuh\"}},\"defaultDataCollectionRuleResourceId\":\"xqv\"},\"identity\":{\"principalId\":\"uoymgccelvezry\",\"tenantId\":\"lmfeokerq\",\"type\":\"managedIdentity\",\"userAssignedIdentities\":{\"pbqpcrfkbwccsn\":{\"principalId\":\"ob\",\"clientId\":\"gxedkow\"},\"y\":{\"principalId\":\"cdwxlpq\",\"clientId\":\"ftnkhtj\"},\"ywkbirryuzhlhkjo\":{\"principalId\":\"gwfqatmt\",\"clientId\":\"tmdvypgikdgs\"}}},\"systemData\":{\"createdBy\":\"qqaatjinrvgou\",\"createdByType\":\"Key\",\"createdAt\":\"2021-11-16T07:49:22Z\",\"lastModifiedBy\":\"fggjioolvr\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-10-02T02:42:21Z\"},\"etag\":\"k\",\"location\":\"llqwjygvjayvblmh\",\"tags\":{\"gsopbyrqufegxu\":\"uhbxvvy\",\"bnhlmc\":\"wz\",\"dn\":\"l\",\"ijejvegrhbpn\":\"itvgbmhrixkwm\"},\"id\":\"ixexcc\",\"name\":\"dreaxh\",\"type\":\"exdrrvqahqkg\"}") - .toObject(WorkspaceInner.class); - Assertions.assertEquals("llqwjygvjayvblmh", model.location()); - Assertions.assertEquals("uhbxvvy", model.tags().get("gsopbyrqufegxu")); - Assertions.assertEquals(IdentityType.MANAGED_IDENTITY, model.identity().type()); - Assertions.assertEquals("k", model.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(728576378, model.retentionInDays()); - Assertions.assertEquals(44.315075801765715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(false, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("nwcvtbvkayhmtnv", model.features().clusterResourceId()); - Assertions.assertEquals(true, model.features().disableLocalAuth()); - Assertions.assertEquals("xqv", model.defaultDataCollectionRuleResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceInner model = new WorkspaceInner().withLocation("llqwjygvjayvblmh") - .withTags(mapOf("gsopbyrqufegxu", "uhbxvvy", "bnhlmc", "wz", "dn", "l", "ijejvegrhbpn", "itvgbmhrixkwm")) - .withIdentity(new Identity().withType(IdentityType.MANAGED_IDENTITY) - .withUserAssignedIdentities(mapOf("pbqpcrfkbwccsn", new UserIdentityProperties(), "y", - new UserIdentityProperties(), "ywkbirryuzhlhkjo", new UserIdentityProperties()))) - .withEtag("k") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_NODE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO)) - .withRetentionInDays(728576378) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(44.315075801765715D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) - .withForceCmkForQuery(true) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(false) - .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("nwcvtbvkayhmtnv") - .withDisableLocalAuth(true) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("xqv"); - model = BinaryData.fromObject(model).toObject(WorkspaceInner.class); - Assertions.assertEquals("llqwjygvjayvblmh", model.location()); - Assertions.assertEquals("uhbxvvy", model.tags().get("gsopbyrqufegxu")); - Assertions.assertEquals(IdentityType.MANAGED_IDENTITY, model.identity().type()); - Assertions.assertEquals("k", model.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(728576378, model.retentionInDays()); - Assertions.assertEquals(44.315075801765715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(false, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("nwcvtbvkayhmtnv", model.features().clusterResourceId()); - Assertions.assertEquals(true, model.features().disableLocalAuth()); - Assertions.assertEquals("xqv", model.defaultDataCollectionRuleResourceId()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java deleted file mode 100644 index 951ae07adcae..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java +++ /dev/null @@ -1,75 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.ManagementGroupInner; -import com.azure.resourcemanager.loganalytics.models.WorkspaceListManagementGroupsResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceListManagementGroupsResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceListManagementGroupsResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"serverCount\":319916389,\"isGateway\":false,\"name\":\"elmqk\",\"id\":\"ahvljuaha\",\"created\":\"2021-02-11T00:39:32Z\",\"dataReceived\":\"2021-02-06T01:31:14Z\",\"version\":\"mdua\",\"sku\":\"exq\"}},{\"properties\":{\"serverCount\":792525510,\"isGateway\":true,\"name\":\"sr\",\"id\":\"gvxp\",\"created\":\"2021-07-02T00:35:52Z\",\"dataReceived\":\"2021-02-22T15:36:44Z\",\"version\":\"fmisg\",\"sku\":\"nbbelda\"}},{\"properties\":{\"serverCount\":1782633502,\"isGateway\":true,\"name\":\"ourqhakau\",\"id\":\"shsfwxosowzxcu\",\"created\":\"2021-06-04T05:08:46Z\",\"dataReceived\":\"2020-12-22T21:46:37Z\",\"version\":\"xdje\",\"sku\":\"pucwwfvovbvme\"}},{\"properties\":{\"serverCount\":1911093580,\"isGateway\":false,\"name\":\"zceuojgjrw\",\"id\":\"eiotwmcdytdx\",\"created\":\"2021-01-14T13:52:52Z\",\"dataReceived\":\"2021-04-02T04:04:33Z\",\"version\":\"jawgqwg\",\"sku\":\"ni\"}}]}") - .toObject(WorkspaceListManagementGroupsResult.class); - Assertions.assertEquals(319916389, model.value().get(0).serverCount()); - Assertions.assertEquals(false, model.value().get(0).isGateway()); - Assertions.assertEquals("elmqk", model.value().get(0).name()); - Assertions.assertEquals("ahvljuaha", model.value().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T00:39:32Z"), model.value().get(0).created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T01:31:14Z"), model.value().get(0).dataReceived()); - Assertions.assertEquals("mdua", model.value().get(0).version()); - Assertions.assertEquals("exq", model.value().get(0).sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceListManagementGroupsResult model = new WorkspaceListManagementGroupsResult().withValue(Arrays.asList( - new ManagementGroupInner().withServerCount(319916389) - .withIsGateway(false) - .withName("elmqk") - .withId("ahvljuaha") - .withCreated(OffsetDateTime.parse("2021-02-11T00:39:32Z")) - .withDataReceived(OffsetDateTime.parse("2021-02-06T01:31:14Z")) - .withVersion("mdua") - .withSku("exq"), - new ManagementGroupInner().withServerCount(792525510) - .withIsGateway(true) - .withName("sr") - .withId("gvxp") - .withCreated(OffsetDateTime.parse("2021-07-02T00:35:52Z")) - .withDataReceived(OffsetDateTime.parse("2021-02-22T15:36:44Z")) - .withVersion("fmisg") - .withSku("nbbelda"), - new ManagementGroupInner().withServerCount(1782633502) - .withIsGateway(true) - .withName("ourqhakau") - .withId("shsfwxosowzxcu") - .withCreated(OffsetDateTime.parse("2021-06-04T05:08:46Z")) - .withDataReceived(OffsetDateTime.parse("2020-12-22T21:46:37Z")) - .withVersion("xdje") - .withSku("pucwwfvovbvme"), - new ManagementGroupInner().withServerCount(1911093580) - .withIsGateway(false) - .withName("zceuojgjrw") - .withId("eiotwmcdytdx") - .withCreated(OffsetDateTime.parse("2021-01-14T13:52:52Z")) - .withDataReceived(OffsetDateTime.parse("2021-04-02T04:04:33Z")) - .withVersion("jawgqwg") - .withSku("ni"))); - model = BinaryData.fromObject(model).toObject(WorkspaceListManagementGroupsResult.class); - Assertions.assertEquals(319916389, model.value().get(0).serverCount()); - Assertions.assertEquals(false, model.value().get(0).isGateway()); - Assertions.assertEquals("elmqk", model.value().get(0).name()); - Assertions.assertEquals("ahvljuaha", model.value().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T00:39:32Z"), model.value().get(0).created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T01:31:14Z"), model.value().get(0).dataReceived()); - Assertions.assertEquals("mdua", model.value().get(0).version()); - Assertions.assertEquals("exq", model.value().get(0).sku()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java deleted file mode 100644 index 5b7de28373ff..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java +++ /dev/null @@ -1,133 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.Identity; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; -import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; -import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; -import com.azure.resourcemanager.loganalytics.models.WorkspaceListResult; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"customerId\":\"rvtp\",\"sku\":{\"name\":\"CapacityReservation\",\"capacityReservationLevel\":300,\"lastSkuUpdate\":\"lgkfbt\"},\"retentionInDays\":2059272755,\"workspaceCapping\":{\"dailyQuotaGb\":3.405125193957159,\"quotaNextResetTime\":\"jcntuj\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"ed\",\"modifiedDate\":\"wwa\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"foqouicybx\",\"scopeId\":\"zg\"},{\"resourceId\":\"ufoxc\",\"scopeId\":\"opidoamciodh\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"bon\",\"disableLocalAuth\":false,\"\":{\"exztvbtq\":\"dataegokdwbwhkszzcmr\",\"wtl\":\"datasfraoyzko\",\"uximerqfobw\":\"datanguxawqaldsy\"}},\"defaultDataCollectionRuleResourceId\":\"nkbykutwpfhp\"},\"identity\":{\"principalId\":\"hrskdsnfd\",\"tenantId\":\"oakgtdlmkkzev\",\"type\":\"application\",\"userAssignedIdentities\":{\"m\":{\"principalId\":\"pusdstt\",\"clientId\":\"ogvbbejdcngq\"},\"grtwae\":{\"principalId\":\"kufgmj\",\"clientId\":\"wr\"},\"efozbhdms\":{\"principalId\":\"uzkopbminrfd\",\"clientId\":\"yuhhziu\"},\"z\":{\"principalId\":\"mzqhoftrmaequi\",\"clientId\":\"xicslfao\"}}},\"systemData\":{\"createdBy\":\"ylhalnswhcc\",\"createdByType\":\"User\",\"createdAt\":\"2021-06-09T09:48:38Z\",\"lastModifiedBy\":\"vwitqscyw\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-02-13T16:07:26Z\"},\"etag\":\"uhczbwemh\",\"location\":\"i\",\"tags\":{\"w\":\"rgzdwmsweyp\"},\"id\":\"xggicccnxqhuexmk\",\"name\":\"tlstvlzywem\",\"type\":\"zrncsdt\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"ypbsfgytguslfead\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":500,\"lastSkuUpdate\":\"yhejhzisxgfp\"},\"retentionInDays\":1351567723,\"workspaceCapping\":{\"dailyQuotaGb\":12.05090295018133,\"quotaNextResetTime\":\"srp\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"zraehtwd\",\"modifiedDate\":\"ftswibyrcdlbhsh\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"ty\",\"scopeId\":\"evxccedcp\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"xltjcvnhltiu\",\"disableLocalAuth\":false,\"\":{\"y\":\"datavvwxqi\",\"djrkvfgbvfvpd\":\"dataunyowxwl\"}},\"defaultDataCollectionRuleResourceId\":\"daciz\"},\"identity\":{\"principalId\":\"lhkrribdeibqipqk\",\"tenantId\":\"vxndz\",\"type\":\"user\",\"userAssignedIdentities\":{\"sjabibs\":{\"principalId\":\"fajpjorwk\",\"clientId\":\"yhgbijtjivfx\"},\"budurgkakmo\":{\"principalId\":\"tawfsdjpvkvp\",\"clientId\":\"xbkzbzkdvncj\"},\"lgzrfzeeyeb\":{\"principalId\":\"hjjklff\",\"clientId\":\"ouw\"},\"t\":{\"principalId\":\"ikayuhqlbjbsybb\",\"clientId\":\"r\"}}},\"systemData\":{\"createdBy\":\"mfpgv\",\"createdByType\":\"Key\",\"createdAt\":\"2021-10-24T06:37:57Z\",\"lastModifiedBy\":\"ltha\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-09-03T05:44:20Z\"},\"etag\":\"wutwbdsre\",\"location\":\"pdrhne\",\"tags\":{\"cgpik\":\"wqkdwytisibi\",\"av\":\"zimejzanlfzx\",\"jq\":\"mbzonokix\"},\"id\":\"irgzp\",\"name\":\"rlazszrnw\",\"type\":\"iin\"}]}") - .toObject(WorkspaceListResult.class); - Assertions.assertEquals("i", model.value().get(0).location()); - Assertions.assertEquals("rgzdwmsweyp", model.value().get(0).tags().get("w")); - Assertions.assertEquals(IdentityType.APPLICATION, model.value().get(0).identity().type()); - Assertions.assertEquals("uhczbwemh", model.value().get(0).etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.value().get(0).sku().name()); - Assertions.assertEquals(CapacityReservationLevel.THREE_ZERO_ZERO, - model.value().get(0).sku().capacityReservationLevel()); - Assertions.assertEquals(2059272755, model.value().get(0).retentionInDays()); - Assertions.assertEquals(3.405125193957159D, model.value().get(0).workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - model.value().get(0).publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.value().get(0).forceCmkForQuery()); - Assertions.assertEquals(true, model.value().get(0).features().enableDataExport()); - Assertions.assertEquals(true, model.value().get(0).features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("bon", model.value().get(0).features().clusterResourceId()); - Assertions.assertEquals(false, model.value().get(0).features().disableLocalAuth()); - Assertions.assertEquals("nkbykutwpfhp", model.value().get(0).defaultDataCollectionRuleResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceListResult model - = new WorkspaceListResult() - .withValue( - Arrays - .asList( - new WorkspaceInner().withLocation("i") - .withTags(mapOf("w", "rgzdwmsweyp")) - .withIdentity(new Identity().withType(IdentityType.APPLICATION) - .withUserAssignedIdentities(mapOf("m", new UserIdentityProperties(), "grtwae", - new UserIdentityProperties(), "efozbhdms", new UserIdentityProperties(), "z", - new UserIdentityProperties()))) - .withEtag("uhczbwemh") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.CAPACITY_RESERVATION) - .withCapacityReservationLevel(CapacityReservationLevel.THREE_ZERO_ZERO)) - .withRetentionInDays(2059272755) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(3.405125193957159D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("bon") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("nkbykutwpfhp"), - new WorkspaceInner().withLocation("pdrhne") - .withTags(mapOf("cgpik", "wqkdwytisibi", "av", "zimejzanlfzx", "jq", "mbzonokix")) - .withIdentity(new Identity().withType(IdentityType.USER) - .withUserAssignedIdentities(mapOf("sjabibs", new UserIdentityProperties(), - "budurgkakmo", new UserIdentityProperties(), "lgzrfzeeyeb", - new UserIdentityProperties(), "t", new UserIdentityProperties()))) - .withEtag("wutwbdsre") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO)) - .withRetentionInDays(1351567723) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(12.05090295018133D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("xltjcvnhltiu") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("daciz"))); - model = BinaryData.fromObject(model).toObject(WorkspaceListResult.class); - Assertions.assertEquals("i", model.value().get(0).location()); - Assertions.assertEquals("rgzdwmsweyp", model.value().get(0).tags().get("w")); - Assertions.assertEquals(IdentityType.APPLICATION, model.value().get(0).identity().type()); - Assertions.assertEquals("uhczbwemh", model.value().get(0).etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.value().get(0).sku().name()); - Assertions.assertEquals(CapacityReservationLevel.THREE_ZERO_ZERO, - model.value().get(0).sku().capacityReservationLevel()); - Assertions.assertEquals(2059272755, model.value().get(0).retentionInDays()); - Assertions.assertEquals(3.405125193957159D, model.value().get(0).workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - model.value().get(0).publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.value().get(0).forceCmkForQuery()); - Assertions.assertEquals(true, model.value().get(0).features().enableDataExport()); - Assertions.assertEquals(true, model.value().get(0).features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("bon", model.value().get(0).features().clusterResourceId()); - Assertions.assertEquals(false, model.value().get(0).features().disableLocalAuth()); - Assertions.assertEquals("nkbykutwpfhp", model.value().get(0).defaultDataCollectionRuleResourceId()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java deleted file mode 100644 index 606d57e1a4bc..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java +++ /dev/null @@ -1,60 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.UsageMetricInner; -import com.azure.resourcemanager.loganalytics.models.MetricName; -import com.azure.resourcemanager.loganalytics.models.WorkspaceListUsagesResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceListUsagesResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceListUsagesResult model = BinaryData.fromString( - "{\"value\":[{\"name\":{\"value\":\"ibycno\",\"localizedValue\":\"knme\"},\"unit\":\"sgzvahapjyzhpv\",\"currentValue\":87.25675780401417,\"limit\":55.97471576867415,\"nextResetTime\":\"2021-04-03T19:52:37Z\",\"quotaPeriod\":\"zlmwlxkvugfhz\"},{\"name\":{\"value\":\"wjvzunluthnn\",\"localizedValue\":\"nxipeil\"},\"unit\":\"zuaejxd\",\"currentValue\":90.33601925524867,\"limit\":73.93279017728112,\"nextResetTime\":\"2021-04-25T18:40:13Z\",\"quotaPeriod\":\"zumveekgpwo\"},{\"name\":{\"value\":\"kfpbs\",\"localizedValue\":\"ofd\"},\"unit\":\"uusdttouwa\",\"currentValue\":45.35057543626068,\"limit\":0.5889681397022062,\"nextResetTime\":\"2021-03-07T10:01:38Z\",\"quotaPeriod\":\"smv\"}]}") - .toObject(WorkspaceListUsagesResult.class); - Assertions.assertEquals("ibycno", model.value().get(0).name().value()); - Assertions.assertEquals("knme", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("sgzvahapjyzhpv", model.value().get(0).unit()); - Assertions.assertEquals(87.25675780401417D, model.value().get(0).currentValue()); - Assertions.assertEquals(55.97471576867415D, model.value().get(0).limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals("zlmwlxkvugfhz", model.value().get(0).quotaPeriod()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceListUsagesResult model = new WorkspaceListUsagesResult().withValue(Arrays.asList( - new UsageMetricInner().withName(new MetricName().withValue("ibycno").withLocalizedValue("knme")) - .withUnit("sgzvahapjyzhpv") - .withCurrentValue(87.25675780401417D) - .withLimit(55.97471576867415D) - .withNextResetTime(OffsetDateTime.parse("2021-04-03T19:52:37Z")) - .withQuotaPeriod("zlmwlxkvugfhz"), - new UsageMetricInner().withName(new MetricName().withValue("wjvzunluthnn").withLocalizedValue("nxipeil")) - .withUnit("zuaejxd") - .withCurrentValue(90.33601925524867D) - .withLimit(73.93279017728112D) - .withNextResetTime(OffsetDateTime.parse("2021-04-25T18:40:13Z")) - .withQuotaPeriod("zumveekgpwo"), - new UsageMetricInner().withName(new MetricName().withValue("kfpbs").withLocalizedValue("ofd")) - .withUnit("uusdttouwa") - .withCurrentValue(45.35057543626068D) - .withLimit(0.5889681397022062D) - .withNextResetTime(OffsetDateTime.parse("2021-03-07T10:01:38Z")) - .withQuotaPeriod("smv"))); - model = BinaryData.fromObject(model).toObject(WorkspaceListUsagesResult.class); - Assertions.assertEquals("ibycno", model.value().get(0).name().value()); - Assertions.assertEquals("knme", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("sgzvahapjyzhpv", model.value().get(0).unit()); - Assertions.assertEquals(87.25675780401417D, model.value().get(0).currentValue()); - Assertions.assertEquals(55.97471576867415D, model.value().get(0).limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals("zlmwlxkvugfhz", model.value().get(0).quotaPeriod()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java deleted file mode 100644 index 8ceab0bfee2f..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java +++ /dev/null @@ -1,95 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.Identity; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; -import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; -import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; -import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspacePatch model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"gg\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":1000,\"lastSkuUpdate\":\"ovvtgseinqfiu\"},\"retentionInDays\":846707727,\"workspaceCapping\":{\"dailyQuotaGb\":67.63985202806066,\"quotaNextResetTime\":\"gnepttwqmsni\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"mqnrojlpijnkr\",\"modifiedDate\":\"rddh\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"asxifto\",\"scopeId\":\"yzhftwesgogczh\"},{\"resourceId\":\"nxkrlgnyhmossxkk\",\"scopeId\":\"h\"},{\"resourceId\":\"gh\",\"scopeId\":\"bdhqxvcxgf\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"rnsvbuswd\",\"disableLocalAuth\":false,\"\":{\"awnopqgikyzirtxd\":\"dataycnunvjsrtk\",\"ioilqukrydxtq\":\"datauxzejntpsew\",\"ghhavgrvkffo\":\"dataieoxorggufhyaomt\",\"mv\":\"datajzhpjbibgjmfx\"}},\"defaultDataCollectionRuleResourceId\":\"luyovwxnbkfezzx\"},\"identity\":{\"principalId\":\"hwzdgirujbz\",\"tenantId\":\"mvzzbtdcqvp\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"cotmr\":{\"principalId\":\"viylwdshfssnrbgy\",\"clientId\":\"rymsgaojfmw\"},\"cpqjlihhyu\":{\"principalId\":\"irctymoxoftpipiw\",\"clientId\":\"zuhx\"},\"rsre\":{\"principalId\":\"skasdvlmfwdgzxu\",\"clientId\":\"cvpa\"}}},\"tags\":{\"ifqjz\":\"xurisjnhnyt\",\"lw\":\"xmrhu\",\"woqhihe\":\"cesutrgjupauut\",\"zpnfqntcypsxj\":\"qg\"},\"etag\":\"oimwkslirc\",\"id\":\"zjxvydfcea\",\"name\":\"vlhv\",\"type\":\"gdyftumrtwna\"}") - .toObject(WorkspacePatch.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xurisjnhnyt", model.tags().get("ifqjz")); - Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(846707727, model.retentionInDays()); - Assertions.assertEquals(67.63985202806066D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(false, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("rnsvbuswd", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("luyovwxnbkfezzx", model.defaultDataCollectionRuleResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspacePatch model = new WorkspacePatch() - .withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("cotmr", new UserIdentityProperties(), "cpqjlihhyu", - new UserIdentityProperties(), "rsre", new UserIdentityProperties()))) - .withTags(mapOf("ifqjz", "xurisjnhnyt", "lw", "xmrhu", "woqhihe", "cesutrgjupauut", "zpnfqntcypsxj", "qg")) - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE) - .withCapacityReservationLevel(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO)) - .withRetentionInDays(846707727) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(67.63985202806066D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) - .withForceCmkForQuery(true) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("rnsvbuswd") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("luyovwxnbkfezzx"); - model = BinaryData.fromObject(model).toObject(WorkspacePatch.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xurisjnhnyt", model.tags().get("ifqjz")); - Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(846707727, model.retentionInDays()); - Assertions.assertEquals(67.63985202806066D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(false, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("rnsvbuswd", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("luyovwxnbkfezzx", model.defaultDataCollectionRuleResourceId()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java deleted file mode 100644 index 760774d464ae..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java +++ /dev/null @@ -1,84 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceProperties; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; -import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"ProvisioningAccount\",\"customerId\":\"ijnhyjsvfycxzbf\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":2000,\"lastSkuUpdate\":\"vmtgjqppy\"},\"retentionInDays\":768184156,\"workspaceCapping\":{\"dailyQuotaGb\":15.525265144439715,\"quotaNextResetTime\":\"yhgfipnsx\",\"dataIngestionStatus\":\"ForceOff\"},\"createdDate\":\"a\",\"modifiedDate\":\"rrjreafxtsgu\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"slol\",\"scopeId\":\"pvuzlmv\"},{\"resourceId\":\"lfktgplcrpwjxe\",\"scopeId\":\"oi\"},{\"resourceId\":\"rnjwmw\",\"scopeId\":\"nbsazejjoqkag\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"zxnfaaz\",\"disableLocalAuth\":false,\"\":{\"ou\":\"datakdmkqjjlwuenvrkp\"}},\"defaultDataCollectionRuleResourceId\":\"bre\"}") - .toObject(WorkspaceProperties.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(768184156, model.retentionInDays()); - Assertions.assertEquals(15.525265144439715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("zxnfaaz", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("bre", model.defaultDataCollectionRuleResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceProperties model = new WorkspaceProperties() - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.LACLUSTER) - .withCapacityReservationLevel(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO)) - .withRetentionInDays(768184156) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(15.525265144439715D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("zxnfaaz") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("bre"); - model = BinaryData.fromObject(model).toObject(WorkspaceProperties.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(768184156, model.retentionInDays()); - Assertions.assertEquals(15.525265144439715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("zxnfaaz", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("bre", model.defaultDataCollectionRuleResourceId()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java deleted file mode 100644 index 723b5faea071..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java +++ /dev/null @@ -1,25 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.WorkspacePurgeResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePurgeResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspacePurgeResponseInner model - = BinaryData.fromString("{\"operationId\":\"hky\"}").toObject(WorkspacePurgeResponseInner.class); - Assertions.assertEquals("hky", model.operationId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspacePurgeResponseInner model = new WorkspacePurgeResponseInner().withOperationId("hky"); - model = BinaryData.fromObject(model).toObject(WorkspacePurgeResponseInner.class); - Assertions.assertEquals("hky", model.operationId()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeStatusResponseInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeStatusResponseInnerTests.java deleted file mode 100644 index 40c016d15835..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeStatusResponseInnerTests.java +++ /dev/null @@ -1,27 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.fluent.models.WorkspacePurgeStatusResponseInner; -import com.azure.resourcemanager.loganalytics.models.PurgeState; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePurgeStatusResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspacePurgeStatusResponseInner model - = BinaryData.fromString("{\"status\":\"pending\"}").toObject(WorkspacePurgeStatusResponseInner.class); - Assertions.assertEquals(PurgeState.PENDING, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspacePurgeStatusResponseInner model - = new WorkspacePurgeStatusResponseInner().withStatus(PurgeState.PENDING); - model = BinaryData.fromObject(model).toObject(WorkspacePurgeStatusResponseInner.class); - Assertions.assertEquals(PurgeState.PENDING, model.status()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java deleted file mode 100644 index 3eddddd1f728..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java +++ /dev/null @@ -1,39 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.PurgeState; -import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeStatusResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacePurgesGetPurgeStatusWithResponseMockTests { - @Test - public void testGetPurgeStatusWithResponse() throws Exception { - String responseStr = "{\"status\":\"completed\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspacePurgeStatusResponse response = manager.workspacePurges() - .getPurgeStatusWithResponse("yrrleaesinuqt", "jqo", "bpihehcecybmrqbr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PurgeState.COMPLETED, response.status()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java deleted file mode 100644 index 0702c7e26406..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java +++ /dev/null @@ -1,31 +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.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceSku model = BinaryData - .fromString("{\"name\":\"Standalone\",\"capacityReservationLevel\":5000,\"lastSkuUpdate\":\"sj\"}") - .toObject(WorkspaceSku.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO, model.capacityReservationLevel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceSku model = new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDALONE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO); - model = BinaryData.fromObject(model).toObject(WorkspaceSku.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO, model.capacityReservationLevel()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java deleted file mode 100644 index be12e3190dd4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,98 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.Identity; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; -import com.azure.resourcemanager.loganalytics.models.Workspace; -import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; -import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"ldtve\",\"sku\":{\"name\":\"Premium\",\"capacityReservationLevel\":100,\"lastSkuUpdate\":\"hzjkn\"},\"retentionInDays\":1633027384,\"workspaceCapping\":{\"dailyQuotaGb\":61.251523393969165,\"quotaNextResetTime\":\"pnrupzaamrdi\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"kidswys\",\"modifiedDate\":\"ruffgllukk\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"vmblcouqe\",\"scopeId\":\"hbcdsziry\"},{\"resourceId\":\"ndo\",\"scopeId\":\"mbltoo\"},{\"resourceId\":\"kfqlwx\",\"scopeId\":\"ykalsyga\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"jksibjg\",\"disableLocalAuth\":true,\"\":{\"pinbmhwbjijkgqxn\":\"dataahmrnadzyqegxyi\",\"znj\":\"datambk\",\"cwkdtaaw\":\"dataujvaannggi\",\"mqkra\":\"datawfekaumrrqmb\"}},\"defaultDataCollectionRuleResourceId\":\"nxwbjsidbirkfp\"},\"identity\":{\"principalId\":\"kd\",\"tenantId\":\"gewi\",\"type\":\"None\",\"userAssignedIdentities\":{\"o\":{\"principalId\":\"bguzozky\",\"clientId\":\"nfnzhhh\"},\"pyc\":{\"principalId\":\"ffjkutycyarnroo\",\"clientId\":\"uabzoghkt\"},\"zptwrlohap\":{\"principalId\":\"coe\",\"clientId\":\"nhzqrottjzcfy\"},\"xpjb\":{\"principalId\":\"nfszpyglqdhmrjz\",\"clientId\":\"l\"}}},\"systemData\":{\"createdBy\":\"sjoqcjenkyhfqzvs\",\"createdByType\":\"Application\",\"createdAt\":\"2021-08-22T03:48:47Z\",\"lastModifiedBy\":\"l\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-04-25T15:23:25Z\"},\"etag\":\"jhhhqxu\",\"location\":\"yvca\",\"tags\":{\"vbsizusjszlbscm\":\"v\"},\"id\":\"lzijiufehgmvflnw\",\"name\":\"v\",\"type\":\"kxrerlniylylyfwx\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Workspace response = manager.workspaces() - .define("jxl") - .withRegion("wsdrnpxqwodif") - .withExistingResourceGroup("ecmslclbl") - .withTags(mapOf("wibvjogj", "cjrmmua")) - .withIdentity(new Identity().withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf("efgwbmqjc", new UserIdentityProperties()))) - .withEtag("jcmmzrrscub") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDARD) - .withCapacityReservationLevel(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO)) - .withRetentionInDays(1106041304) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(17.1701428900364D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("d") - .withDisableLocalAuth(true) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("ulrtywikdmh") - .create(); - - Assertions.assertEquals("yvca", response.location()); - Assertions.assertEquals("v", response.tags().get("vbsizusjszlbscm")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("jhhhqxu", response.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PREMIUM, response.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO, response.sku().capacityReservationLevel()); - Assertions.assertEquals(1633027384, response.retentionInDays()); - Assertions.assertEquals(61.251523393969165D, response.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, response.forceCmkForQuery()); - Assertions.assertEquals(true, response.features().enableDataExport()); - Assertions.assertEquals(true, response.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, response.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("jksibjg", response.features().clusterResourceId()); - Assertions.assertEquals(true, response.features().disableLocalAuth()); - Assertions.assertEquals("nxwbjsidbirkfp", response.defaultDataCollectionRuleResourceId()); - } - - // Use "Map.of" if available - @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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java deleted file mode 100644 index 4025d2a3e4b9..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java +++ /dev/null @@ -1,33 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().delete("odlfpyapucygvo", "vyuns", true, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 708ef7ba7672..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,59 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.Workspace; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"uygdhgaqipirp\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":1000,\"lastSkuUpdate\":\"ulopmjnlexwhcb\"},\"retentionInDays\":1491693299,\"workspaceCapping\":{\"dailyQuotaGb\":3.5229410575627673,\"quotaNextResetTime\":\"uuuercta\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"ntqpbr\",\"modifiedDate\":\"yrduczkgofxyfsr\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"tbstvjeaqnrmv\",\"scopeId\":\"koxmlghk\"},{\"resourceId\":\"idvrmaz\",\"scopeId\":\"dwwexymz\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"wvqsgny\",\"disableLocalAuth\":true,\"\":{\"yyvpkpatlb\":\"datavensrpm\",\"gsksrfhf\":\"datajp\",\"bnxwc\":\"dataolmk\",\"fgbrtt\":\"dataommpvfqaw\"}},\"defaultDataCollectionRuleResourceId\":\"aclkiexhajlfnt\"},\"identity\":{\"principalId\":\"fyut\",\"tenantId\":\"iygbpvn\",\"type\":\"None\",\"userAssignedIdentities\":{\"fg\":{\"principalId\":\"xkyctwwgzwx\",\"clientId\":\"mecvogygzyvneeza\"}}},\"systemData\":{\"createdBy\":\"oqqtl\",\"createdByType\":\"Application\",\"createdAt\":\"2020-12-26T15:29:31Z\",\"lastModifiedBy\":\"rkjjjavfqnvhnq\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-01-06T07:59:03Z\"},\"etag\":\"iyet\",\"location\":\"sypvidbztjhqtfb\",\"tags\":{\"p\":\"ynkbwetnju\",\"piaccxnafb\":\"prkzya\"},\"id\":\"qroohtu\",\"name\":\"vmaonurjt\",\"type\":\"mghihp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Workspace response = manager.workspaces() - .getByResourceGroupWithResponse("lghieegjlgvvpase", "sgb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("sypvidbztjhqtfb", response.location()); - Assertions.assertEquals("ynkbwetnju", response.tags().get("p")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("iyet", response.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, response.sku().capacityReservationLevel()); - Assertions.assertEquals(1491693299, response.retentionInDays()); - Assertions.assertEquals(3.5229410575627673D, response.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.forceCmkForQuery()); - Assertions.assertEquals(false, response.features().enableDataExport()); - Assertions.assertEquals(false, response.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, response.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wvqsgny", response.features().clusterResourceId()); - Assertions.assertEquals(true, response.features().disableLocalAuth()); - Assertions.assertEquals("aclkiexhajlfnt", response.defaultDataCollectionRuleResourceId()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java deleted file mode 100644 index a770ad13174e..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java +++ /dev/null @@ -1,63 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.Workspace; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"customerId\":\"rxvbfihwuh\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"rbxrblmliowxihsp\"},\"retentionInDays\":510914114,\"workspaceCapping\":{\"dailyQuotaGb\":25.078160367574576,\"quotaNextResetTime\":\"pzwaklsbsbqqq\",\"dataIngestionStatus\":\"SubscriptionSuspended\"},\"createdDate\":\"rxaomzisglrrcze\",\"modifiedDate\":\"hhltnjadhqo\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"fbpcmsplb\",\"scopeId\":\"rueqthwm\"},{\"resourceId\":\"mbscbbx\",\"scopeId\":\"dhxiidlopedbwd\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"md\",\"disableLocalAuth\":true,\"\":{\"qacigeleo\":\"dataqwremjel\",\"vqvwzkjopwbe\":\"datad\",\"x\":\"datanrlkwzdqy\"}},\"defaultDataCollectionRuleResourceId\":\"akxcptsoqfyiaseq\"},\"identity\":{\"principalId\":\"rttzrazisgykiu\",\"tenantId\":\"vanbwzohmnrxxbs\",\"type\":\"user\",\"userAssignedIdentities\":{\"g\":{\"principalId\":\"nhmdptysprqs\",\"clientId\":\"zxojpslsv\"},\"q\":{\"principalId\":\"iufiqwo\",\"clientId\":\"qvapcohhoucq\"},\"ddtjwfljhznam\":{\"principalId\":\"xcxzrzdcgdzben\",\"clientId\":\"bcawetz\"},\"vgbgatzuuvbxng\":{\"principalId\":\"atmzw\",\"clientId\":\"jncqtjzmi\"}}},\"systemData\":{\"createdBy\":\"wggahttzlswvaj\",\"createdByType\":\"Key\",\"createdAt\":\"2021-09-26T07:25:25Z\",\"lastModifiedBy\":\"joqza\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-02-03T05:21:58Z\"},\"etag\":\"j\",\"location\":\"frgqhaohcm\",\"tags\":{\"l\":\"cnjrohmbpyryxame\"},\"id\":\"dyvkfkmr\",\"name\":\"cxneh\",\"type\":\"sm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.workspaces().listByResourceGroup("qltgrd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("frgqhaohcm", response.iterator().next().location()); - Assertions.assertEquals("cnjrohmbpyryxame", response.iterator().next().tags().get("l")); - Assertions.assertEquals(IdentityType.USER, response.iterator().next().identity().type()); - Assertions.assertEquals("j", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(510914114, response.iterator().next().retentionInDays()); - Assertions.assertEquals(25.078160367574576D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, - response.iterator().next().publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, - response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("md", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("akxcptsoqfyiaseq", response.iterator().next().defaultDataCollectionRuleResourceId()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java deleted file mode 100644 index f829a0836d61..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java +++ /dev/null @@ -1,62 +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.loganalytics.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; -import com.azure.resourcemanager.loganalytics.models.IdentityType; -import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.Workspace; -import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"customerId\":\"wdtgukranblw\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":400,\"lastSkuUpdate\":\"c\"},\"retentionInDays\":1802278503,\"workspaceCapping\":{\"dailyQuotaGb\":33.5739290982965,\"quotaNextResetTime\":\"hoi\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"niiprglvaw\",\"modifiedDate\":\"z\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"bjpmcubk\",\"scopeId\":\"foxx\"},{\"resourceId\":\"bvphavpm\",\"scopeId\":\"rbqgvgov\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"knssqyzqed\",\"disableLocalAuth\":false,\"\":{\"qmrjg\":\"datadb\",\"mjpb\":\"dataihfqlggwfiwzc\",\"pgxh\":\"dataephmgtvljvrcmyfq\"}},\"defaultDataCollectionRuleResourceId\":\"omyqwcabvnuileey\"},\"identity\":{\"principalId\":\"lpaugmrm\",\"tenantId\":\"lrxw\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"psmgo\":{\"principalId\":\"hfkvcisizmoaedsx\",\"clientId\":\"uivedwcgyeewxeiq\"},\"gaufcs\":{\"principalId\":\"u\",\"clientId\":\"ljdlrgmspl\"}}},\"systemData\":{\"createdBy\":\"new\",\"createdByType\":\"User\",\"createdAt\":\"2021-05-21T08:44:22Z\",\"lastModifiedBy\":\"pqanxrjkix\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-11-28T23:05:19Z\"},\"etag\":\"ypnyghshxc\",\"location\":\"lhkgmnsghp\",\"tags\":{\"jkhvyomacluzvxnq\":\"phdrw\",\"df\":\"hrpq\",\"xuifmcsypobkdqz\":\"mkoisqcssf\",\"dmxzjijpv\":\"dzsylollgtrczz\"},\"id\":\"aurkihcirlde\",\"name\":\"xrdcoxnbkkja\",\"type\":\"urnnqbnqbpiz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LogAnalyticsManager manager = LogAnalyticsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.workspaces().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lhkgmnsghp", response.iterator().next().location()); - Assertions.assertEquals("phdrw", response.iterator().next().tags().get("jkhvyomacluzvxnq")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("ypnyghshxc", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FOUR_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(1802278503, response.iterator().next().retentionInDays()); - Assertions.assertEquals(33.5739290982965D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - response.iterator().next().publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, - response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("knssqyzqed", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(false, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("omyqwcabvnuileey", response.iterator().next().defaultDataCollectionRuleResourceId()); - } -}