diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md index 9b3c85a23bad3..796342d080e23 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-01-05) +- Azure Resource Manager LogAnalytics client library for Java. This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.2 (2021-03-30) diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md index 275123ad963cf..c83951917aa6d 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-2020-08. 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-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-loganalytics - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md new file mode 100644 index 0000000000000..112e9d4ba356b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md @@ -0,0 +1,1508 @@ +# Code snippets and samples + + +## AvailableServiceTiers + +- [ListByWorkspace](#availableservicetiers_listbyworkspace) + +## Clusters + +- [CreateOrUpdate](#clusters_createorupdate) +- [Delete](#clusters_delete) +- [GetByResourceGroup](#clusters_getbyresourcegroup) +- [List](#clusters_list) +- [ListByResourceGroup](#clusters_listbyresourcegroup) +- [Update](#clusters_update) + +## DataExports + +- [CreateOrUpdate](#dataexports_createorupdate) +- [Delete](#dataexports_delete) +- [Get](#dataexports_get) +- [ListByWorkspace](#dataexports_listbyworkspace) + +## DataSources + +- [CreateOrUpdate](#datasources_createorupdate) +- [Delete](#datasources_delete) +- [Get](#datasources_get) +- [ListByWorkspace](#datasources_listbyworkspace) + +## DeletedWorkspaces + +- [List](#deletedworkspaces_list) +- [ListByResourceGroup](#deletedworkspaces_listbyresourcegroup) + +## Gateways + +- [Delete](#gateways_delete) + +## IntelligencePacks + +- [Disable](#intelligencepacks_disable) +- [Enable](#intelligencepacks_enable) +- [List](#intelligencepacks_list) + +## LinkedServices + +- [CreateOrUpdate](#linkedservices_createorupdate) +- [Delete](#linkedservices_delete) +- [Get](#linkedservices_get) +- [ListByWorkspace](#linkedservices_listbyworkspace) + +## LinkedStorageAccounts + +- [CreateOrUpdate](#linkedstorageaccounts_createorupdate) +- [Delete](#linkedstorageaccounts_delete) +- [Get](#linkedstorageaccounts_get) +- [ListByWorkspace](#linkedstorageaccounts_listbyworkspace) + +## ManagementGroups + +- [List](#managementgroups_list) + +## OperationStatuses + +- [Get](#operationstatuses_get) + +## Operations + +- [List](#operations_list) + +## SavedSearches + +- [CreateOrUpdate](#savedsearches_createorupdate) +- [Delete](#savedsearches_delete) +- [Get](#savedsearches_get) +- [ListByWorkspace](#savedsearches_listbyworkspace) + +## Schema + +- [Get](#schema_get) + +## SharedKeysOperation + +- [GetSharedKeys](#sharedkeysoperation_getsharedkeys) +- [Regenerate](#sharedkeysoperation_regenerate) + +## StorageInsightConfigs + +- [CreateOrUpdate](#storageinsightconfigs_createorupdate) +- [Delete](#storageinsightconfigs_delete) +- [Get](#storageinsightconfigs_get) +- [ListByWorkspace](#storageinsightconfigs_listbyworkspace) + +## Tables + +- [Create](#tables_create) +- [Get](#tables_get) +- [ListByWorkspace](#tables_listbyworkspace) +- [Update](#tables_update) + +## Usages + +- [List](#usages_list) + +## WorkspacePurge + +- [GetPurgeStatus](#workspacepurge_getpurgestatus) +- [Purge](#workspacepurge_purge) + +## Workspaces + +- [CreateOrUpdate](#workspaces_createorupdate) +- [Delete](#workspaces_delete) +- [GetByResourceGroup](#workspaces_getbyresourcegroup) +- [List](#workspaces_list) +- [ListByResourceGroup](#workspaces_listbyresourcegroup) +- [Update](#workspaces_update) +### AvailableServiceTiers_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for AvailableServiceTiers ListByWorkspace. */ +public final class AvailableServiceTiersListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesAvailableServiceTiers.json + */ + /** + * Sample code: AvailableServiceTiers. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void availableServiceTiers(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.availableServiceTiers().listByWorkspaceWithResponse("rg1", "workspace1", Context.NONE); + } +} +``` + +### 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. */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersCreate.json + */ + /** + * Sample code: ClustersCreate. + * + * @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(); + } + + @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; + } +} +``` + +### Clusters_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters Delete. */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersDelete.json + */ + /** + * Sample code: ClustersDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().delete("oiautorest6685", "oiautorest6685", Context.NONE); + } +} +``` + +### Clusters_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters GetByResourceGroup. */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersGet.json + */ + /** + * Sample code: ClustersGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE); + } +} +``` + +### Clusters_List + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters List. */ +public final class ClustersListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersSubscriptionList.json + */ + /** + * Sample code: ClustersSubscriptionList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().list(Context.NONE); + } +} +``` + +### Clusters_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters ListByResourceGroup. */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersListByResourceGroup.json + */ + /** + * Sample code: ClustersGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().listByResourceGroup("oiautorest6685", Context.NONE); + } +} +``` + +### Clusters_Update + +```java +import com.azure.core.util.Context; +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.Identity; +import com.azure.resourcemanager.loganalytics.models.IdentityType; +import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; +import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersUpdate.json + */ + /** + * Sample code: ClustersPatch. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("tag1", "val1")) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserIdentityProperties()))) + .withSku( + new ClusterSku() + .withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) + .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyVaultUri("https://aztest2170.vault.azure.net") + .withKeyName("aztest2170cert") + .withKeyVersion("654ft6c4e63845cbb50fd6fg51540429") + .withKeyRsaSize(1024)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DataExports_CreateOrUpdate + +```java +import java.util.Arrays; + +/** Samples for DataExports CreateOrUpdate. */ +public final class DataExportsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportCreateOrUpdate.json + */ + /** + * Sample code: DataExportCreate. + * + * @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(); + } +} +``` + +### DataExports_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DataExports Delete. */ +public final class DataExportsDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportDelete.json + */ + /** + * Sample code: DataExportDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataExportDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().deleteWithResponse("RgTest1", "DeWnTest1234", "export1", Context.NONE); + } +} +``` + +### DataExports_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DataExports Get. */ +public final class DataExportsGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportGet.json + */ + /** + * Sample code: DataExportGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().getWithResponse("RgTest1", "DeWnTest1234", "export1", Context.NONE); + } +} +``` + +### DataExports_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for DataExports ListByWorkspace. */ +public final class DataExportsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportListByWorkspace.json + */ + /** + * Sample code: DataExportGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().listByWorkspace("RgTest1", "DeWnTest1234", Context.NONE); + } +} +``` + +### 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; + +/** Samples for DataSources CreateOrUpdate. */ +public final class DataSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesCreate.json + */ + /** + * Sample code: DataSourcesCreate. + * + * @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) + .create(); + } +} +``` + +### DataSources_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DataSources Delete. */ +public final class DataSourcesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesDelete.json + */ + /** + * Sample code: DataSourcesDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataSourcesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataSources().deleteWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", Context.NONE); + } +} +``` + +### DataSources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DataSources Get. */ +public final class DataSourcesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesGet.json + */ + /** + * Sample code: DataSourcesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataSourcesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataSources().getWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", Context.NONE); + } +} +``` + +### DataSources_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for DataSources ListByWorkspace. */ +public final class DataSourcesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesListByWorkspace.json + */ + /** + * Sample code: DataSourcesListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataSourcesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .dataSources() + .listByWorkspace("OIAutoRest5123", "AzTest9724", "kind='WindowsEvent'", null, Context.NONE); + } +} +``` + +### DeletedWorkspaces_List + +```java +import com.azure.core.util.Context; + +/** Samples for DeletedWorkspaces List. */ +public final class DeletedWorkspacesListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesSubscriptionList.json + */ + /** + * Sample code: WorkspacesSubscriptionList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.deletedWorkspaces().list(Context.NONE); + } +} +``` + +### DeletedWorkspaces_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DeletedWorkspaces ListByResourceGroup. */ +public final class DeletedWorkspacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesListByResourceGroup.json + */ + /** + * Sample code: WorkspacesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.deletedWorkspaces().listByResourceGroup("oiautorest6685", Context.NONE); + } +} +``` + +### Gateways_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Gateways Delete. */ +public final class GatewaysDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGatewaysDelete.json + */ + /** + * Sample code: DeleteGateways. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void deleteGateways(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .gateways() + .deleteWithResponse("OIAutoRest5123", "aztest5048", "00000000-0000-0000-0000-00000000000", Context.NONE); + } +} +``` + +### IntelligencePacks_Disable + +```java +import com.azure.core.util.Context; + +/** Samples for IntelligencePacks Disable. */ +public final class IntelligencePacksDisableSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDisableIntelligencePack.json + */ + /** + * Sample code: IntelligencePacksDisable. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void intelligencePacksDisable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks().disableWithResponse("rg1", "TestLinkWS", "ChangeTracking", Context.NONE); + } +} +``` + +### IntelligencePacks_Enable + +```java +import com.azure.core.util.Context; + +/** Samples for IntelligencePacks Enable. */ +public final class IntelligencePacksEnableSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesEnableIntelligencePack.json + */ + /** + * Sample code: IntelligencePacksEnable. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void intelligencePacksEnable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks().enableWithResponse("rg1", "TestLinkWS", "ChangeTracking", Context.NONE); + } +} +``` + +### IntelligencePacks_List + +```java +import com.azure.core.util.Context; + +/** Samples for IntelligencePacks List. */ +public final class IntelligencePacksListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListIntelligencePacks.json + */ + /** + * Sample code: IntelligencePacksList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void intelligencePacksList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks().listWithResponse("rg1", "TestLinkWS", Context.NONE); + } +} +``` + +### LinkedServices_CreateOrUpdate + +```java +/** Samples for LinkedServices CreateOrUpdate. */ +public final class LinkedServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesCreate.json + */ + /** + * Sample code: LinkedServicesCreate. + * + * @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") + .create(); + } +} +``` + +### LinkedServices_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for LinkedServices Delete. */ +public final class LinkedServicesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesDelete.json + */ + /** + * Sample code: LinkedServicesDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void linkedServicesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices().delete("rg1", "TestLinkWS", "Cluster", Context.NONE); + } +} +``` + +### LinkedServices_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LinkedServices Get. */ +public final class LinkedServicesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-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", Context.NONE); + } +} +``` + +### LinkedServices_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for LinkedServices ListByWorkspace. */ +public final class LinkedServicesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesListByWorkspace.json + */ + /** + * Sample code: LinkedServicesListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void linkedServicesListByWorkspace( + com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices().listByWorkspace("mms-eus", "TestLinkWS", Context.NONE); + } +} +``` + +### LinkedStorageAccounts_CreateOrUpdate + +```java +import com.azure.resourcemanager.loganalytics.models.DataSourceType; +import java.util.Arrays; + +/** Samples for LinkedStorageAccounts CreateOrUpdate. */ +public final class LinkedStorageAccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsCreate.json + */ + /** + * Sample code: LinkedStorageAccountsCreate. + * + * @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(); + } +} +``` + +### LinkedStorageAccounts_Delete + +```java +import com.azure.core.util.Context; +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/2020-08-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, Context.NONE); + } +} +``` + +### LinkedStorageAccounts_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.models.DataSourceType; + +/** Samples for LinkedStorageAccounts Get. */ +public final class LinkedStorageAccountsGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsGet.json + */ + /** + * Sample code: LinkedStorageAccountsGet. + * + * @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, Context.NONE); + } +} +``` + +### LinkedStorageAccounts_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for LinkedStorageAccounts ListByWorkspace. */ +public final class LinkedStorageAccountsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsListByWorkspace.json + */ + /** + * Sample code: Gets list of linked storage accounts on a workspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void getsListOfLinkedStorageAccountsOnAWorkspace( + com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedStorageAccounts().listByWorkspace("mms-eus", "testLinkStorageAccountsWS", Context.NONE); + } +} +``` + +### ManagementGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagementGroups List. */ +public final class ManagementGroupsListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json + */ + /** + * Sample code: WorkspacesListManagementGroups. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesListManagementGroups( + com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.managementGroups().list("rg1", "TestLinkWS", Context.NONE); + } +} +``` + +### OperationStatuses_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationStatuses Get. */ +public final class OperationStatusesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.json + */ + /** + * Sample code: Get specific operation status. + * + * @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", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-10-01/examples/OperationsListByTenant.json + */ + /** + * Sample code: Get specific operation status. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void getSpecificOperationStatus(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### SavedSearches_CreateOrUpdate + +```java +import com.azure.resourcemanager.loganalytics.models.Tag; +import java.util.Arrays; + +/** Samples for SavedSearches CreateOrUpdate. */ +public final class SavedSearchesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json + */ + /** + * Sample code: SavedSearchCreateOrUpdate. + * + * @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(); + } +} +``` + +### SavedSearches_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SavedSearches Delete. */ +public final class SavedSearchesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDeleteSavedSearches.json + */ + /** + * Sample code: SavedSearchesDelete. + * + * @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", Context.NONE); + } +} +``` + +### SavedSearches_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SavedSearches Get. */ +public final class SavedSearchesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesGet.json + */ + /** + * Sample code: SavedSearchesGet. + * + * @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", Context.NONE); + } +} +``` + +### SavedSearches_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for SavedSearches ListByWorkspace. */ +public final class SavedSearchesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesListByWorkspace.json + */ + /** + * Sample code: SavedSearchesList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void savedSearchesList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.savedSearches().listByWorkspaceWithResponse("TestRG", "TestWS", Context.NONE); + } +} +``` + +### Schema_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Schema Get. */ +public final class SchemaGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesGetSchema.json + */ + /** + * Sample code: WorkspacesGetSchema. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesGetSchema(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.schemas().getWithResponse("mms-eus", "atlantisdemo", Context.NONE); + } +} +``` + +### SharedKeysOperation_GetSharedKeys + +```java +import com.azure.core.util.Context; + +/** Samples for SharedKeysOperation GetSharedKeys. */ +public final class SharedKeysOperationGetSharedKeysSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGetSharedKeys.json + */ + /** + * Sample code: SharedKeysList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void sharedKeysList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.sharedKeysOperations().getSharedKeysWithResponse("rg1", "TestLinkWS", Context.NONE); + } +} +``` + +### SharedKeysOperation_Regenerate + +```java +import com.azure.core.util.Context; + +/** Samples for SharedKeysOperation Regenerate. */ +public final class SharedKeysOperationRegenerateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesRegenerateSharedKeys.json + */ + /** + * Sample code: RegenerateSharedKeys. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void regenerateSharedKeys(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.sharedKeysOperations().regenerateWithResponse("rg1", "workspace1", Context.NONE); + } +} +``` + +### StorageInsightConfigs_CreateOrUpdate + +```java +import com.azure.resourcemanager.loganalytics.models.StorageAccount; +import java.util.Arrays; + +/** Samples for StorageInsightConfigs CreateOrUpdate. */ +public final class StorageInsightConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsCreateOrUpdate.json + */ + /** + * Sample code: StorageInsightsCreate. + * + * @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("1234")) + .create(); + } +} +``` + +### StorageInsightConfigs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for StorageInsightConfigs Delete. */ +public final class StorageInsightConfigsDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsDelete.json + */ + /** + * Sample code: StorageInsightsDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void storageInsightsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .storageInsightConfigs() + .deleteWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", Context.NONE); + } +} +``` + +### StorageInsightConfigs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for StorageInsightConfigs Get. */ +public final class StorageInsightConfigsGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsGet.json + */ + /** + * Sample code: StorageInsightsGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void storageInsightsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs().getWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", Context.NONE); + } +} +``` + +### StorageInsightConfigs_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for StorageInsightConfigs ListByWorkspace. */ +public final class StorageInsightConfigsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsListByWorkspace.json + */ + /** + * Sample code: StorageInsightsList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void storageInsightsList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs().listByWorkspace("OIAutoRest5123", "aztest5048", Context.NONE); + } +} +``` + +### Tables_Create + +```java +/** Samples for Tables Create. */ +public final class TablesCreateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesCreate.json + */ + /** + * Sample code: TablesSet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesSet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .tables() + .define("table1") + .withExistingWorkspace("oiautorest6685", "oiautorest6685") + .withRetentionInDays(40) + .withIsTroubleshootEnabled(false) + .create(); + } +} +``` + +### Tables_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Tables Get. */ +public final class TablesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesGet.json + */ + /** + * Sample code: TablesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables().getWithResponse("oiautorest6685", "oiautorest6685", "table1", Context.NONE); + } +} +``` + +### Tables_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for Tables ListByWorkspace. */ +public final class TablesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesList.json + */ + /** + * Sample code: TablesListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables().listByWorkspace("oiautorest6685", "oiautorest6685", Context.NONE); + } +} +``` + +### Tables_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.models.Table; + +/** Samples for Tables Update. */ +public final class TablesUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesUpdate.json + */ + /** + * Sample code: TablesSet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesSet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Table resource = + manager.tables().getWithResponse("oiautorest6685", "oiautorest6685", "table1", Context.NONE).getValue(); + resource.update().withRetentionInDays(40).withIsTroubleshootEnabled(true).apply(); + } +} +``` + +### Usages_List + +```java +import com.azure.core.util.Context; + +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-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", Context.NONE); + } +} +``` + +### WorkspacePurge_GetPurgeStatus + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspacePurge GetPurgeStatus. */ +public final class WorkspacePurgeGetPurgeStatusSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeOperation.json + */ + /** + * Sample code: WorkspacePurgeOperation. + * + * @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", Context.NONE); + } +} +``` + +### WorkspacePurge_Purge + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBody; +import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBodyFilters; +import java.util.Arrays; + +/** Samples for WorkspacePurge Purge. */ +public final class WorkspacePurgePurgeSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-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"))), + Context.NONE); + } +} +``` + +### Workspaces_CreateOrUpdate + +```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 Workspaces CreateOrUpdate. */ +public final class WorkspacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesCreate.json + */ + /** + * Sample code: WorkspacesCreate. + * + * @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(); + } + + @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; + } +} +``` + +### Workspaces_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces Delete. */ +public final class WorkspacesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesDelete.json + */ + /** + * Sample code: WorkspacesDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().delete("oiautorest6685", "oiautorest6685", null, Context.NONE); + } +} +``` + +### Workspaces_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces GetByResourceGroup. */ +public final class WorkspacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesGet.json + */ + /** + * Sample code: WorkspaceGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspaceGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE); + } +} +``` + +### Workspaces_List + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces List. */ +public final class WorkspacesListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesSubscriptionList.json + */ + /** + * Sample code: WorkspacesSubscriptionList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().list(Context.NONE); + } +} +``` + +### Workspaces_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces ListByResourceGroup. */ +public final class WorkspacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesListByResourceGroup.json + */ + /** + * Sample code: WorkspacesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().listByResourceGroup("oiautorest6685", Context.NONE); + } +} +``` + +### Workspaces_Update + +```java +import com.azure.core.util.Context; +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 Workspaces Update. */ +public final class WorkspacesUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesUpdate.json + */ + /** + * Sample code: WorkspacesPatch. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Workspace resource = + manager + .workspaces() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE) + .getValue(); + resource + .update() + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018)) + .withRetentionInDays(30) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(-1.0)) + .apply(); + } +} +``` + diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml index cbf921576d272..f5b03cfc0cc88 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml @@ -1,58 +1,81 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-loganalytics - 1.0.0-beta.3 - jar + com.azure.resourcemanager + azure-resourcemanager-loganalytics + 1.0.0-beta.3 + 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-2020-08. - https://github.com/Azure/azure-sdk-for-java + 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-2021-06. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true false - - - - com.azure - azure-core - 1.23.1 - - - com.azure - azure-core-management - 1.4.4 - - + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-management + 1.4.4 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/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 376975bad8cd4..7da3134922dc0 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 @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -67,6 +68,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to LogAnalyticsManager. Operational Insights Client. */ public final class LogAnalyticsManager { @@ -82,20 +84,12 @@ public final class LogAnalyticsManager { private ManagementGroups managementGroups; - private Operations operations; - private OperationStatuses operationStatuses; private SharedKeysOperations sharedKeysOperations; private Usages usages; - private Workspaces workspaces; - - private DeletedWorkspaces deletedWorkspaces; - - private Clusters clusters; - private StorageInsightConfigs storageInsightConfigs; private SavedSearches savedSearches; @@ -108,8 +102,16 @@ public final class LogAnalyticsManager { private WorkspacePurges workspacePurges; + private Operations operations; + private Tables tables; + private Clusters clusters; + + private Workspaces workspaces; + + private DeletedWorkspaces deletedWorkspaces; + private final OperationalInsightsManagementClient clientObject; private LogAnalyticsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -153,6 +155,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -192,6 +195,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -234,7 +248,7 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.loganalytics") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -248,19 +262,33 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -320,14 +348,6 @@ public ManagementGroups managementGroups() { return managementGroups; } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - /** @return Resource collection API of OperationStatuses. */ public OperationStatuses operationStatuses() { if (this.operationStatuses == null) { @@ -352,30 +372,6 @@ public Usages usages() { return usages; } - /** @return Resource collection API of Workspaces. */ - public Workspaces workspaces() { - if (this.workspaces == null) { - this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); - } - return workspaces; - } - - /** @return Resource collection API of DeletedWorkspaces. */ - public DeletedWorkspaces deletedWorkspaces() { - if (this.deletedWorkspaces == null) { - this.deletedWorkspaces = new DeletedWorkspacesImpl(clientObject.getDeletedWorkspaces(), this); - } - return deletedWorkspaces; - } - - /** @return Resource collection API of Clusters. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); - } - return clusters; - } - /** @return Resource collection API of StorageInsightConfigs. */ public StorageInsightConfigs storageInsightConfigs() { if (this.storageInsightConfigs == null) { @@ -424,6 +420,14 @@ public WorkspacePurges workspacePurges() { return workspacePurges; } + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + /** @return Resource collection API of Tables. */ public Tables tables() { if (this.tables == null) { @@ -432,6 +436,30 @@ public Tables tables() { return tables; } + /** @return Resource collection API of Clusters. */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** @return Resource collection API of Workspaces. */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); + } + return workspaces; + } + + /** @return Resource collection API of DeletedWorkspaces. */ + public DeletedWorkspaces deletedWorkspaces() { + if (this.deletedWorkspaces == null) { + this.deletedWorkspaces = new DeletedWorkspacesImpl(clientObject.getDeletedWorkspaces(), this); + } + return deletedWorkspaces; + } + /** * @return 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/ClustersClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/ClustersClient.java index ea21003519bd9..259b0cf472262 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/ClustersClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/ClustersClient.java @@ -74,7 +74,7 @@ public interface ClustersClient { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Log Analytics cluster resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, ClusterInner parameters); @@ -90,7 +90,7 @@ SyncPoller, ClusterInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Log Analytics cluster resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, ClusterInner parameters, Context context); @@ -133,7 +133,7 @@ SyncPoller, ClusterInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); /** @@ -147,7 +147,7 @@ SyncPoller, ClusterInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); /** @@ -203,6 +203,37 @@ SyncPoller, ClusterInner> beginCreateOrUpdate( Response getByResourceGroupWithResponse( String resourceGroupName, String clusterName, Context context); + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 top level Log Analytics cluster resource container. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterPatch parameters); + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 top level Log Analytics cluster resource container. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterPatch parameters, Context context); + /** * Updates a Log Analytics cluster. * @@ -230,6 +261,5 @@ Response getByResourceGroupWithResponse( * @return the top level Log Analytics cluster resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch parameters, Context context); + ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch parameters, Context context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/LinkedServicesClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/LinkedServicesClient.java index 52d5ed5467598..1d5e4b1f207b2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/LinkedServicesClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/LinkedServicesClient.java @@ -27,7 +27,7 @@ public interface LinkedServicesClient { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LinkedServiceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters); @@ -44,7 +44,7 @@ SyncPoller, LinkedServiceInner> beginCreateOrUpda * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LinkedServiceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, @@ -100,7 +100,7 @@ LinkedServiceInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LinkedServiceInner> beginDelete( String resourceGroupName, String workspaceName, String linkedServiceName); @@ -116,7 +116,7 @@ SyncPoller, LinkedServiceInner> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LinkedServiceInner> beginDelete( String resourceGroupName, String workspaceName, String linkedServiceName, Context context); 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 ecb9e1ead6dc4..fd7c63d5581cb 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 @@ -23,13 +23,6 @@ public interface OperationalInsightsManagementClient { */ String getEndpoint(); - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - /** * Gets The HTTP pipeline to send requests through. * @@ -86,13 +79,6 @@ public interface OperationalInsightsManagementClient { */ ManagementGroupsClient getManagementGroups(); - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - /** * Gets the OperationStatusesClient object to access its operations. * @@ -114,27 +100,6 @@ public interface OperationalInsightsManagementClient { */ UsagesClient getUsages(); - /** - * Gets the WorkspacesClient object to access its operations. - * - * @return the WorkspacesClient object. - */ - WorkspacesClient getWorkspaces(); - - /** - * Gets the DeletedWorkspacesClient object to access its operations. - * - * @return the DeletedWorkspacesClient object. - */ - DeletedWorkspacesClient getDeletedWorkspaces(); - - /** - * Gets the ClustersClient object to access its operations. - * - * @return the ClustersClient object. - */ - ClustersClient getClusters(); - /** * Gets the StorageInsightConfigsClient object to access its operations. * @@ -177,10 +142,38 @@ public interface OperationalInsightsManagementClient { */ WorkspacePurgesClient getWorkspacePurges(); + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + /** * Gets the TablesClient object to access its operations. * * @return the TablesClient object. */ TablesClient getTables(); + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + WorkspacesClient getWorkspaces(); + + /** + * Gets the DeletedWorkspacesClient object to access its operations. + * + * @return the DeletedWorkspacesClient object. + */ + DeletedWorkspacesClient getDeletedWorkspaces(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/TablesClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/TablesClient.java index 0f784c4e5ca99..995f7c83cc5b2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/TablesClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/TablesClient.java @@ -72,6 +72,38 @@ public interface TablesClient { Response updateWithResponse( String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context); + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param parameters The parameters required to update table properties. + * @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 workspace data table definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableInner create(String resourceGroupName, String workspaceName, String tableName, TableInner parameters); + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param parameters The parameters required to update table properties. + * @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 workspace data table definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context); + /** * Gets a Log Analytics workspace table. * 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 e73903b64ee25..4ad98f4970e39 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 @@ -74,7 +74,7 @@ public interface WorkspacesClient { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Workspace resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkspaceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, WorkspaceInner parameters); @@ -90,7 +90,7 @@ SyncPoller, WorkspaceInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Workspace resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkspaceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context); @@ -138,7 +138,7 @@ WorkspaceInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Boolean force); /** @@ -156,7 +156,7 @@ WorkspaceInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String workspaceName, Boolean force, 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 d5bc163290d33..ea767cfab7d8f 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 @@ -5,21 +5,23 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.AssociatedWorkspace; +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.ClusterSku; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** The top level Log Analytics cluster resource container. */ -@JsonFlatten @Fluent -public class ClusterInner extends Resource { +public final class ClusterInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); /* @@ -35,28 +37,10 @@ public class ClusterInner extends Resource { private ClusterSku sku; /* - * The link used to get the next page of recommendations. + * Log Analytics cluster properties. */ - @JsonProperty(value = "properties.nextLink") - private String nextLink; - - /* - * The ID associated with the cluster. - */ - @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) - private String clusterId; - - /* - * The provisioning state of the cluster. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ClusterEntityStatus provisioningState; - - /* - * The associated key properties. - */ - @JsonProperty(value = "properties.keyVaultProperties") - private KeyVaultProperties keyVaultProperties; + @JsonProperty(value = "properties") + private ClusterProperties innerProperties; /** * Get the identity property: The identity of the resource. @@ -99,22 +83,25 @@ public ClusterInner withSku(ClusterSku sku) { } /** - * Get the nextLink property: The link used to get the next page of recommendations. + * Get the innerProperties property: Log Analytics cluster properties. * - * @return the nextLink value. + * @return the innerProperties value. */ - public String nextLink() { - return this.nextLink; + private ClusterProperties innerProperties() { + return this.innerProperties; } - /** - * Set the nextLink property: The link used to get the next page of recommendations. - * - * @param nextLink the nextLink value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withNextLink(String nextLink) { - this.nextLink = nextLink; + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -124,7 +111,7 @@ public ClusterInner withNextLink(String nextLink) { * @return the clusterId value. */ public String clusterId() { - return this.clusterId; + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); } /** @@ -133,7 +120,82 @@ public String clusterId() { * @return the provisioningState value. */ public ClusterEntityStatus provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the isDoubleEncryptionEnabled property: Configures whether cluster will use double encryption. This Property + * can not be modified after cluster creation. Default value is 'true'. + * + * @return the isDoubleEncryptionEnabled value. + */ + public Boolean isDoubleEncryptionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isDoubleEncryptionEnabled(); + } + + /** + * Set the isDoubleEncryptionEnabled property: Configures whether cluster will use double encryption. This Property + * can not be modified after cluster creation. Default value is 'true'. + * + * @param isDoubleEncryptionEnabled the isDoubleEncryptionEnabled value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withIsDoubleEncryptionEnabled(Boolean isDoubleEncryptionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withIsDoubleEncryptionEnabled(isDoubleEncryptionEnabled); + return this; + } + + /** + * Get the isAvailabilityZonesEnabled property: Sets whether the cluster will support availability zones. This can + * be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be + * modified after cluster creation. Default value is 'true' if region supports Availability Zones. + * + * @return the isAvailabilityZonesEnabled value. + */ + public Boolean isAvailabilityZonesEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isAvailabilityZonesEnabled(); + } + + /** + * Set the isAvailabilityZonesEnabled property: Sets whether the cluster will support availability zones. This can + * be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be + * modified after cluster creation. Default value is 'true' if region supports Availability Zones. + * + * @param isAvailabilityZonesEnabled the isAvailabilityZonesEnabled value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withIsAvailabilityZonesEnabled(isAvailabilityZonesEnabled); + return this; + } + + /** + * Get the billingType property: The cluster's billing type. + * + * @return the billingType value. + */ + public BillingType billingType() { + return this.innerProperties() == null ? null : this.innerProperties().billingType(); + } + + /** + * Set the billingType property: The cluster's billing type. + * + * @param billingType the billingType value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withBillingType(BillingType billingType) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withBillingType(billingType); + return this; } /** @@ -142,7 +204,7 @@ public ClusterEntityStatus provisioningState() { * @return the keyVaultProperties value. */ public KeyVaultProperties keyVaultProperties() { - return this.keyVaultProperties; + return this.innerProperties() == null ? null : this.innerProperties().keyVaultProperties(); } /** @@ -152,21 +214,74 @@ public KeyVaultProperties keyVaultProperties() { * @return the ClusterInner object itself. */ public ClusterInner withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { - this.keyVaultProperties = keyVaultProperties; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withKeyVaultProperties(keyVaultProperties); return this; } - /** {@inheritDoc} */ - @Override - public ClusterInner withLocation(String location) { - super.withLocation(location); + /** + * Get the lastModifiedDate property: The last time the cluster was updated. + * + * @return the lastModifiedDate value. + */ + public String lastModifiedDate() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDate(); + } + + /** + * Get the createdDate property: The cluster creation time. + * + * @return the createdDate value. + */ + public String createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Get the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. + * + * @return the associatedWorkspaces value. + */ + public List associatedWorkspaces() { + return this.innerProperties() == null ? null : this.innerProperties().associatedWorkspaces(); + } + + /** + * Set the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. + * + * @param associatedWorkspaces the associatedWorkspaces value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAssociatedWorkspaces(List associatedWorkspaces) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAssociatedWorkspaces(associatedWorkspaces); return this; } - /** {@inheritDoc} */ - @Override - public ClusterInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the capacityReservationProperties property: Additional properties for capacity reservation. + * + * @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 withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withCapacityReservationProperties(capacityReservationProperties); return this; } @@ -182,8 +297,8 @@ public void validate() { if (sku() != null) { sku().validate(); } - if (keyVaultProperties() != null) { - keyVaultProperties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterPatchProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterPatchProperties.java new file mode 100644 index 0000000000000..b52450fbc7b4b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterPatchProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.BillingType; +import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log Analytics cluster patch properties. */ +@Fluent +public final class ClusterPatchProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPatchProperties.class); + + /* + * The associated key properties. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /* + * The cluster's billing type. + */ + @JsonProperty(value = "billingType") + private BillingType billingType; + + /** + * Get the keyVaultProperties property: The associated key properties. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The associated key properties. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the billingType property: The cluster's billing type. + * + * @return the billingType value. + */ + public BillingType billingType() { + return this.billingType; + } + + /** + * Set the billingType property: The cluster's billing type. + * + * @param billingType the billingType value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withBillingType(BillingType billingType) { + this.billingType = billingType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..1a7d213a19874 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java @@ -0,0 +1,266 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.AssociatedWorkspace; +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.KeyVaultProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster properties. */ +@Fluent +public final class ClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterProperties.class); + + /* + * The ID associated with the cluster. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The provisioning state of the cluster. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterEntityStatus provisioningState; + + /* + * Configures whether cluster will use double encryption. This Property can + * not be modified after cluster creation. Default value is 'true' + */ + @JsonProperty(value = "isDoubleEncryptionEnabled") + private Boolean isDoubleEncryptionEnabled; + + /* + * Sets whether the cluster will support availability zones. This can be + * set as true only in regions where Azure Data Explorer support + * Availability Zones. This Property can not be modified after cluster + * creation. Default value is 'true' if region supports Availability Zones. + */ + @JsonProperty(value = "isAvailabilityZonesEnabled") + private Boolean isAvailabilityZonesEnabled; + + /* + * The cluster's billing type. + */ + @JsonProperty(value = "billingType") + private BillingType billingType; + + /* + * The associated key properties. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /* + * The last time the cluster was updated. + */ + @JsonProperty(value = "lastModifiedDate", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedDate; + + /* + * The cluster creation time + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /* + * The list of Log Analytics workspaces associated with the cluster + */ + @JsonProperty(value = "associatedWorkspaces") + private List associatedWorkspaces; + + /* + * Additional properties for capacity reservation + */ + @JsonProperty(value = "capacityReservationProperties") + private CapacityReservationProperties capacityReservationProperties; + + /** + * Get the clusterId property: The ID associated with the cluster. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster. + * + * @return the provisioningState value. + */ + public ClusterEntityStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the isDoubleEncryptionEnabled property: Configures whether cluster will use double encryption. This Property + * can not be modified after cluster creation. Default value is 'true'. + * + * @return the isDoubleEncryptionEnabled value. + */ + public Boolean isDoubleEncryptionEnabled() { + return this.isDoubleEncryptionEnabled; + } + + /** + * Set the isDoubleEncryptionEnabled property: Configures whether cluster will use double encryption. This Property + * can not be modified after cluster creation. Default value is 'true'. + * + * @param isDoubleEncryptionEnabled the isDoubleEncryptionEnabled value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withIsDoubleEncryptionEnabled(Boolean isDoubleEncryptionEnabled) { + this.isDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + return this; + } + + /** + * Get the isAvailabilityZonesEnabled property: Sets whether the cluster will support availability zones. This can + * be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be + * modified after cluster creation. Default value is 'true' if region supports Availability Zones. + * + * @return the isAvailabilityZonesEnabled value. + */ + public Boolean isAvailabilityZonesEnabled() { + return this.isAvailabilityZonesEnabled; + } + + /** + * Set the isAvailabilityZonesEnabled property: Sets whether the cluster will support availability zones. This can + * be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be + * modified after cluster creation. Default value is 'true' if region supports Availability Zones. + * + * @param isAvailabilityZonesEnabled the isAvailabilityZonesEnabled value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + this.isAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + return this; + } + + /** + * Get the billingType property: The cluster's billing type. + * + * @return the billingType value. + */ + public BillingType billingType() { + return this.billingType; + } + + /** + * Set the billingType property: The cluster's billing type. + * + * @param billingType the billingType value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withBillingType(BillingType billingType) { + this.billingType = billingType; + return this; + } + + /** + * Get the keyVaultProperties property: The associated key properties. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The associated key properties. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the lastModifiedDate property: The last time the cluster was updated. + * + * @return the lastModifiedDate value. + */ + public String lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Get the createdDate property: The cluster creation time. + * + * @return the createdDate value. + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. + * + * @return the associatedWorkspaces value. + */ + public List 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. + * + * @return the capacityReservationProperties value. + */ + public CapacityReservationProperties capacityReservationProperties() { + return this.capacityReservationProperties; + } + + /** + * Set the capacityReservationProperties property: Additional properties for capacity reservation. + * + * @param capacityReservationProperties the capacityReservationProperties value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withCapacityReservationProperties( + CapacityReservationProperties capacityReservationProperties) { + this.capacityReservationProperties = capacityReservationProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (associatedWorkspaces() != null) { + associatedWorkspaces().forEach(e -> e.validate()); + } + if (capacityReservationProperties() != null) { + capacityReservationProperties().validate(); + } + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataExportInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataExportInner.java index 293aa39a13eab..6216e5fb8ce59 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataExportInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataExportInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.models.Type; @@ -14,60 +13,24 @@ import java.util.List; /** The top level data export resource container. */ -@JsonFlatten @Fluent -public class DataExportInner extends ProxyResource { +public final class DataExportInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DataExportInner.class); /* - * The data export rule ID. + * data export properties. */ - @JsonProperty(value = "properties.dataExportId") - private String dataExportId; + @JsonProperty(value = "properties") + private DataExportProperties innerProperties; - /* - * An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. - */ - @JsonProperty(value = "properties.tableNames") - private List tableNames; - - /* - * Active when enabled. - */ - @JsonProperty(value = "properties.enable") - private Boolean enable; - - /* - * The latest data export rule modification time. - */ - @JsonProperty(value = "properties.createdDate") - private String createdDate; - - /* - * Date and time when the export was last modified. - */ - @JsonProperty(value = "properties.lastModifiedDate") - private String lastModifiedDate; - - /* - * The destination resource ID. This can be copied from the Properties - * entry of the destination resource in Azure. - */ - @JsonProperty(value = "properties.destination.resourceId") - private String resourceId; - - /* - * The type of the destination resource - */ - @JsonProperty(value = "properties.destination.type", access = JsonProperty.Access.WRITE_ONLY) - private Type typePropertiesDestinationType; - - /* - * Optional. Allows to define an Event Hub name. Not applicable when - * destination is Storage Account. + /** + * Get the innerProperties property: data export properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.destination.metaData.eventHubName") - private String eventHubName; + private DataExportProperties innerProperties() { + return this.innerProperties; + } /** * Get the dataExportId property: The data export rule ID. @@ -75,7 +38,7 @@ public class DataExportInner extends ProxyResource { * @return the dataExportId value. */ public String dataExportId() { - return this.dataExportId; + return this.innerProperties() == null ? null : this.innerProperties().dataExportId(); } /** @@ -85,7 +48,10 @@ public String dataExportId() { * @return the DataExportInner object itself. */ public DataExportInner withDataExportId(String dataExportId) { - this.dataExportId = dataExportId; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportProperties(); + } + this.innerProperties().withDataExportId(dataExportId); return this; } @@ -95,7 +61,7 @@ public DataExportInner withDataExportId(String dataExportId) { * @return the tableNames value. */ public List tableNames() { - return this.tableNames; + return this.innerProperties() == null ? null : this.innerProperties().tableNames(); } /** @@ -105,7 +71,10 @@ public List tableNames() { * @return the DataExportInner object itself. */ public DataExportInner withTableNames(List tableNames) { - this.tableNames = tableNames; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportProperties(); + } + this.innerProperties().withTableNames(tableNames); return this; } @@ -115,7 +84,7 @@ public DataExportInner withTableNames(List tableNames) { * @return the enable value. */ public Boolean enable() { - return this.enable; + return this.innerProperties() == null ? null : this.innerProperties().enable(); } /** @@ -125,7 +94,10 @@ public Boolean enable() { * @return the DataExportInner object itself. */ public DataExportInner withEnable(Boolean enable) { - this.enable = enable; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportProperties(); + } + this.innerProperties().withEnable(enable); return this; } @@ -135,7 +107,7 @@ public DataExportInner withEnable(Boolean enable) { * @return the createdDate value. */ public String createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -145,7 +117,10 @@ public String createdDate() { * @return the DataExportInner object itself. */ public DataExportInner withCreatedDate(String createdDate) { - this.createdDate = createdDate; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportProperties(); + } + this.innerProperties().withCreatedDate(createdDate); return this; } @@ -155,7 +130,7 @@ public DataExportInner withCreatedDate(String createdDate) { * @return the lastModifiedDate value. */ public String lastModifiedDate() { - return this.lastModifiedDate; + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDate(); } /** @@ -165,7 +140,10 @@ public String lastModifiedDate() { * @return the DataExportInner object itself. */ public DataExportInner withLastModifiedDate(String lastModifiedDate) { - this.lastModifiedDate = lastModifiedDate; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportProperties(); + } + this.innerProperties().withLastModifiedDate(lastModifiedDate); return this; } @@ -176,7 +154,7 @@ public DataExportInner withLastModifiedDate(String lastModifiedDate) { * @return the resourceId value. */ public String resourceId() { - return this.resourceId; + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); } /** @@ -187,17 +165,20 @@ public String resourceId() { * @return the DataExportInner object itself. */ public DataExportInner withResourceId(String resourceId) { - this.resourceId = resourceId; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportProperties(); + } + this.innerProperties().withResourceId(resourceId); return this; } /** - * Get the typePropertiesDestinationType property: The type of the destination resource. + * Get the type property: The type of the destination resource. * - * @return the typePropertiesDestinationType value. + * @return the type value. */ - public Type typePropertiesDestinationType() { - return this.typePropertiesDestinationType; + public Type typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); } /** @@ -207,7 +188,7 @@ public Type typePropertiesDestinationType() { * @return the eventHubName value. */ public String eventHubName() { - return this.eventHubName; + return this.innerProperties() == null ? null : this.innerProperties().eventHubName(); } /** @@ -218,7 +199,10 @@ public String eventHubName() { * @return the DataExportInner object itself. */ public DataExportInner withEventHubName(String eventHubName) { - this.eventHubName = eventHubName; + if (this.innerProperties() == null) { + this.innerProperties = new DataExportProperties(); + } + this.innerProperties().withEventHubName(eventHubName); return this; } @@ -228,5 +212,8 @@ public DataExportInner withEventHubName(String eventHubName) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataExportProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataExportProperties.java new file mode 100644 index 0000000000000..e06783f826481 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataExportProperties.java @@ -0,0 +1,238 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.Type; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Export properties. */ +@Fluent +public final class DataExportProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataExportProperties.class); + + /* + * The data export rule ID. + */ + @JsonProperty(value = "dataExportId") + private String dataExportId; + + /* + * An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + */ + @JsonProperty(value = "tableNames", required = true) + private List tableNames; + + /* + * destination properties. + */ + @JsonProperty(value = "destination") + private Destination innerDestination; + + /* + * Active when enabled. + */ + @JsonProperty(value = "enable") + private Boolean enable; + + /* + * The latest data export rule modification time. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /* + * Date and time when the export was last modified. + */ + @JsonProperty(value = "lastModifiedDate") + private String lastModifiedDate; + + /** + * Get the dataExportId property: The data export rule ID. + * + * @return the dataExportId value. + */ + public String dataExportId() { + return this.dataExportId; + } + + /** + * Set the dataExportId property: The data export rule ID. + * + * @param dataExportId the dataExportId value to set. + * @return the DataExportProperties object itself. + */ + public DataExportProperties withDataExportId(String dataExportId) { + this.dataExportId = dataExportId; + return this; + } + + /** + * Get the tableNames property: An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + * + * @return the tableNames value. + */ + public List tableNames() { + return this.tableNames; + } + + /** + * Set the tableNames property: An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + * + * @param tableNames the tableNames value to set. + * @return the DataExportProperties object itself. + */ + public DataExportProperties withTableNames(List tableNames) { + this.tableNames = tableNames; + return this; + } + + /** + * Get the innerDestination property: destination properties. + * + * @return the innerDestination value. + */ + private Destination innerDestination() { + return this.innerDestination; + } + + /** + * Get the enable property: Active when enabled. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Active when enabled. + * + * @param enable the enable value to set. + * @return the DataExportProperties object itself. + */ + public DataExportProperties withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the createdDate property: The latest data export rule modification time. + * + * @return the createdDate value. + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The latest data export rule modification time. + * + * @param createdDate the createdDate value to set. + * @return the DataExportProperties object itself. + */ + public DataExportProperties withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the lastModifiedDate property: Date and time when the export was last modified. + * + * @return the lastModifiedDate value. + */ + public String lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Set the lastModifiedDate property: Date and time when the export was last modified. + * + * @param lastModifiedDate the lastModifiedDate value to set. + * @return the DataExportProperties object itself. + */ + public DataExportProperties withLastModifiedDate(String lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get the resourceId property: The destination resource ID. This can be copied from the Properties entry of the + * destination resource in Azure. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.innerDestination() == null ? null : this.innerDestination().resourceId(); + } + + /** + * Set the resourceId property: The destination resource ID. This can be copied from the Properties entry of the + * destination resource in Azure. + * + * @param resourceId the resourceId value to set. + * @return the DataExportProperties object itself. + */ + public DataExportProperties withResourceId(String resourceId) { + if (this.innerDestination() == null) { + this.innerDestination = new Destination(); + } + this.innerDestination().withResourceId(resourceId); + return this; + } + + /** + * Get the type property: The type of the destination resource. + * + * @return the type value. + */ + public Type type() { + return this.innerDestination() == null ? null : this.innerDestination().type(); + } + + /** + * Get the eventHubName property: Optional. Allows to define an Event Hub name. Not applicable when destination is + * Storage Account. + * + * @return the eventHubName value. + */ + public String eventHubName() { + return this.innerDestination() == null ? null : this.innerDestination().eventHubName(); + } + + /** + * Set the eventHubName property: Optional. Allows to define an Event Hub name. Not applicable when destination is + * Storage Account. + * + * @param eventHubName the eventHubName value to set. + * @return the DataExportProperties object itself. + */ + public DataExportProperties withEventHubName(String eventHubName) { + if (this.innerDestination() == null) { + this.innerDestination = new Destination(); + } + this.innerDestination().withEventHubName(eventHubName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tableNames() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tableNames in model DataExportProperties")); + } + if (innerDestination() != null) { + innerDestination().validate(); + } + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataSourceInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataSourceInner.java index df0abde01f4cd..7cf83485106b3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataSourceInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DataSourceInner.java @@ -9,6 +9,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.models.DataSourceKind; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -40,6 +41,7 @@ public final class DataSourceInner extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/Destination.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/Destination.java new file mode 100644 index 0000000000000..b0061aecc1e9c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/Destination.java @@ -0,0 +1,117 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.Type; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Destination properties. */ +@Fluent +public final class Destination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Destination.class); + + /* + * The destination resource ID. This can be copied from the Properties + * entry of the destination resource in Azure. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The type of the destination resource + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private Type type; + + /* + * destination meta data. + */ + @JsonProperty(value = "metaData") + private DestinationMetadata innerMetadata; + + /** + * Get the resourceId property: The destination resource ID. This can be copied from the Properties entry of the + * destination resource in Azure. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The destination resource ID. This can be copied from the Properties entry of the + * destination resource in Azure. + * + * @param resourceId the resourceId value to set. + * @return the Destination object itself. + */ + public Destination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the type property: The type of the destination resource. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Get the innerMetadata property: destination meta data. + * + * @return the innerMetadata value. + */ + private DestinationMetadata innerMetadata() { + return this.innerMetadata; + } + + /** + * Get the eventHubName property: Optional. Allows to define an Event Hub name. Not applicable when destination is + * Storage Account. + * + * @return the eventHubName value. + */ + public String eventHubName() { + return this.innerMetadata() == null ? null : this.innerMetadata().eventHubName(); + } + + /** + * Set the eventHubName property: Optional. Allows to define an Event Hub name. Not applicable when destination is + * Storage Account. + * + * @param eventHubName the eventHubName value to set. + * @return the Destination object itself. + */ + public Destination withEventHubName(String eventHubName) { + if (this.innerMetadata() == null) { + this.innerMetadata = new DestinationMetadata(); + } + this.innerMetadata().withEventHubName(eventHubName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model Destination")); + } + if (innerMetadata() != null) { + innerMetadata().validate(); + } + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DestinationMetadata.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DestinationMetadata.java new file mode 100644 index 0000000000000..6022ebda022d2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/DestinationMetadata.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Destination meta data. */ +@Fluent +public final class DestinationMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationMetadata.class); + + /* + * Optional. Allows to define an Event Hub name. Not applicable when + * destination is Storage Account. + */ + @JsonProperty(value = "eventHubName") + private String eventHubName; + + /** + * Get the eventHubName property: Optional. Allows to define an Event Hub name. Not applicable when destination is + * Storage Account. + * + * @return the eventHubName value. + */ + public String eventHubName() { + return this.eventHubName; + } + + /** + * Set the eventHubName property: Optional. Allows to define an Event Hub name. Not applicable when destination is + * Storage Account. + * + * @param eventHubName the eventHubName value to set. + * @return the DestinationMetadata object itself. + */ + public DestinationMetadata withEventHubName(String eventHubName) { + this.eventHubName = eventHubName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedServiceInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedServiceInner.java index 91c7206aaeba5..b90740304158b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedServiceInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedServiceInner.java @@ -5,45 +5,40 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The top level Linked service resource container. */ -@JsonFlatten @Fluent -public class LinkedServiceInner extends ProxyResource { +public final class LinkedServiceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedServiceInner.class); /* - * Resource tags. + * The properties of the linked service. */ - @JsonProperty(value = "tags") - private Map tags; + @JsonProperty(value = "properties", required = true) + private LinkedServiceProperties innerProperties = new LinkedServiceProperties(); /* - * The resource id of the resource that will be linked to the workspace. - * This should be used for linking resources which require read access - */ - @JsonProperty(value = "properties.resourceId") - private String resourceId; - - /* - * The resource id of the resource that will be linked to the workspace. - * This should be used for linking resources which require write access + * Resource tags. */ - @JsonProperty(value = "properties.writeAccessResourceId") - private String writeAccessResourceId; + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * The provisioning state of the linked service. + /** + * Get the innerProperties property: The properties of the linked service. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState") - private LinkedServiceEntityStatus provisioningState; + private LinkedServiceProperties innerProperties() { + return this.innerProperties; + } /** * Get the tags property: Resource tags. @@ -72,7 +67,7 @@ public LinkedServiceInner withTags(Map tags) { * @return the resourceId value. */ public String resourceId() { - return this.resourceId; + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); } /** @@ -83,7 +78,10 @@ public String resourceId() { * @return the LinkedServiceInner object itself. */ public LinkedServiceInner withResourceId(String resourceId) { - this.resourceId = resourceId; + if (this.innerProperties() == null) { + this.innerProperties = new LinkedServiceProperties(); + } + this.innerProperties().withResourceId(resourceId); return this; } @@ -94,7 +92,7 @@ public LinkedServiceInner withResourceId(String resourceId) { * @return the writeAccessResourceId value. */ public String writeAccessResourceId() { - return this.writeAccessResourceId; + return this.innerProperties() == null ? null : this.innerProperties().writeAccessResourceId(); } /** @@ -105,7 +103,10 @@ public String writeAccessResourceId() { * @return the LinkedServiceInner object itself. */ public LinkedServiceInner withWriteAccessResourceId(String writeAccessResourceId) { - this.writeAccessResourceId = writeAccessResourceId; + if (this.innerProperties() == null) { + this.innerProperties = new LinkedServiceProperties(); + } + this.innerProperties().withWriteAccessResourceId(writeAccessResourceId); return this; } @@ -115,7 +116,7 @@ public LinkedServiceInner withWriteAccessResourceId(String writeAccessResourceId * @return the provisioningState value. */ public LinkedServiceEntityStatus provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -125,7 +126,10 @@ public LinkedServiceEntityStatus provisioningState() { * @return the LinkedServiceInner object itself. */ public LinkedServiceInner withProvisioningState(LinkedServiceEntityStatus provisioningState) { - this.provisioningState = provisioningState; + if (this.innerProperties() == null) { + this.innerProperties = new LinkedServiceProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); return this; } @@ -135,5 +139,13 @@ public LinkedServiceInner withProvisioningState(LinkedServiceEntityStatus provis * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LinkedServiceInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedServiceProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedServiceProperties.java new file mode 100644 index 0000000000000..f8a2becbc4362 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedServiceProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.LinkedServiceEntityStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Linked service properties. */ +@Fluent +public final class LinkedServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedServiceProperties.class); + + /* + * The resource id of the resource that will be linked to the workspace. + * This should be used for linking resources which require read access + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The resource id of the resource that will be linked to the workspace. + * This should be used for linking resources which require write access + */ + @JsonProperty(value = "writeAccessResourceId") + private String writeAccessResourceId; + + /* + * The provisioning state of the linked service. + */ + @JsonProperty(value = "provisioningState") + private LinkedServiceEntityStatus provisioningState; + + /** + * Get the resourceId property: The resource id of the resource that will be linked to the workspace. This should be + * used for linking resources which require read access. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource id of the resource that will be linked to the workspace. This should be + * used for linking resources which require read access. + * + * @param resourceId the resourceId value to set. + * @return the LinkedServiceProperties object itself. + */ + public LinkedServiceProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the writeAccessResourceId property: The resource id of the resource that will be linked to the workspace. + * This should be used for linking resources which require write access. + * + * @return the writeAccessResourceId value. + */ + public String writeAccessResourceId() { + return this.writeAccessResourceId; + } + + /** + * Set the writeAccessResourceId property: The resource id of the resource that will be linked to the workspace. + * This should be used for linking resources which require write access. + * + * @param writeAccessResourceId the writeAccessResourceId value to set. + * @return the LinkedServiceProperties object itself. + */ + public LinkedServiceProperties withWriteAccessResourceId(String writeAccessResourceId) { + this.writeAccessResourceId = writeAccessResourceId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the linked service. + * + * @return the provisioningState value. + */ + public LinkedServiceEntityStatus provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the linked service. + * + * @param provisioningState the provisioningState value to set. + * @return the LinkedServiceProperties object itself. + */ + public LinkedServiceProperties withProvisioningState(LinkedServiceEntityStatus provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedStorageAccountsProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedStorageAccountsProperties.java new file mode 100644 index 0000000000000..d40d594340066 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedStorageAccountsProperties.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.DataSourceType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Linked storage accounts properties. */ +@Fluent +public final class LinkedStorageAccountsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedStorageAccountsProperties.class); + + /* + * Linked storage accounts type. + */ + @JsonProperty(value = "dataSourceType", access = JsonProperty.Access.WRITE_ONLY) + private DataSourceType dataSourceType; + + /* + * Linked storage accounts resources ids. + */ + @JsonProperty(value = "storageAccountIds") + private List storageAccountIds; + + /** + * Get the dataSourceType property: Linked storage accounts type. + * + * @return the dataSourceType value. + */ + public DataSourceType dataSourceType() { + return this.dataSourceType; + } + + /** + * Get the storageAccountIds property: Linked storage accounts resources ids. + * + * @return the storageAccountIds value. + */ + public List storageAccountIds() { + return this.storageAccountIds; + } + + /** + * Set the storageAccountIds property: Linked storage accounts resources ids. + * + * @param storageAccountIds the storageAccountIds value to set. + * @return the LinkedStorageAccountsProperties object itself. + */ + public LinkedStorageAccountsProperties withStorageAccountIds(List storageAccountIds) { + this.storageAccountIds = storageAccountIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedStorageAccountsResourceInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedStorageAccountsResourceInner.java index 01639e3857bc5..b13c16fe42e16 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedStorageAccountsResourceInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LinkedStorageAccountsResourceInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -14,22 +13,24 @@ import java.util.List; /** Linked storage accounts top level resource container. */ -@JsonFlatten @Fluent -public class LinkedStorageAccountsResourceInner extends ProxyResource { +public final class LinkedStorageAccountsResourceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedStorageAccountsResourceInner.class); /* - * Linked storage accounts type. + * Linked storage accounts properties. */ - @JsonProperty(value = "properties.dataSourceType", access = JsonProperty.Access.WRITE_ONLY) - private DataSourceType dataSourceType; + @JsonProperty(value = "properties", required = true) + private LinkedStorageAccountsProperties innerProperties = new LinkedStorageAccountsProperties(); - /* - * Linked storage accounts resources ids. + /** + * Get the innerProperties property: Linked storage accounts properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.storageAccountIds") - private List storageAccountIds; + private LinkedStorageAccountsProperties innerProperties() { + return this.innerProperties; + } /** * Get the dataSourceType property: Linked storage accounts type. @@ -37,7 +38,7 @@ public class LinkedStorageAccountsResourceInner extends ProxyResource { * @return the dataSourceType value. */ public DataSourceType dataSourceType() { - return this.dataSourceType; + return this.innerProperties() == null ? null : this.innerProperties().dataSourceType(); } /** @@ -46,7 +47,7 @@ public DataSourceType dataSourceType() { * @return the storageAccountIds value. */ public List storageAccountIds() { - return this.storageAccountIds; + return this.innerProperties() == null ? null : this.innerProperties().storageAccountIds(); } /** @@ -56,7 +57,10 @@ public List storageAccountIds() { * @return the LinkedStorageAccountsResourceInner object itself. */ public LinkedStorageAccountsResourceInner withStorageAccountIds(List storageAccountIds) { - this.storageAccountIds = storageAccountIds; + if (this.innerProperties() == null) { + this.innerProperties = new LinkedStorageAccountsProperties(); + } + this.innerProperties().withStorageAccountIds(storageAccountIds); return this; } @@ -66,5 +70,13 @@ public LinkedStorageAccountsResourceInner withStorageAccountIds(List sto * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LinkedStorageAccountsResourceInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ManagementGroupInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ManagementGroupInner.java index 210342b8a60f4..9e98c36c374c5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ManagementGroupInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ManagementGroupInner.java @@ -5,66 +5,30 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** A management group that is connected to a workspace. */ -@JsonFlatten @Fluent -public class ManagementGroupInner { +public final class ManagementGroupInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementGroupInner.class); /* - * The number of servers connected to the management group. + * The properties of the management group. */ - @JsonProperty(value = "properties.serverCount") - private Integer serverCount; + @JsonProperty(value = "properties") + private ManagementGroupProperties innerProperties; - /* - * Gets or sets a value indicating whether the management group is a - * gateway. - */ - @JsonProperty(value = "properties.isGateway") - private Boolean isGateway; - - /* - * The name of the management group. - */ - @JsonProperty(value = "properties.name") - private String name; - - /* - * The unique ID of the management group. - */ - @JsonProperty(value = "properties.id") - private String id; - - /* - * The datetime that the management group was created. - */ - @JsonProperty(value = "properties.created") - private OffsetDateTime created; - - /* - * The last datetime that the management group received data. - */ - @JsonProperty(value = "properties.dataReceived") - private OffsetDateTime dataReceived; - - /* - * The version of System Center that is managing the management group. - */ - @JsonProperty(value = "properties.version") - private String version; - - /* - * The SKU of System Center that is managing the management group. + /** + * Get the innerProperties property: The properties of the management group. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.sku") - private String sku; + private ManagementGroupProperties innerProperties() { + return this.innerProperties; + } /** * Get the serverCount property: The number of servers connected to the management group. @@ -72,7 +36,7 @@ public class ManagementGroupInner { * @return the serverCount value. */ public Integer serverCount() { - return this.serverCount; + return this.innerProperties() == null ? null : this.innerProperties().serverCount(); } /** @@ -82,7 +46,10 @@ public Integer serverCount() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withServerCount(Integer serverCount) { - this.serverCount = serverCount; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withServerCount(serverCount); return this; } @@ -92,7 +59,7 @@ public ManagementGroupInner withServerCount(Integer serverCount) { * @return the isGateway value. */ public Boolean isGateway() { - return this.isGateway; + return this.innerProperties() == null ? null : this.innerProperties().isGateway(); } /** @@ -102,7 +69,10 @@ public Boolean isGateway() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withIsGateway(Boolean isGateway) { - this.isGateway = isGateway; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withIsGateway(isGateway); return this; } @@ -112,7 +82,7 @@ public ManagementGroupInner withIsGateway(Boolean isGateway) { * @return the name value. */ public String name() { - return this.name; + return this.innerProperties() == null ? null : this.innerProperties().name(); } /** @@ -122,7 +92,10 @@ public String name() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withName(String name) { - this.name = name; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withName(name); return this; } @@ -132,7 +105,7 @@ public ManagementGroupInner withName(String name) { * @return the id value. */ public String id() { - return this.id; + return this.innerProperties() == null ? null : this.innerProperties().id(); } /** @@ -142,7 +115,10 @@ public String id() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withId(String id) { - this.id = id; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withId(id); return this; } @@ -152,7 +128,7 @@ public ManagementGroupInner withId(String id) { * @return the created value. */ public OffsetDateTime created() { - return this.created; + return this.innerProperties() == null ? null : this.innerProperties().created(); } /** @@ -162,7 +138,10 @@ public OffsetDateTime created() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withCreated(OffsetDateTime created) { - this.created = created; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withCreated(created); return this; } @@ -172,7 +151,7 @@ public ManagementGroupInner withCreated(OffsetDateTime created) { * @return the dataReceived value. */ public OffsetDateTime dataReceived() { - return this.dataReceived; + return this.innerProperties() == null ? null : this.innerProperties().dataReceived(); } /** @@ -182,7 +161,10 @@ public OffsetDateTime dataReceived() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withDataReceived(OffsetDateTime dataReceived) { - this.dataReceived = dataReceived; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withDataReceived(dataReceived); return this; } @@ -192,7 +174,7 @@ public ManagementGroupInner withDataReceived(OffsetDateTime dataReceived) { * @return the version value. */ public String version() { - return this.version; + return this.innerProperties() == null ? null : this.innerProperties().version(); } /** @@ -202,7 +184,10 @@ public String version() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withVersion(String version) { - this.version = version; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withVersion(version); return this; } @@ -212,7 +197,7 @@ public ManagementGroupInner withVersion(String version) { * @return the sku value. */ public String sku() { - return this.sku; + return this.innerProperties() == null ? null : this.innerProperties().sku(); } /** @@ -222,7 +207,10 @@ public String sku() { * @return the ManagementGroupInner object itself. */ public ManagementGroupInner withSku(String sku) { - this.sku = sku; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupProperties(); + } + this.innerProperties().withSku(sku); return this; } @@ -232,5 +220,8 @@ public ManagementGroupInner withSku(String sku) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ManagementGroupProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ManagementGroupProperties.java new file mode 100644 index 0000000000000..4bd9823d638af --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ManagementGroupProperties.java @@ -0,0 +1,234 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Management group properties. */ +@Fluent +public final class ManagementGroupProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementGroupProperties.class); + + /* + * The number of servers connected to the management group. + */ + @JsonProperty(value = "serverCount") + private Integer serverCount; + + /* + * Gets or sets a value indicating whether the management group is a + * gateway. + */ + @JsonProperty(value = "isGateway") + private Boolean isGateway; + + /* + * The name of the management group. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The unique ID of the management group. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The datetime that the management group was created. + */ + @JsonProperty(value = "created") + private OffsetDateTime created; + + /* + * The last datetime that the management group received data. + */ + @JsonProperty(value = "dataReceived") + private OffsetDateTime dataReceived; + + /* + * The version of System Center that is managing the management group. + */ + @JsonProperty(value = "version") + private String version; + + /* + * The SKU of System Center that is managing the management group. + */ + @JsonProperty(value = "sku") + private String sku; + + /** + * Get the serverCount property: The number of servers connected to the management group. + * + * @return the serverCount value. + */ + public Integer serverCount() { + return this.serverCount; + } + + /** + * Set the serverCount property: The number of servers connected to the management group. + * + * @param serverCount the serverCount value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withServerCount(Integer serverCount) { + this.serverCount = serverCount; + return this; + } + + /** + * Get the isGateway property: Gets or sets a value indicating whether the management group is a gateway. + * + * @return the isGateway value. + */ + public Boolean isGateway() { + return this.isGateway; + } + + /** + * Set the isGateway property: Gets or sets a value indicating whether the management group is a gateway. + * + * @param isGateway the isGateway value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withIsGateway(Boolean isGateway) { + this.isGateway = isGateway; + return this; + } + + /** + * Get the name property: The name of the management group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the management group. + * + * @param name the name value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: The unique ID of the management group. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The unique ID of the management group. + * + * @param id the id value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the created property: The datetime that the management group was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Set the created property: The datetime that the management group was created. + * + * @param created the created value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withCreated(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Get the dataReceived property: The last datetime that the management group received data. + * + * @return the dataReceived value. + */ + public OffsetDateTime dataReceived() { + return this.dataReceived; + } + + /** + * Set the dataReceived property: The last datetime that the management group received data. + * + * @param dataReceived the dataReceived value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withDataReceived(OffsetDateTime dataReceived) { + this.dataReceived = dataReceived; + return this; + } + + /** + * Get the version property: The version of System Center that is managing the management group. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of System Center that is managing the management group. + * + * @param version the version value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the sku property: The SKU of System Center that is managing the management group. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of System Center that is managing the management group. + * + * @param sku the sku value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/OperationStatusInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/OperationStatusInner.java index 39d0e82438aef..22ec67cfc7c4a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/OperationStatusInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/OperationStatusInner.java @@ -46,7 +46,7 @@ public final class OperationStatusInner { private String status; /* - * The error detail of the operation if any. + * Error response The error detail of the operation if any. */ @JsonProperty(value = "error") private ManagementError error; @@ -152,7 +152,7 @@ public OperationStatusInner withStatus(String status) { } /** - * Get the error property: The error detail of the operation if any. + * Get the error property: Error response The error detail of the operation if any. * * @return the error value. */ @@ -161,7 +161,7 @@ public ManagementError error() { } /** - * Set the error property: The error detail of the operation if any. + * Set the error property: Error response The error detail of the operation if any. * * @param error the error value to set. * @return the OperationStatusInner object itself. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SavedSearchInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SavedSearchInner.java index 69d58886efe69..78b83bf2cbc0b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SavedSearchInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SavedSearchInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.models.Tag; @@ -14,67 +13,26 @@ import java.util.List; /** Value object for saved search results. */ -@JsonFlatten @Fluent -public class SavedSearchInner extends ProxyResource { +public final class SavedSearchInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SavedSearchInner.class); /* - * The ETag of the saved search. + * The ETag of the saved search. To override an existing saved search, use + * "*" or specify the current Etag */ @JsonProperty(value = "etag") private String etag; /* - * The category of the saved search. This helps the user to find a saved - * search faster. + * The properties of the saved search. */ - @JsonProperty(value = "properties.category", required = true) - private String category; - - /* - * Saved search display name. - */ - @JsonProperty(value = "properties.displayName", required = true) - private String displayName; - - /* - * The query expression for the saved search. - */ - @JsonProperty(value = "properties.query", required = true) - private String query; - - /* - * The function alias if query serves as a function. - */ - @JsonProperty(value = "properties.functionAlias") - private String functionAlias; - - /* - * The optional function parameters if query serves as a function. Value - * should be in the following format: 'param-name1:type1 = default_value1, - * param-name2:type2 = default_value2'. For more examples and proper syntax - * please refer to - * https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. - */ - @JsonProperty(value = "properties.functionParameters") - private String functionParameters; - - /* - * The version number of the query language. The current version is 2 and - * is the default. - */ - @JsonProperty(value = "properties.version") - private Long version; - - /* - * The tags attached to the saved search. - */ - @JsonProperty(value = "properties.tags") - private List tags; + @JsonProperty(value = "properties", required = true) + private SavedSearchProperties innerProperties = new SavedSearchProperties(); /** - * Get the etag property: The ETag of the saved search. + * Get the etag property: The ETag of the saved search. To override an existing saved search, use "*" or specify the + * current Etag. * * @return the etag value. */ @@ -83,7 +41,8 @@ public String etag() { } /** - * Set the etag property: The ETag of the saved search. + * Set the etag property: The ETag of the saved search. To override an existing saved search, use "*" or specify the + * current Etag. * * @param etag the etag value to set. * @return the SavedSearchInner object itself. @@ -93,13 +52,22 @@ public SavedSearchInner withEtag(String etag) { return this; } + /** + * Get the innerProperties property: The properties of the saved search. + * + * @return the innerProperties value. + */ + private SavedSearchProperties innerProperties() { + return this.innerProperties; + } + /** * Get the category property: The category of the saved search. This helps the user to find a saved search faster. * * @return the category value. */ public String category() { - return this.category; + return this.innerProperties() == null ? null : this.innerProperties().category(); } /** @@ -109,7 +77,10 @@ public String category() { * @return the SavedSearchInner object itself. */ public SavedSearchInner withCategory(String category) { - this.category = category; + if (this.innerProperties() == null) { + this.innerProperties = new SavedSearchProperties(); + } + this.innerProperties().withCategory(category); return this; } @@ -119,7 +90,7 @@ public SavedSearchInner withCategory(String category) { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -129,7 +100,10 @@ public String displayName() { * @return the SavedSearchInner object itself. */ public SavedSearchInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new SavedSearchProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -139,7 +113,7 @@ public SavedSearchInner withDisplayName(String displayName) { * @return the query value. */ public String query() { - return this.query; + return this.innerProperties() == null ? null : this.innerProperties().query(); } /** @@ -149,7 +123,10 @@ public String query() { * @return the SavedSearchInner object itself. */ public SavedSearchInner withQuery(String query) { - this.query = query; + if (this.innerProperties() == null) { + this.innerProperties = new SavedSearchProperties(); + } + this.innerProperties().withQuery(query); return this; } @@ -159,7 +136,7 @@ public SavedSearchInner withQuery(String query) { * @return the functionAlias value. */ public String functionAlias() { - return this.functionAlias; + return this.innerProperties() == null ? null : this.innerProperties().functionAlias(); } /** @@ -169,7 +146,10 @@ public String functionAlias() { * @return the SavedSearchInner object itself. */ public SavedSearchInner withFunctionAlias(String functionAlias) { - this.functionAlias = functionAlias; + if (this.innerProperties() == null) { + this.innerProperties = new SavedSearchProperties(); + } + this.innerProperties().withFunctionAlias(functionAlias); return this; } @@ -182,7 +162,7 @@ public SavedSearchInner withFunctionAlias(String functionAlias) { * @return the functionParameters value. */ public String functionParameters() { - return this.functionParameters; + return this.innerProperties() == null ? null : this.innerProperties().functionParameters(); } /** @@ -195,7 +175,10 @@ public String functionParameters() { * @return the SavedSearchInner object itself. */ public SavedSearchInner withFunctionParameters(String functionParameters) { - this.functionParameters = functionParameters; + if (this.innerProperties() == null) { + this.innerProperties = new SavedSearchProperties(); + } + this.innerProperties().withFunctionParameters(functionParameters); return this; } @@ -205,7 +188,7 @@ public SavedSearchInner withFunctionParameters(String functionParameters) { * @return the version value. */ public Long version() { - return this.version; + return this.innerProperties() == null ? null : this.innerProperties().version(); } /** @@ -215,7 +198,10 @@ public Long version() { * @return the SavedSearchInner object itself. */ public SavedSearchInner withVersion(Long version) { - this.version = version; + if (this.innerProperties() == null) { + this.innerProperties = new SavedSearchProperties(); + } + this.innerProperties().withVersion(version); return this; } @@ -225,7 +211,7 @@ public SavedSearchInner withVersion(Long version) { * @return the tags value. */ public List tags() { - return this.tags; + return this.innerProperties() == null ? null : this.innerProperties().tags(); } /** @@ -235,7 +221,10 @@ public List tags() { * @return the SavedSearchInner object itself. */ public SavedSearchInner withTags(List tags) { - this.tags = tags; + if (this.innerProperties() == null) { + this.innerProperties = new SavedSearchProperties(); + } + this.innerProperties().withTags(tags); return this; } @@ -245,23 +234,13 @@ public SavedSearchInner withTags(List tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (category() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property category in model SavedSearchInner")); - } - if (displayName() == null) { + if (innerProperties() == null) { throw logger .logExceptionAsError( - new IllegalArgumentException("Missing required property displayName in model SavedSearchInner")); - } - if (query() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property query in model SavedSearchInner")); - } - if (tags() != null) { - tags().forEach(e -> e.validate()); + new IllegalArgumentException( + "Missing required property innerProperties in model SavedSearchInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SavedSearchProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SavedSearchProperties.java new file mode 100644 index 0000000000000..e9a16e791a8ed --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SavedSearchProperties.java @@ -0,0 +1,239 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.Tag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Value object for saved search results. */ +@Fluent +public final class SavedSearchProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SavedSearchProperties.class); + + /* + * The category of the saved search. This helps the user to find a saved + * search faster. + */ + @JsonProperty(value = "category", required = true) + private String category; + + /* + * Saved search display name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The query expression for the saved search. + */ + @JsonProperty(value = "query", required = true) + private String query; + + /* + * The function alias if query serves as a function. + */ + @JsonProperty(value = "functionAlias") + private String functionAlias; + + /* + * The optional function parameters if query serves as a function. Value + * should be in the following format: 'param-name1:type1 = default_value1, + * param-name2:type2 = default_value2'. For more examples and proper syntax + * please refer to + * https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + */ + @JsonProperty(value = "functionParameters") + private String functionParameters; + + /* + * The version number of the query language. The current version is 2 and + * is the default. + */ + @JsonProperty(value = "version") + private Long version; + + /* + * The tags attached to the saved search. + */ + @JsonProperty(value = "tags") + private List tags; + + /** + * Get the category property: The category of the saved search. This helps the user to find a saved search faster. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The category of the saved search. This helps the user to find a saved search faster. + * + * @param category the category value to set. + * @return the SavedSearchProperties object itself. + */ + public SavedSearchProperties withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the displayName property: Saved search display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Saved search display name. + * + * @param displayName the displayName value to set. + * @return the SavedSearchProperties object itself. + */ + public SavedSearchProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the query property: The query expression for the saved search. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query expression for the saved search. + * + * @param query the query value to set. + * @return the SavedSearchProperties object itself. + */ + public SavedSearchProperties withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the functionAlias property: The function alias if query serves as a function. + * + * @return the functionAlias value. + */ + public String functionAlias() { + return this.functionAlias; + } + + /** + * Set the functionAlias property: The function alias if query serves as a function. + * + * @param functionAlias the functionAlias value to set. + * @return the SavedSearchProperties object itself. + */ + public SavedSearchProperties withFunctionAlias(String functionAlias) { + this.functionAlias = functionAlias; + return this; + } + + /** + * Get the functionParameters property: The optional function parameters if query serves as a function. Value should + * be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more + * examples and proper syntax please refer to + * https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + * + * @return the functionParameters value. + */ + public String functionParameters() { + return this.functionParameters; + } + + /** + * Set the functionParameters property: The optional function parameters if query serves as a function. Value should + * be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more + * examples and proper syntax please refer to + * https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + * + * @param functionParameters the functionParameters value to set. + * @return the SavedSearchProperties object itself. + */ + public SavedSearchProperties withFunctionParameters(String functionParameters) { + this.functionParameters = functionParameters; + return this; + } + + /** + * Get the version property: The version number of the query language. The current version is 2 and is the default. + * + * @return the version value. + */ + public Long version() { + return this.version; + } + + /** + * Set the version property: The version number of the query language. The current version is 2 and is the default. + * + * @param version the version value to set. + * @return the SavedSearchProperties object itself. + */ + public SavedSearchProperties withVersion(Long version) { + this.version = version; + return this; + } + + /** + * Get the tags property: The tags attached to the saved search. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags attached to the saved search. + * + * @param tags the tags value to set. + * @return the SavedSearchProperties object itself. + */ + public SavedSearchProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (category() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property category in model SavedSearchProperties")); + } + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model SavedSearchProperties")); + } + if (query() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property query in model SavedSearchProperties")); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/StorageInsightInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/StorageInsightInner.java index 035a1a22ef073..cda82eddc8953 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/StorageInsightInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/StorageInsightInner.java @@ -5,22 +5,27 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.models.StorageAccount; import com.azure.resourcemanager.loganalytics.models.StorageInsightStatus; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** The top level storage insight resource container. */ -@JsonFlatten @Fluent -public class StorageInsightInner extends ProxyResource { +public final class StorageInsightInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageInsightInner.class); + /* + * Storage insight properties. + */ + @JsonProperty(value = "properties") + private StorageInsightProperties innerProperties; + /* * The ETag of the storage insight. */ @@ -31,31 +36,17 @@ public class StorageInsightInner extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The names of the blob containers that the workspace should read - */ - @JsonProperty(value = "properties.containers") - private List containers; - - /* - * The names of the Azure tables that the workspace should read - */ - @JsonProperty(value = "properties.tables") - private List tables; - - /* - * The storage account connection details - */ - @JsonProperty(value = "properties.storageAccount") - private StorageAccount storageAccount; - - /* - * The status of the storage insight + /** + * Get the innerProperties property: Storage insight properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private StorageInsightStatus status; + private StorageInsightProperties innerProperties() { + return this.innerProperties; + } /** * Get the etag property: The ETag of the storage insight. @@ -103,7 +94,7 @@ public StorageInsightInner withTags(Map tags) { * @return the containers value. */ public List containers() { - return this.containers; + return this.innerProperties() == null ? null : this.innerProperties().containers(); } /** @@ -113,7 +104,10 @@ public List containers() { * @return the StorageInsightInner object itself. */ public StorageInsightInner withContainers(List containers) { - this.containers = containers; + if (this.innerProperties() == null) { + this.innerProperties = new StorageInsightProperties(); + } + this.innerProperties().withContainers(containers); return this; } @@ -123,7 +117,7 @@ public StorageInsightInner withContainers(List containers) { * @return the tables value. */ public List tables() { - return this.tables; + return this.innerProperties() == null ? null : this.innerProperties().tables(); } /** @@ -133,7 +127,10 @@ public List tables() { * @return the StorageInsightInner object itself. */ public StorageInsightInner withTables(List tables) { - this.tables = tables; + if (this.innerProperties() == null) { + this.innerProperties = new StorageInsightProperties(); + } + this.innerProperties().withTables(tables); return this; } @@ -143,7 +140,7 @@ public StorageInsightInner withTables(List tables) { * @return the storageAccount value. */ public StorageAccount storageAccount() { - return this.storageAccount; + return this.innerProperties() == null ? null : this.innerProperties().storageAccount(); } /** @@ -153,7 +150,10 @@ public StorageAccount storageAccount() { * @return the StorageInsightInner object itself. */ public StorageInsightInner withStorageAccount(StorageAccount storageAccount) { - this.storageAccount = storageAccount; + if (this.innerProperties() == null) { + this.innerProperties = new StorageInsightProperties(); + } + this.innerProperties().withStorageAccount(storageAccount); return this; } @@ -163,7 +163,7 @@ public StorageInsightInner withStorageAccount(StorageAccount storageAccount) { * @return the status value. */ public StorageInsightStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -172,11 +172,8 @@ public StorageInsightStatus status() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (storageAccount() != null) { - storageAccount().validate(); - } - if (status() != null) { - status().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/StorageInsightProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/StorageInsightProperties.java new file mode 100644 index 0000000000000..97682fc3d02dc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/StorageInsightProperties.java @@ -0,0 +1,131 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.StorageAccount; +import com.azure.resourcemanager.loganalytics.models.StorageInsightStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Storage insight properties. */ +@Fluent +public final class StorageInsightProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageInsightProperties.class); + + /* + * The names of the blob containers that the workspace should read + */ + @JsonProperty(value = "containers") + private List containers; + + /* + * The names of the Azure tables that the workspace should read + */ + @JsonProperty(value = "tables") + private List tables; + + /* + * The storage account connection details + */ + @JsonProperty(value = "storageAccount", required = true) + private StorageAccount storageAccount; + + /* + * The status of the storage insight + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private StorageInsightStatus status; + + /** + * Get the containers property: The names of the blob containers that the workspace should read. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: The names of the blob containers that the workspace should read. + * + * @param containers the containers value to set. + * @return the StorageInsightProperties object itself. + */ + public StorageInsightProperties withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the tables property: The names of the Azure tables that the workspace should read. + * + * @return the tables value. + */ + public List tables() { + return this.tables; + } + + /** + * Set the tables property: The names of the Azure tables that the workspace should read. + * + * @param tables the tables value to set. + * @return the StorageInsightProperties object itself. + */ + public StorageInsightProperties withTables(List tables) { + this.tables = tables; + return this; + } + + /** + * Get the storageAccount property: The storage account connection details. + * + * @return the storageAccount value. + */ + public StorageAccount storageAccount() { + return this.storageAccount; + } + + /** + * Set the storageAccount property: The storage account connection details. + * + * @param storageAccount the storageAccount value to set. + * @return the StorageInsightProperties object itself. + */ + public StorageInsightProperties withStorageAccount(StorageAccount storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get the status property: The status of the storage insight. + * + * @return the status value. + */ + public StorageInsightStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageAccount() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccount in model StorageInsightProperties")); + } else { + storageAccount().validate(); + } + if (status() != null) { + status().validate(); + } + } +} 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 97f0a3960707e..4b23dcffbeff1 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 @@ -5,52 +5,106 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Workspace data table definition. */ -@JsonFlatten @Fluent -public class TableInner extends ProxyResource { +public final class TableInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(TableInner.class); /* - * The data table data retention in days, between 30 and 730. Setting this - * property to null will default to the workspace retention. + * Table properties. */ - @JsonProperty(value = "properties.retentionInDays") - private Integer retentionInDays; + @JsonProperty(value = "properties") + private TableProperties innerProperties; /** - * Get the retentionInDays property: The data table data retention in days, between 30 and 730. Setting this - * property to null will default to the workspace retention. + * Get the innerProperties property: Table properties. + * + * @return the innerProperties value. + */ + private TableProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the retentionInDays property: The data table data retention in days, between 7 and 730. Setting this property + * to null will default to the workspace retention. * * @return the retentionInDays value. */ public Integer retentionInDays() { - return this.retentionInDays; + return this.innerProperties() == null ? null : this.innerProperties().retentionInDays(); } /** - * Set the retentionInDays property: The data table data retention in days, between 30 and 730. Setting this - * property to null will default to the workspace retention. + * Set the retentionInDays property: The data table data retention in days, between 7 and 730. Setting this property + * to null will default to the workspace retention. * * @param retentionInDays the retentionInDays value to set. * @return the TableInner object itself. */ public TableInner withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; + if (this.innerProperties() == null) { + this.innerProperties = new TableProperties(); + } + this.innerProperties().withRetentionInDays(retentionInDays); return this; } + /** + * Get the isTroubleshootingAllowed property: Specifies if IsTroubleshootingEnabled property can be set for this + * table. + * + * @return the isTroubleshootingAllowed value. + */ + public Boolean isTroubleshootingAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isTroubleshootingAllowed(); + } + + /** + * Get the isTroubleshootEnabled property: Enable or disable troubleshoot for this table. + * + * @return the isTroubleshootEnabled value. + */ + public Boolean isTroubleshootEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isTroubleshootEnabled(); + } + + /** + * Set the isTroubleshootEnabled property: Enable or disable troubleshoot for this table. + * + * @param isTroubleshootEnabled the isTroubleshootEnabled value to set. + * @return the TableInner object itself. + */ + public TableInner withIsTroubleshootEnabled(Boolean isTroubleshootEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new TableProperties(); + } + this.innerProperties().withIsTroubleshootEnabled(isTroubleshootEnabled); + return this; + } + + /** + * Get the lastTroubleshootDate property: Last time when troubleshooting was set for this table. + * + * @return the lastTroubleshootDate value. + */ + public String lastTroubleshootDate() { + return this.innerProperties() == null ? null : this.innerProperties().lastTroubleshootDate(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java new file mode 100644 index 0000000000000..5565e4903c52f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java @@ -0,0 +1,111 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Table properties. */ +@Fluent +public final class TableProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TableProperties.class); + + /* + * The data table data retention in days, between 7 and 730. Setting this + * property to null will default to the workspace retention. + */ + @JsonProperty(value = "retentionInDays") + private Integer retentionInDays; + + /* + * Specifies if IsTroubleshootingEnabled property can be set for this + * table. + */ + @JsonProperty(value = "isTroubleshootingAllowed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isTroubleshootingAllowed; + + /* + * Enable or disable troubleshoot for this table. + */ + @JsonProperty(value = "isTroubleshootEnabled") + private Boolean isTroubleshootEnabled; + + /* + * Last time when troubleshooting was set for this table. + */ + @JsonProperty(value = "lastTroubleshootDate", access = JsonProperty.Access.WRITE_ONLY) + private String lastTroubleshootDate; + + /** + * Get the retentionInDays property: The data table data retention in days, between 7 and 730. Setting this property + * to null will default to the workspace retention. + * + * @return the retentionInDays value. + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the retentionInDays property: The data table data retention in days, between 7 and 730. Setting this property + * to null will default to the workspace retention. + * + * @param retentionInDays the retentionInDays value to set. + * @return the TableProperties object itself. + */ + public TableProperties withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + + /** + * Get the isTroubleshootingAllowed property: Specifies if IsTroubleshootingEnabled property can be set for this + * table. + * + * @return the isTroubleshootingAllowed value. + */ + public Boolean isTroubleshootingAllowed() { + return this.isTroubleshootingAllowed; + } + + /** + * Get the isTroubleshootEnabled property: Enable or disable troubleshoot for this table. + * + * @return the isTroubleshootEnabled value. + */ + public Boolean isTroubleshootEnabled() { + return this.isTroubleshootEnabled; + } + + /** + * Set the isTroubleshootEnabled property: Enable or disable troubleshoot for this table. + * + * @param isTroubleshootEnabled the isTroubleshootEnabled value to set. + * @return the TableProperties object itself. + */ + public TableProperties withIsTroubleshootEnabled(Boolean isTroubleshootEnabled) { + this.isTroubleshootEnabled = isTroubleshootEnabled; + return this; + } + + /** + * Get the lastTroubleshootDate property: Last time when troubleshooting was set for this table. + * + * @return the lastTroubleshootDate value. + */ + public String lastTroubleshootDate() { + return this.lastTroubleshootDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 ff5401ba2e353..f2189e3b14803 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 @@ -5,13 +5,13 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; 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.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,91 +19,30 @@ import java.util.Map; /** The top level Workspace resource container. */ -@JsonFlatten @Fluent -public class WorkspaceInner extends Resource { +public final class WorkspaceInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceInner.class); /* - * The ETag of the workspace. - */ - @JsonProperty(value = "eTag") - private String etag; - - /* - * The provisioning state of the workspace. - */ - @JsonProperty(value = "properties.provisioningState") - private WorkspaceEntityStatus provisioningState; - - /* - * This is a read-only property. Represents the ID associated with the - * workspace. - */ - @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; - - /* - * The SKU of the workspace. - */ - @JsonProperty(value = "properties.sku") - private WorkspaceSku sku; - - /* - * The workspace data retention in days. Allowed values are per pricing - * plan. See pricing tiers documentation for details. + * Workspace properties. */ - @JsonProperty(value = "properties.retentionInDays") - private Integer retentionInDays; + @JsonProperty(value = "properties") + private WorkspaceProperties innerProperties; /* - * The daily volume cap for ingestion. - */ - @JsonProperty(value = "properties.workspaceCapping") - private WorkspaceCapping workspaceCapping; - - /* - * Workspace creation date. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private String createdDate; - - /* - * Workspace modification date. - */ - @JsonProperty(value = "properties.modifiedDate", access = JsonProperty.Access.WRITE_ONLY) - private String modifiedDate; - - /* - * The network access type for accessing Log Analytics ingestion. - */ - @JsonProperty(value = "properties.publicNetworkAccessForIngestion") - private PublicNetworkAccessType publicNetworkAccessForIngestion; - - /* - * The network access type for accessing Log Analytics query. - */ - @JsonProperty(value = "properties.publicNetworkAccessForQuery") - private PublicNetworkAccessType publicNetworkAccessForQuery; - - /* - * Indicates whether customer managed storage is mandatory for query - * management. - */ - @JsonProperty(value = "properties.forceCmkForQuery") - private Boolean forceCmkForQuery; - - /* - * List of linked private link scope resources. + * The ETag of the workspace. */ - @JsonProperty(value = "properties.privateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) - private List privateLinkScopedResources; + @JsonProperty(value = "eTag") + private String etag; - /* - * Workspace features. + /** + * Get the innerProperties property: Workspace properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.features") - private Map features; + private WorkspaceProperties innerProperties() { + return this.innerProperties; + } /** * Get the etag property: The ETag of the workspace. @@ -125,13 +64,27 @@ public WorkspaceInner withEtag(String etag) { return this; } + /** {@inheritDoc} */ + @Override + public WorkspaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkspaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the provisioningState property: The provisioning state of the workspace. * * @return the provisioningState value. */ public WorkspaceEntityStatus provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -141,7 +94,10 @@ public WorkspaceEntityStatus provisioningState() { * @return the WorkspaceInner object itself. */ public WorkspaceInner withProvisioningState(WorkspaceEntityStatus provisioningState) { - this.provisioningState = provisioningState; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); return this; } @@ -151,7 +107,7 @@ public WorkspaceInner withProvisioningState(WorkspaceEntityStatus provisioningSt * @return the customerId value. */ public String customerId() { - return this.customerId; + return this.innerProperties() == null ? null : this.innerProperties().customerId(); } /** @@ -160,7 +116,7 @@ public String customerId() { * @return the sku value. */ public WorkspaceSku sku() { - return this.sku; + return this.innerProperties() == null ? null : this.innerProperties().sku(); } /** @@ -170,7 +126,10 @@ public WorkspaceSku sku() { * @return the WorkspaceInner object itself. */ public WorkspaceInner withSku(WorkspaceSku sku) { - this.sku = sku; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withSku(sku); return this; } @@ -181,7 +140,7 @@ public WorkspaceInner withSku(WorkspaceSku sku) { * @return the retentionInDays value. */ public Integer retentionInDays() { - return this.retentionInDays; + return this.innerProperties() == null ? null : this.innerProperties().retentionInDays(); } /** @@ -192,7 +151,10 @@ public Integer retentionInDays() { * @return the WorkspaceInner object itself. */ public WorkspaceInner withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withRetentionInDays(retentionInDays); return this; } @@ -202,7 +164,7 @@ public WorkspaceInner withRetentionInDays(Integer retentionInDays) { * @return the workspaceCapping value. */ public WorkspaceCapping workspaceCapping() { - return this.workspaceCapping; + return this.innerProperties() == null ? null : this.innerProperties().workspaceCapping(); } /** @@ -212,7 +174,10 @@ public WorkspaceCapping workspaceCapping() { * @return the WorkspaceInner object itself. */ public WorkspaceInner withWorkspaceCapping(WorkspaceCapping workspaceCapping) { - this.workspaceCapping = workspaceCapping; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withWorkspaceCapping(workspaceCapping); return this; } @@ -222,7 +187,7 @@ public WorkspaceInner withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * @return the createdDate value. */ public String createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -231,7 +196,7 @@ public String createdDate() { * @return the modifiedDate value. */ public String modifiedDate() { - return this.modifiedDate; + return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } /** @@ -240,7 +205,7 @@ public String modifiedDate() { * @return the publicNetworkAccessForIngestion value. */ public PublicNetworkAccessType publicNetworkAccessForIngestion() { - return this.publicNetworkAccessForIngestion; + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccessForIngestion(); } /** @@ -250,7 +215,10 @@ public PublicNetworkAccessType publicNetworkAccessForIngestion() { * @return the WorkspaceInner object itself. */ public WorkspaceInner withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion) { - this.publicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withPublicNetworkAccessForIngestion(publicNetworkAccessForIngestion); return this; } @@ -260,7 +228,7 @@ public WorkspaceInner withPublicNetworkAccessForIngestion(PublicNetworkAccessTyp * @return the publicNetworkAccessForQuery value. */ public PublicNetworkAccessType publicNetworkAccessForQuery() { - return this.publicNetworkAccessForQuery; + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccessForQuery(); } /** @@ -270,7 +238,10 @@ public PublicNetworkAccessType publicNetworkAccessForQuery() { * @return the WorkspaceInner object itself. */ public WorkspaceInner withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery) { - this.publicNetworkAccessForQuery = publicNetworkAccessForQuery; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withPublicNetworkAccessForQuery(publicNetworkAccessForQuery); return this; } @@ -280,7 +251,7 @@ public WorkspaceInner withPublicNetworkAccessForQuery(PublicNetworkAccessType pu * @return the forceCmkForQuery value. */ public Boolean forceCmkForQuery() { - return this.forceCmkForQuery; + return this.innerProperties() == null ? null : this.innerProperties().forceCmkForQuery(); } /** @@ -290,7 +261,10 @@ public Boolean forceCmkForQuery() { * @return the WorkspaceInner object itself. */ public WorkspaceInner withForceCmkForQuery(Boolean forceCmkForQuery) { - this.forceCmkForQuery = forceCmkForQuery; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withForceCmkForQuery(forceCmkForQuery); return this; } @@ -300,7 +274,7 @@ public WorkspaceInner withForceCmkForQuery(Boolean forceCmkForQuery) { * @return the privateLinkScopedResources value. */ public List privateLinkScopedResources() { - return this.privateLinkScopedResources; + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopedResources(); } /** @@ -308,8 +282,8 @@ public List privateLinkScopedResources() { * * @return the features value. */ - public Map features() { - return this.features; + public WorkspaceFeatures features() { + return this.innerProperties() == null ? null : this.innerProperties().features(); } /** @@ -318,22 +292,11 @@ public Map features() { * @param features the features value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withFeatures(Map features) { - this.features = features; - return this; - } - - /** {@inheritDoc} */ - @Override - public WorkspaceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public WorkspaceInner withTags(Map tags) { - super.withTags(tags); + public WorkspaceInner withFeatures(WorkspaceFeatures features) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFeatures(features); return this; } @@ -343,14 +306,8 @@ public WorkspaceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sku() != null) { - sku().validate(); - } - if (workspaceCapping() != null) { - workspaceCapping().validate(); - } - if (privateLinkScopedResources() != null) { - privateLinkScopedResources().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 new file mode 100644 index 0000000000000..fc490f7f13e0f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java @@ -0,0 +1,317 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; +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.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Workspace properties. */ +@Fluent +public final class WorkspaceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceProperties.class); + + /* + * The provisioning state of the workspace. + */ + @JsonProperty(value = "provisioningState") + private WorkspaceEntityStatus provisioningState; + + /* + * This is a read-only property. Represents the ID associated with the + * workspace. + */ + @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /* + * The SKU of the workspace. + */ + @JsonProperty(value = "sku") + private WorkspaceSku sku; + + /* + * The workspace data retention in days. Allowed values are per pricing + * plan. See pricing tiers documentation for details. + */ + @JsonProperty(value = "retentionInDays") + private Integer retentionInDays; + + /* + * The daily volume cap for ingestion. + */ + @JsonProperty(value = "workspaceCapping") + private WorkspaceCapping workspaceCapping; + + /* + * Workspace creation date. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /* + * Workspace modification date. + */ + @JsonProperty(value = "modifiedDate", access = JsonProperty.Access.WRITE_ONLY) + private String modifiedDate; + + /* + * The network access type for accessing Log Analytics ingestion. + */ + @JsonProperty(value = "publicNetworkAccessForIngestion") + private PublicNetworkAccessType publicNetworkAccessForIngestion; + + /* + * The network access type for accessing Log Analytics query. + */ + @JsonProperty(value = "publicNetworkAccessForQuery") + private PublicNetworkAccessType publicNetworkAccessForQuery; + + /* + * Indicates whether customer managed storage is mandatory for query + * management. + */ + @JsonProperty(value = "forceCmkForQuery") + private Boolean forceCmkForQuery; + + /* + * List of linked private link scope resources. + */ + @JsonProperty(value = "privateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) + private List privateLinkScopedResources; + + /* + * Workspace features. + */ + @JsonProperty(value = "features") + private WorkspaceFeatures features; + + /** + * Get the provisioningState property: The provisioning state of the workspace. + * + * @return the provisioningState value. + */ + public WorkspaceEntityStatus provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the workspace. + * + * @param provisioningState the provisioningState value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withProvisioningState(WorkspaceEntityStatus provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the customerId property: This is a read-only property. Represents the ID associated with the workspace. + * + * @return the customerId value. + */ + public String customerId() { + return this.customerId; + } + + /** + * Get the sku property: The SKU of the workspace. + * + * @return the sku value. + */ + public WorkspaceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the workspace. + * + * @param sku the sku value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withSku(WorkspaceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the retentionInDays property: The workspace data retention in days. Allowed values are per pricing plan. See + * pricing tiers documentation for details. + * + * @return the retentionInDays value. + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the retentionInDays property: The workspace data retention in days. Allowed values are per pricing plan. See + * pricing tiers documentation for details. + * + * @param retentionInDays the retentionInDays value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + + /** + * Get the workspaceCapping property: The daily volume cap for ingestion. + * + * @return the workspaceCapping value. + */ + public WorkspaceCapping workspaceCapping() { + return this.workspaceCapping; + } + + /** + * Set the workspaceCapping property: The daily volume cap for ingestion. + * + * @param workspaceCapping the workspaceCapping value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withWorkspaceCapping(WorkspaceCapping workspaceCapping) { + this.workspaceCapping = workspaceCapping; + return this; + } + + /** + * Get the createdDate property: Workspace creation date. + * + * @return the createdDate value. + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the modifiedDate property: Workspace modification date. + * + * @return the modifiedDate value. + */ + public String modifiedDate() { + return this.modifiedDate; + } + + /** + * Get the publicNetworkAccessForIngestion property: The network access type for accessing Log Analytics ingestion. + * + * @return the publicNetworkAccessForIngestion value. + */ + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.publicNetworkAccessForIngestion; + } + + /** + * Set the publicNetworkAccessForIngestion property: The network access type for accessing Log Analytics ingestion. + * + * @param publicNetworkAccessForIngestion the publicNetworkAccessForIngestion value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withPublicNetworkAccessForIngestion( + PublicNetworkAccessType publicNetworkAccessForIngestion) { + this.publicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + return this; + } + + /** + * Get the publicNetworkAccessForQuery property: The network access type for accessing Log Analytics query. + * + * @return the publicNetworkAccessForQuery value. + */ + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.publicNetworkAccessForQuery; + } + + /** + * Set the publicNetworkAccessForQuery property: The network access type for accessing Log Analytics query. + * + * @param publicNetworkAccessForQuery the publicNetworkAccessForQuery value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery) { + this.publicNetworkAccessForQuery = publicNetworkAccessForQuery; + return this; + } + + /** + * Get the forceCmkForQuery property: Indicates whether customer managed storage is mandatory for query management. + * + * @return the forceCmkForQuery value. + */ + public Boolean forceCmkForQuery() { + return this.forceCmkForQuery; + } + + /** + * Set the forceCmkForQuery property: Indicates whether customer managed storage is mandatory for query management. + * + * @param forceCmkForQuery the forceCmkForQuery value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withForceCmkForQuery(Boolean forceCmkForQuery) { + this.forceCmkForQuery = forceCmkForQuery; + return this; + } + + /** + * Get the privateLinkScopedResources property: List of linked private link scope resources. + * + * @return the privateLinkScopedResources value. + */ + public List privateLinkScopedResources() { + return this.privateLinkScopedResources; + } + + /** + * Get the features property: Workspace features. + * + * @return the features value. + */ + public WorkspaceFeatures features() { + return this.features; + } + + /** + * Set the features property: Workspace features. + * + * @param features the features value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withFeatures(WorkspaceFeatures features) { + this.features = features; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (workspaceCapping() != null) { + workspaceCapping().validate(); + } + if (privateLinkScopedResources() != null) { + privateLinkScopedResources().forEach(e -> e.validate()); + } + if (features() != null) { + features().validate(); + } + } +} 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 57f13aa48eeb6..97f1450b4c0ff 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 @@ -104,6 +104,7 @@ 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( @@ -114,7 +115,7 @@ private Mono>> listByWorkspaceWithRespo this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -153,6 +154,7 @@ 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 @@ -161,7 +163,7 @@ private Mono>> listByWorkspaceWithRespo this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, 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 fdb30b0893996..4257dfae682d3 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 @@ -7,6 +7,9 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.ClusterInner; +import com.azure.resourcemanager.loganalytics.models.AssociatedWorkspace; +import com.azure.resourcemanager.loganalytics.models.BillingType; +import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; import com.azure.resourcemanager.loganalytics.models.Cluster; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; import com.azure.resourcemanager.loganalytics.models.ClusterPatch; @@ -14,6 +17,7 @@ import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import java.util.Collections; +import java.util.List; import java.util.Map; public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { @@ -54,10 +58,6 @@ public ClusterSku sku() { return this.innerModel().sku(); } - public String nextLink() { - return this.innerModel().nextLink(); - } - public String clusterId() { return this.innerModel().clusterId(); } @@ -66,10 +66,43 @@ public ClusterEntityStatus provisioningState() { return this.innerModel().provisioningState(); } + public Boolean isDoubleEncryptionEnabled() { + return this.innerModel().isDoubleEncryptionEnabled(); + } + + public Boolean isAvailabilityZonesEnabled() { + return this.innerModel().isAvailabilityZonesEnabled(); + } + + public BillingType billingType() { + return this.innerModel().billingType(); + } + public KeyVaultProperties keyVaultProperties() { return this.innerModel().keyVaultProperties(); } + public String lastModifiedDate() { + return this.innerModel().lastModifiedDate(); + } + + public String createdDate() { + return this.innerModel().createdDate(); + } + + public List associatedWorkspaces() { + List inner = this.innerModel().associatedWorkspaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CapacityReservationProperties capacityReservationProperties() { + return this.innerModel().capacityReservationProperties(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -131,8 +164,7 @@ public Cluster apply() { serviceManager .serviceClient() .getClusters() - .updateWithResponse(resourceGroupName, clusterName, updateParameters, Context.NONE) - .getValue(); + .update(resourceGroupName, clusterName, updateParameters, Context.NONE); return this; } @@ -141,8 +173,7 @@ public Cluster apply(Context context) { serviceManager .serviceClient() .getClusters() - .updateWithResponse(resourceGroupName, clusterName, updateParameters, context) - .getValue(); + .update(resourceGroupName, clusterName, updateParameters, context); return this; } @@ -194,8 +225,13 @@ public ClusterImpl withTags(Map tags) { } public ClusterImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); - return this; + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } } public ClusterImpl withSku(ClusterSku sku) { @@ -208,11 +244,26 @@ public ClusterImpl withSku(ClusterSku sku) { } } - public ClusterImpl withNextLink(String nextLink) { - this.innerModel().withNextLink(nextLink); + public ClusterImpl withIsDoubleEncryptionEnabled(Boolean isDoubleEncryptionEnabled) { + this.innerModel().withIsDoubleEncryptionEnabled(isDoubleEncryptionEnabled); return this; } + public ClusterImpl withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + this.innerModel().withIsAvailabilityZonesEnabled(isAvailabilityZonesEnabled); + return this; + } + + public ClusterImpl withBillingType(BillingType billingType) { + if (isInCreateMode()) { + this.innerModel().withBillingType(billingType); + return this; + } else { + this.updateParameters.withBillingType(billingType); + return this; + } + } + public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { if (isInCreateMode()) { this.innerModel().withKeyVaultProperties(keyVaultProperties); @@ -223,6 +274,16 @@ public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) } } + public ClusterImpl withAssociatedWorkspaces(List associatedWorkspaces) { + this.innerModel().withAssociatedWorkspaces(associatedWorkspaces); + return this; + } + + public ClusterImpl withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { + this.innerModel().withCapacityReservationProperties(capacityReservationProperties); + 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/ClustersClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java index d9baac7013721..201c0bf81122c 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 @@ -113,7 +113,7 @@ Mono>> createOrUpdate( @Delete( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + "/clusters/{clusterName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, @@ -145,7 +145,7 @@ Mono> getByResourceGroup( + "/clusters/{clusterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> update( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @@ -203,6 +203,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -211,7 +212,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -256,13 +257,14 @@ private Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) @@ -360,17 +362,13 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -406,15 +404,11 @@ private Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( @@ -517,6 +511,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -525,7 +520,7 @@ private Mono>> createOrUpdateWithResponseAsync( .createOrUpdate( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), clusterName, parameters, @@ -573,13 +568,14 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), clusterName, parameters, @@ -598,7 +594,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Log Analytics cluster resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( String resourceGroupName, String clusterName, ClusterInner parameters) { Mono>> mono = @@ -606,7 +602,7 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs return this .client .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -621,7 +617,7 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Log Analytics cluster resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { context = this.client.mergeContext(context); @@ -644,7 +640,7 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Log Analytics cluster resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, ClusterInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); @@ -662,7 +658,7 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Log Analytics cluster resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); @@ -772,6 +768,7 @@ private Mono>> deleteWithResponseAsync(String resource new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -781,7 +778,7 @@ private Mono>> deleteWithResponseAsync(String resource this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -821,6 +818,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -828,7 +826,7 @@ private Mono>> deleteWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -844,12 +842,13 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -863,7 +862,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String clusterName, Context context) { context = this.client.mergeContext(context); @@ -883,7 +882,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); } @@ -899,7 +898,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); @@ -999,6 +998,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1008,7 +1008,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, clusterName, accept, context)) @@ -1048,6 +1048,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1055,7 +1056,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, clusterName, accept, context); @@ -1128,7 +1129,7 @@ public Response getByResourceGroupWithResponse( * @return the top level Log Analytics cluster resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String clusterName, ClusterPatch parameters) { if (this.client.getEndpoint() == null) { return Mono @@ -1154,6 +1155,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1163,7 +1165,7 @@ private Mono> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -1184,7 +1186,7 @@ private Mono> updateWithResponseAsync( * @return the top level Log Analytics cluster resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1210,6 +1212,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1217,13 +1220,93 @@ private Mono> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, context); } + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 top level Log Analytics cluster resource container. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterPatch parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 top level Log Analytics cluster resource container. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 top level Log Analytics cluster resource container. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterPatch parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 top level Log Analytics cluster resource container. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + /** * Updates a Log Analytics cluster. * @@ -1237,15 +1320,29 @@ private Mono> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, ClusterPatch parameters) { - return updateWithResponseAsync(resourceGroupName, clusterName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return beginUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 top level Log Analytics cluster resource container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1277,9 +1374,8 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster * @return the top level Log Analytics cluster resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, parameters, context).block(); + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { + return updateAsync(resourceGroupName, clusterName, parameters, context).block(); } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportImpl.java index 81903e6c10e84..44d21cb051204 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportImpl.java @@ -57,8 +57,8 @@ public String resourceId() { return this.innerModel().resourceId(); } - public Type typePropertiesDestinationType() { - return this.innerModel().typePropertiesDestinationType(); + public Type typePropertiesType() { + return this.innerModel().typePropertiesType(); } public String eventHubName() { 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 e50eb7f34eb3f..3dc11d7c70b04 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 @@ -159,6 +159,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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( @@ -169,7 +170,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -212,6 +213,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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 @@ -220,7 +222,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -335,6 +337,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -346,7 +349,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, dataExportName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -400,6 +403,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -409,7 +413,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, dataExportName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -519,6 +523,7 @@ private Mono> getWithResponseAsync( 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( @@ -530,7 +535,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, dataExportName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -573,6 +578,7 @@ private Mono> getWithResponseAsync( 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 @@ -582,7 +588,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, dataExportName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -681,6 +687,7 @@ private Mono> deleteWithResponseAsync( 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( @@ -692,7 +699,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, dataExportName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -735,6 +742,7 @@ private Mono> deleteWithResponseAsync( 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 @@ -744,7 +752,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, dataExportName, - this.client.getApiVersion(), + apiVersion, accept, context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsImpl.java index 1d2769218ab32..8afb8739ec416 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsImpl.java @@ -147,7 +147,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'dataExports'.", id))); } - this.deleteWithResponse(resourceGroupName, workspaceName, dataExportName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, workspaceName, dataExportName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context 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 e62dbb1122913..01c0087da0549 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 @@ -180,6 +180,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -190,7 +191,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, dataSourceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -245,6 +246,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -253,7 +255,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, dataSourceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -364,6 +366,7 @@ private Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-08-01"; return FluxUtil .withContext( context -> @@ -373,7 +376,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, dataSourceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -416,6 +419,7 @@ private Mono> deleteWithResponseAsync( 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( @@ -423,7 +427,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, dataSourceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context); } @@ -514,6 +518,7 @@ private Mono> getWithResponseAsync( 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( @@ -524,7 +529,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, dataSourceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -568,6 +573,7 @@ private Mono> getWithResponseAsync( 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 @@ -576,7 +582,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, dataSourceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -677,6 +683,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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( @@ -688,7 +695,7 @@ private Mono> listByWorkspaceSinglePageAsync( workspaceName, filter, skiptoken, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -742,6 +749,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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 @@ -751,7 +759,7 @@ private Mono> listByWorkspaceSinglePageAsync( workspaceName, filter, skiptoken, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesImpl.java index 0844fbc2c76fa..40584e394c188 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesImpl.java @@ -149,7 +149,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'dataSources'.", id))); } - this.deleteWithResponse(resourceGroupName, workspaceName, dataSourceName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, workspaceName, dataSourceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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 6d95f1fc33508..0592cf1b86f31 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 @@ -106,17 +106,13 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -147,15 +143,11 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( @@ -241,6 +233,7 @@ private Mono> listByResourceGroupSinglePageAsync(S new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -249,7 +242,7 @@ private Mono> listByResourceGroupSinglePageAsync(S .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -289,13 +282,14 @@ private Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) 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 dbfa15e3aa390..07b595f539ce7 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 @@ -103,6 +103,7 @@ private Mono> deleteWithResponseAsync( 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 -> @@ -113,7 +114,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, gatewayId, - this.client.getApiVersion(), + apiVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -155,6 +156,7 @@ private Mono> deleteWithResponseAsync( 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( @@ -163,7 +165,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, gatewayId, - this.client.getApiVersion(), + apiVersion, 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 594a76ca050ff..dadc1e331c087 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 @@ -139,6 +139,7 @@ private Mono> disableWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-08-01"; return FluxUtil .withContext( context -> @@ -148,7 +149,7 @@ private Mono> disableWithResponseAsync( resourceGroupName, workspaceName, intelligencePackName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -192,6 +193,7 @@ private Mono> disableWithResponseAsync( 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( @@ -199,7 +201,7 @@ private Mono> disableWithResponseAsync( resourceGroupName, workspaceName, intelligencePackName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context); } @@ -291,6 +293,7 @@ private Mono> enableWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-08-01"; return FluxUtil .withContext( context -> @@ -300,7 +303,7 @@ private Mono> enableWithResponseAsync( resourceGroupName, workspaceName, intelligencePackName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -344,6 +347,7 @@ private Mono> enableWithResponseAsync( 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( @@ -351,7 +355,7 @@ private Mono> enableWithResponseAsync( resourceGroupName, workspaceName, intelligencePackName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context); } @@ -438,6 +442,7 @@ private Mono>> listWithResponseAsync( 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( @@ -447,7 +452,7 @@ private Mono>> listWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -487,6 +492,7 @@ private Mono>> listWithResponseAsync( 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 @@ -494,7 +500,7 @@ private Mono>> listWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, 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 2f90f6a77b0d9..11fcfd2e87778 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 @@ -71,7 +71,7 @@ private interface LinkedServicesService { @Put( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + "/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -88,7 +88,7 @@ Mono>> createOrUpdate( @Delete( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + "/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, @@ -175,6 +175,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -186,7 +187,7 @@ private Mono>> createOrUpdateWithResponseAsync( workspaceName, linkedServiceName, this.client.getSubscriptionId(), - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -241,6 +242,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -250,7 +252,7 @@ private Mono>> createOrUpdateWithResponseAsync( workspaceName, linkedServiceName, this.client.getSubscriptionId(), - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -268,7 +270,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { Mono>> mono = @@ -276,7 +278,11 @@ private PollerFlux, LinkedServiceInner> beginCrea return this .client .getLroResult( - mono, this.client.getHttpPipeline(), LinkedServiceInner.class, LinkedServiceInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + LinkedServiceInner.class, + LinkedServiceInner.class, + this.client.getContext()); } /** @@ -292,7 +298,7 @@ private PollerFlux, LinkedServiceInner> beginCrea * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, @@ -320,7 +326,7 @@ private PollerFlux, LinkedServiceInner> beginCrea * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters) @@ -340,7 +346,7 @@ public SyncPoller, LinkedServiceInner> beginCreat * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, @@ -474,6 +480,7 @@ private Mono>> deleteWithResponseAsync( 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( @@ -484,7 +491,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, workspaceName, linkedServiceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -529,6 +536,7 @@ private Mono>> deleteWithResponseAsync( 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 @@ -537,7 +545,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, workspaceName, linkedServiceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -554,7 +562,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginDeleteAsync( String resourceGroupName, String workspaceName, String linkedServiceName) { Mono>> mono = @@ -562,7 +570,11 @@ private PollerFlux, LinkedServiceInner> beginDele return this .client .getLroResult( - mono, this.client.getHttpPipeline(), LinkedServiceInner.class, LinkedServiceInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + LinkedServiceInner.class, + LinkedServiceInner.class, + this.client.getContext()); } /** @@ -577,7 +589,7 @@ private PollerFlux, LinkedServiceInner> beginDele * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginDeleteAsync( String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { context = this.client.mergeContext(context); @@ -600,7 +612,7 @@ private PollerFlux, LinkedServiceInner> beginDele * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginDelete( String resourceGroupName, String workspaceName, String linkedServiceName) { return beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName).getSyncPoller(); @@ -618,7 +630,7 @@ public SyncPoller, LinkedServiceInner> beginDelet * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Linked service resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginDelete( String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { return beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName, context).getSyncPoller(); @@ -734,6 +746,7 @@ private Mono> getWithResponseAsync( 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( @@ -744,7 +757,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, linkedServiceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -789,6 +802,7 @@ private Mono> getWithResponseAsync( 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 @@ -797,7 +811,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, linkedServiceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -894,6 +908,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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( @@ -903,7 +918,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -947,6 +962,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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 @@ -954,7 +970,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) 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 09b7f5548f2a5..014ddbf87d854 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 @@ -174,6 +174,7 @@ private Mono> createOrUpdateWithRes } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -185,7 +186,7 @@ private Mono> createOrUpdateWithRes workspaceName, dataSourceType, this.client.getSubscriptionId(), - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -240,6 +241,7 @@ private Mono> createOrUpdateWithRes } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -249,7 +251,7 @@ private Mono> createOrUpdateWithRes workspaceName, dataSourceType, this.client.getSubscriptionId(), - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -368,6 +370,7 @@ private Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-08-01"; return FluxUtil .withContext( context -> @@ -377,7 +380,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, dataSourceType, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -420,6 +423,7 @@ private Mono> deleteWithResponseAsync( 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( @@ -427,7 +431,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, dataSourceType, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context); } @@ -518,6 +522,7 @@ private Mono> getWithResponseAsync( 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( @@ -528,7 +533,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, dataSourceType, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -572,6 +577,7 @@ private Mono> getWithResponseAsync( 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 @@ -580,7 +586,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, dataSourceType, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -680,6 +686,7 @@ private Mono> listByWorkspaceS 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( @@ -689,7 +696,7 @@ private Mono> listByWorkspaceS this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, workspaceName, accept, context)) @@ -735,6 +742,7 @@ private Mono> listByWorkspaceS 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 @@ -742,7 +750,7 @@ private Mono> listByWorkspaceS this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, workspaceName, accept, context) diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsImpl.java index 1b4b999a6846c..0a0bdf8c471c9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsImpl.java @@ -166,7 +166,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'linkedStorageAccounts'.", id))); } - this.deleteWithResponse(resourceGroupName, workspaceName, dataSourceType, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, workspaceName, dataSourceType, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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 0b0fa63bfc39e..b162bd3a82dfd 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 @@ -107,6 +107,7 @@ private Mono> listSinglePageAsync( 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( @@ -116,7 +117,7 @@ private Mono> listSinglePageAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -160,6 +161,7 @@ private Mono> listSinglePageAsync( 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 @@ -167,7 +169,7 @@ private Mono> listSinglePageAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) 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 7dfd440bdfd28..0c5d1965495ca 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 @@ -101,6 +101,7 @@ private Mono> getWithResponseAsync(String locatio 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( @@ -110,7 +111,7 @@ private Mono> getWithResponseAsync(String locatio this.client.getEndpoint(), location, asyncOperationId, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -150,6 +151,7 @@ private Mono> getWithResponseAsync( 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 @@ -157,7 +159,7 @@ private Mono> getWithResponseAsync( this.client.getEndpoint(), location, asyncOperationId, - this.client.getApiVersion(), + apiVersion, 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 33ae49d8a88dd..59ee2f53ae781 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 @@ -81,18 +81,6 @@ 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. */ private final HttpPipeline httpPipeline; @@ -201,18 +189,6 @@ public ManagementGroupsClient getManagementGroups() { return this.managementGroups; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - /** The OperationStatusesClient object to access its operations. */ private final OperationStatusesClient operationStatuses; @@ -249,42 +225,6 @@ public UsagesClient getUsages() { return this.usages; } - /** The WorkspacesClient object to access its operations. */ - private final WorkspacesClient workspaces; - - /** - * Gets the WorkspacesClient object to access its operations. - * - * @return the WorkspacesClient object. - */ - public WorkspacesClient getWorkspaces() { - return this.workspaces; - } - - /** The DeletedWorkspacesClient object to access its operations. */ - private final DeletedWorkspacesClient deletedWorkspaces; - - /** - * Gets the DeletedWorkspacesClient object to access its operations. - * - * @return the DeletedWorkspacesClient object. - */ - public DeletedWorkspacesClient getDeletedWorkspaces() { - return this.deletedWorkspaces; - } - - /** The ClustersClient object to access its operations. */ - private final ClustersClient clusters; - - /** - * Gets the ClustersClient object to access its operations. - * - * @return the ClustersClient object. - */ - public ClustersClient getClusters() { - return this.clusters; - } - /** The StorageInsightConfigsClient object to access its operations. */ private final StorageInsightConfigsClient storageInsightConfigs; @@ -357,6 +297,18 @@ public WorkspacePurgesClient getWorkspacePurges() { return this.workspacePurges; } + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + /** The TablesClient object to access its operations. */ private final TablesClient tables; @@ -369,6 +321,42 @@ public TablesClient getTables() { return this.tables; } + /** The ClustersClient object to access its operations. */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** The WorkspacesClient object to access its operations. */ + private final WorkspacesClient workspaces; + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + public WorkspacesClient getWorkspaces() { + return this.workspaces; + } + + /** The DeletedWorkspacesClient object to access its operations. */ + private final DeletedWorkspacesClient deletedWorkspaces; + + /** + * Gets the DeletedWorkspacesClient object to access its operations. + * + * @return the DeletedWorkspacesClient object. + */ + public DeletedWorkspacesClient getDeletedWorkspaces() { + return this.deletedWorkspaces; + } + /** * Initializes an instance of OperationalInsightsManagementClient client. * @@ -391,27 +379,26 @@ public TablesClient getTables() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-08-01"; this.dataExports = new DataExportsClientImpl(this); this.dataSources = new DataSourcesClientImpl(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.workspaces = new WorkspacesClientImpl(this); - this.deletedWorkspaces = new DeletedWorkspacesClientImpl(this); - this.clusters = new ClustersClientImpl(this); this.storageInsightConfigs = new StorageInsightConfigsClientImpl(this); this.savedSearches = new SavedSearchesClientImpl(this); this.availableServiceTiers = new AvailableServiceTiersClientImpl(this); this.gateways = new GatewaysClientImpl(this); this.schemas = new SchemasClientImpl(this); this.workspacePurges = new WorkspacePurgesClientImpl(this); + this.operations = new OperationsClientImpl(this); this.tables = new TablesClientImpl(this); + this.clusters = new ClustersClientImpl(this); + this.workspaces = new WorkspacesClientImpl(this); + this.deletedWorkspaces = new DeletedWorkspacesClientImpl(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 8ed8020bfcb34..3fd4f06a764a5 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 @@ -95,10 +95,10 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2020-10-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -128,10 +128,11 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2020-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( 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 8c7dba622ff72..69afd818c0c6d 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 @@ -158,6 +158,7 @@ private Mono> deleteWithResponseAsync( 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 -> @@ -168,7 +169,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, savedSearchId, - this.client.getApiVersion(), + apiVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -210,6 +211,7 @@ private Mono> deleteWithResponseAsync( 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( @@ -218,7 +220,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, savedSearchId, - this.client.getApiVersion(), + apiVersion, context); } @@ -314,6 +316,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -325,7 +328,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, savedSearchId, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -379,6 +382,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -388,7 +392,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, savedSearchId, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -498,6 +502,7 @@ private Mono> getWithResponseAsync( 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( @@ -509,7 +514,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, savedSearchId, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -552,6 +557,7 @@ private Mono> getWithResponseAsync( 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 @@ -561,7 +567,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, savedSearchId, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -656,6 +662,7 @@ private Mono> listByWorkspaceWithResponse 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( @@ -665,7 +672,7 @@ private Mono> listByWorkspaceWithResponse this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -705,6 +712,7 @@ private Mono> listByWorkspaceWithResponse 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 @@ -712,7 +720,7 @@ private Mono> listByWorkspaceWithResponse this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesImpl.java index f83f033b15e3f..0db49c923757a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesImpl.java @@ -161,7 +161,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'savedSearches'.", id))); } - this.deleteWithResponse(resourceGroupName, workspaceName, savedSearchId, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, workspaceName, savedSearchId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context 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 59c20877bfa45..6c49c0c5be504 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 @@ -101,6 +101,7 @@ private Mono> getWithResponseAsync( 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( @@ -110,7 +111,7 @@ private Mono> getWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -150,6 +151,7 @@ private Mono> getWithResponseAsync( 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 @@ -157,7 +159,7 @@ private Mono> getWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, 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 9a05dccf50f3b..9addf67c51444 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 @@ -118,6 +118,7 @@ private Mono> getSharedKeysWithResponseAsync( 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( @@ -127,7 +128,7 @@ private Mono> getSharedKeysWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -167,6 +168,7 @@ private Mono> getSharedKeysWithResponseAsync( 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 @@ -174,7 +176,7 @@ private Mono> getSharedKeysWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -268,6 +270,7 @@ private Mono> regenerateWithResponseAsync( 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( @@ -278,7 +281,7 @@ private Mono> regenerateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -318,6 +321,7 @@ private Mono> regenerateWithResponseAsync( 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 @@ -326,7 +330,7 @@ private Mono> regenerateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, 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 dd9d0d8a166dc..71cab1936f43a 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 @@ -180,6 +180,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -190,7 +191,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, storageInsightName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -246,6 +247,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -254,7 +256,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, workspaceName, storageInsightName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -367,6 +369,7 @@ private Mono> getWithResponseAsync( 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( @@ -377,7 +380,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, storageInsightName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -422,6 +425,7 @@ private Mono> getWithResponseAsync( 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 @@ -430,7 +434,7 @@ private Mono> getWithResponseAsync( resourceGroupName, workspaceName, storageInsightName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -532,6 +536,7 @@ private Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-08-01"; return FluxUtil .withContext( context -> @@ -541,7 +546,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, storageInsightName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -585,6 +590,7 @@ private Mono> deleteWithResponseAsync( 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( @@ -592,7 +598,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, workspaceName, storageInsightName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), context); } @@ -679,6 +685,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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( @@ -688,7 +695,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -737,6 +744,7 @@ private Mono> listByWorkspaceSinglePageAsync( 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 @@ -744,7 +752,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsImpl.java index bd08bb96b2436..16e175267bf0e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsImpl.java @@ -159,7 +159,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'storageInsightConfigs'.", id))); } - this.deleteWithResponse(resourceGroupName, workspaceName, storageInsightName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, workspaceName, storageInsightName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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 ae66c1b1463aa..047f502381d11 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 @@ -4,19 +4,15 @@ package com.azure.resourcemanager.loganalytics.implementation; +import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; import com.azure.resourcemanager.loganalytics.models.Table; -public final class TableImpl implements Table { +public final class TableImpl implements Table, Table.Definition, Table.Update { private TableInner innerObject; private final com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager; - TableImpl(TableInner innerObject, com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -33,6 +29,18 @@ public Integer retentionInDays() { return this.innerModel().retentionInDays(); } + public Boolean isTroubleshootingAllowed() { + return this.innerModel().isTroubleshootingAllowed(); + } + + public Boolean isTroubleshootEnabled() { + return this.innerModel().isTroubleshootEnabled(); + } + + public String lastTroubleshootDate() { + return this.innerModel().lastTroubleshootDate(); + } + public TableInner innerModel() { return this.innerObject; } @@ -40,4 +48,104 @@ public TableInner innerModel() { private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { return this.serviceManager; } + + private String resourceGroupName; + + private String workspaceName; + + private String tableName; + + public TableImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public Table create() { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .createWithResponse(resourceGroupName, workspaceName, tableName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Table create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .createWithResponse(resourceGroupName, workspaceName, tableName, this.innerModel(), context) + .getValue(); + return this; + } + + TableImpl(String name, com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerObject = new TableInner(); + this.serviceManager = serviceManager; + this.tableName = name; + } + + public TableImpl update() { + return this; + } + + public Table apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .updateWithResponse(resourceGroupName, workspaceName, tableName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Table apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .updateWithResponse(resourceGroupName, workspaceName, tableName, this.innerModel(), context) + .getValue(); + return this; + } + + TableImpl(TableInner innerObject, com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.tableName = Utils.getValueFromIdByName(innerObject.id(), "tables"); + } + + public Table refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .getWithResponse(resourceGroupName, workspaceName, tableName, Context.NONE) + .getValue(); + return this; + } + + public Table refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .getWithResponse(resourceGroupName, workspaceName, tableName, context) + .getValue(); + return this; + } + + public TableImpl withRetentionInDays(Integer retentionInDays) { + this.innerModel().withRetentionInDays(retentionInDays); + return this; + } + + public TableImpl withIsTroubleshootEnabled(Boolean isTroubleshootEnabled) { + this.innerModel().withIsTroubleshootEnabled(isTroubleshootEnabled); + return this; + } } 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 2907cdc2bebb0..a73ee891fa97e 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 @@ -13,6 +13,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -92,6 +93,23 @@ Mono> update( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" + + "/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("tableName") String tableName, + @BodyParam("application/json") TableInner parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" @@ -141,6 +159,7 @@ private Mono> listByWorkspaceSinglePageAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -151,7 +170,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -194,6 +213,7 @@ private Mono> listByWorkspaceSinglePageAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -202,7 +222,7 @@ private Mono> listByWorkspaceSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -316,6 +336,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -326,7 +347,7 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, tableName, parameters, accept, @@ -377,6 +398,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -385,7 +407,7 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, tableName, parameters, accept, @@ -454,6 +476,188 @@ public Response updateWithResponse( return updateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters, context).block(); } + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param parameters The parameters required to update table properties. + * @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 workspace data table definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { + 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.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + apiVersion, + tableName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param parameters The parameters required to update table properties. + * @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 workspace data table definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String workspaceName, String tableName, TableInner parameters, 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.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + apiVersion, + tableName, + parameters, + accept, + context); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param parameters The parameters required to update table properties. + * @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 workspace data table definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { + return createWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param parameters The parameters required to update table properties. + * @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 workspace data table definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableInner create(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { + return createAsync(resourceGroupName, workspaceName, tableName, parameters).block(); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param parameters The parameters required to update table properties. + * @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 workspace data table definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters, context).block(); + } + /** * Gets a Log Analytics workspace table. * @@ -490,6 +694,7 @@ private Mono> getWithResponseAsync( if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -500,7 +705,7 @@ private Mono> getWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, tableName, accept, context)) @@ -544,6 +749,7 @@ private Mono> getWithResponseAsync( if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -552,7 +758,7 @@ private Mono> getWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, tableName, accept, context); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesImpl.java index 8ee8c3a0b68bc..e06616dcf6e38 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesImpl.java @@ -39,8 +39,8 @@ public PagedIterable listByWorkspace(String resourceGroupName, String wor return Utils.mapPage(inner, inner1 -> new TableImpl(inner1, this.manager())); } - public Table update(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - TableInner inner = this.serviceClient().update(resourceGroupName, workspaceName, tableName, parameters); + public Table get(String resourceGroupName, String workspaceName, String tableName) { + TableInner inner = this.serviceClient().get(resourceGroupName, workspaceName, tableName); if (inner != null) { return new TableImpl(inner, this.manager()); } else { @@ -48,10 +48,10 @@ public Table update(String resourceGroupName, String workspaceName, String table } } - public Response
updateWithResponse( - String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { + public Response
getWithResponse( + String resourceGroupName, String workspaceName, String tableName, Context context) { Response inner = - this.serviceClient().updateWithResponse(resourceGroupName, workspaceName, tableName, parameters, context); + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, tableName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -63,28 +63,56 @@ public Response
updateWithResponse( } } - public Table get(String resourceGroupName, String workspaceName, String tableName) { - TableInner inner = this.serviceClient().get(resourceGroupName, workspaceName, tableName); - if (inner != null) { - return new TableImpl(inner, this.manager()); - } else { - return null; + public Table getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, tableName, Context.NONE).getValue(); } - public Response
getWithResponse( - String resourceGroupName, String workspaceName, String tableName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, tableName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new TableImpl(inner.getValue(), this.manager())); - } else { - return null; + public Response
getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, tableName, context); } private TablesClient serviceClient() { @@ -94,4 +122,8 @@ private TablesClient serviceClient() { private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { return this.serviceManager; } + + public TableImpl define(String name) { + return new TableImpl(name, this.manager()); + } } 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 5fe17c28238c3..ce2735bcdc997 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 @@ -105,6 +105,7 @@ private Mono> listSinglePageAsync(String resourc 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( @@ -114,7 +115,7 @@ private Mono> listSinglePageAsync(String resourc this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -158,6 +159,7 @@ private Mono> listSinglePageAsync( 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 @@ -165,7 +167,7 @@ private Mono> listSinglePageAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) 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 612c1d9b2a4c1..2f7219d824606 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 @@ -12,6 +12,7 @@ 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.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import java.util.Collections; @@ -101,13 +102,8 @@ public List privateLinkScopedResources() { } } - public Map features() { - Map inner = this.innerModel().features(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public WorkspaceFeatures features() { + return this.innerModel().features(); } public Region region() { @@ -309,7 +305,7 @@ public WorkspaceImpl withForceCmkForQuery(Boolean forceCmkForQuery) { } } - public WorkspaceImpl withFeatures(Map features) { + public WorkspaceImpl withFeatures(WorkspaceFeatures features) { if (isInCreateMode()) { this.innerModel().withFeatures(features); return this; 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 a3e0cc6c85962..59ade20d2f25e 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 @@ -135,6 +135,7 @@ private Mono purgeWithResponseAsync( } else { body.validate(); } + final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -143,7 +144,7 @@ private Mono purgeWithResponseAsync( .purge( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), workspaceName, body, @@ -196,13 +197,14 @@ private Mono purgeWithResponseAsync( } 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, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), workspaceName, body, @@ -320,6 +322,7 @@ 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( @@ -328,7 +331,7 @@ private Mono> getPurgeStatusWithResp .getPurgeStatus( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), workspaceName, purgeId, @@ -374,13 +377,14 @@ 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, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), workspaceName, purgeId, 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 52fa2d36e0374..01c1ad6b53c37 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 @@ -179,17 +179,13 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -220,15 +216,11 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( @@ -314,6 +306,7 @@ private Mono> listByResourceGroupSinglePageAsync(S new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -322,7 +315,7 @@ private Mono> listByResourceGroupSinglePageAsync(S .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -362,13 +355,14 @@ private Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) @@ -474,6 +468,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -483,7 +478,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -530,6 +525,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -537,7 +533,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -555,7 +551,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Workspace resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, WorkspaceInner parameters) { Mono>> mono = @@ -563,7 +559,11 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda return this .client .getLroResult( - mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + WorkspaceInner.class, + WorkspaceInner.class, + this.client.getContext()); } /** @@ -578,7 +578,7 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Workspace resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { context = this.client.mergeContext(context); @@ -601,7 +601,7 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Workspace resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, WorkspaceInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); @@ -619,7 +619,7 @@ public SyncPoller, WorkspaceInner> beginCreateOrUpdat * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Workspace resource container. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginCreateOrUpdate( String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); @@ -734,6 +734,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -743,7 +744,7 @@ private Mono>> deleteWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), force, accept, @@ -788,6 +789,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -795,7 +797,7 @@ private Mono>> deleteWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), force, accept, @@ -816,13 +818,14 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String workspaceName, Boolean force) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, force); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -840,7 +843,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String workspaceName, Boolean force, Context context) { context = this.client.mergeContext(context); @@ -865,7 +868,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String workspaceName, Boolean force) { return beginDeleteAsync(resourceGroupName, workspaceName, force).getSyncPoller(); @@ -886,7 +889,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String workspaceName, Boolean force, Context context) { return beginDeleteAsync(resourceGroupName, workspaceName, force, context).getSyncPoller(); @@ -1041,6 +1044,7 @@ private Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1050,7 +1054,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -1090,6 +1094,7 @@ private Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1097,7 +1102,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -1196,6 +1201,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1205,7 +1211,7 @@ private Mono> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -1252,6 +1258,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1259,7 +1266,7 @@ private Mono> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, 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 new file mode 100644 index 0000000000000..5cc05a8a3d2b8 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java @@ -0,0 +1,84 @@ +// 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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The list of Log Analytics workspaces associated with the cluster. */ +@Immutable +public final class AssociatedWorkspace { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssociatedWorkspace.class); + + /* + * The id of the assigned workspace. + */ + @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceId; + + /* + * The name id the assigned workspace. + */ + @JsonProperty(value = "workspaceName", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceName; + + /* + * The ResourceId id the assigned workspace. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * The time of workspace association. + */ + @JsonProperty(value = "associateDate", access = JsonProperty.Access.WRITE_ONLY) + private String associateDate; + + /** + * Get the workspaceId property: The id of the assigned workspace. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Get the workspaceName property: The name id the assigned workspace. + * + * @return the workspaceName value. + */ + public String workspaceName() { + return this.workspaceName; + } + + /** + * Get the resourceId property: The ResourceId id the assigned workspace. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the associateDate property: The time of workspace association. + * + * @return the associateDate value. + */ + public String associateDate() { + return this.associateDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureEntityResource.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureEntityResource.java index 19249bec3ddd3..c3d5066ba3b2a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureEntityResource.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureEntityResource.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The resource model definition for an Azure Resource Manager resource with an etag. */ +/** Entity Resource The resource model definition for an Azure Resource Manager resource with an etag. */ @Immutable public class AzureEntityResource extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureEntityResource.class); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/BillingType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/BillingType.java new file mode 100644 index 0000000000000..f57053a49627d --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/BillingType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BillingType. */ +public final class BillingType extends ExpandableStringEnum { + /** Static value Cluster for BillingType. */ + public static final BillingType CLUSTER = fromString("Cluster"); + + /** Static value Workspaces for BillingType. */ + public static final BillingType WORKSPACES = fromString("Workspaces"); + + /** + * Creates or finds a BillingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BillingType. + */ + @JsonCreator + public static BillingType fromString(String name) { + return fromString(name, BillingType.class); + } + + /** @return known BillingType values. */ + public static Collection values() { + return values(BillingType.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java new file mode 100644 index 0000000000000..71c46e1df9efa --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java @@ -0,0 +1,57 @@ +// 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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Capacity. */ +public enum Capacity { + /** Enum value 500. */ + FIVE_ZERO_ZERO(500L), + + /** Enum value 1000. */ + ONE_ZERO_ZERO_ZERO(1000L), + + /** Enum value 2000. */ + TWO_ZERO_ZERO_ZERO(2000L), + + /** Enum value 5000. */ + FIVE_ZERO_ZERO_ZERO(5000L); + + /** The actual serialized value for a Capacity instance. */ + private final long value; + + Capacity(long value) { + this.value = value; + } + + /** + * Parses a serialized value to a Capacity instance. + * + * @param value the serialized value to parse. + * @return the parsed Capacity object, or null if unable to parse. + */ + @JsonCreator + public static Capacity fromLong(long value) { + Capacity[] items = Capacity.values(); + for (Capacity item : items) { + if (item.toLong() == value) { + return item; + } + } + return null; + } + + /** + * De-serializes the instance to long value. + * + * @return the long value. + */ + @JsonValue + public long toLong() { + return this.value; + } +} 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 new file mode 100644 index 0000000000000..5d2ee35e28ce4 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java @@ -0,0 +1,69 @@ +// 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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for CapacityReservationLevel. */ +public enum CapacityReservationLevel { + /** Enum value 100. */ + ONE_ZERO_ZERO(100), + + /** Enum value 200. */ + TWO_ZERO_ZERO(200), + + /** Enum value 300. */ + THREE_ZERO_ZERO(300), + + /** Enum value 400. */ + FOUR_ZERO_ZERO(400), + + /** Enum value 500. */ + FIVE_ZERO_ZERO(500), + + /** Enum value 1000. */ + ONE_ZERO_ZERO_ZERO(1000), + + /** Enum value 2000. */ + TWO_ZERO_ZERO_ZERO(2000), + + /** Enum value 5000. */ + FIVE_ZERO_ZERO_ZERO(5000); + + /** The actual serialized value for a CapacityReservationLevel instance. */ + private final int value; + + CapacityReservationLevel(int value) { + this.value = value; + } + + /** + * Parses a serialized value to a CapacityReservationLevel instance. + * + * @param value the serialized value to parse. + * @return the parsed CapacityReservationLevel object, or null if unable to parse. + */ + @JsonCreator + public static CapacityReservationLevel fromInt(int value) { + CapacityReservationLevel[] items = CapacityReservationLevel.values(); + for (CapacityReservationLevel item : items) { + if (item.toInt() == value) { + return item; + } + } + return null; + } + + /** + * De-serializes the instance to int value. + * + * @return the int value. + */ + @JsonValue + public int toInt() { + return this.value; + } +} 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 new file mode 100644 index 0000000000000..2e928f5ab0986 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java @@ -0,0 +1,54 @@ +// 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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Capacity Reservation properties. */ +@Immutable +public final class CapacityReservationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationProperties.class); + + /* + * The last time Sku was updated. + */ + @JsonProperty(value = "lastSkuUpdate", access = JsonProperty.Access.WRITE_ONLY) + private String lastSkuUpdate; + + /* + * Minimum CapacityReservation value in GB. + */ + @JsonProperty(value = "minCapacity", access = JsonProperty.Access.WRITE_ONLY) + private Long minCapacity; + + /** + * Get the lastSkuUpdate property: The last time Sku was updated. + * + * @return the lastSkuUpdate value. + */ + public String lastSkuUpdate() { + return this.lastSkuUpdate; + } + + /** + * Get the minCapacity property: Minimum CapacityReservation value in GB. + * + * @return the minCapacity value. + */ + public Long minCapacity() { + return this.minCapacity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 6cd5fe9911757..50dc0d70db138 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.util.List; import java.util.Map; /** An immutable client-side representation of Cluster. */ @@ -60,13 +61,6 @@ public interface Cluster { */ ClusterSku sku(); - /** - * Gets the nextLink property: The link used to get the next page of recommendations. - * - * @return the nextLink value. - */ - String nextLink(); - /** * Gets the clusterId property: The ID associated with the cluster. * @@ -81,6 +75,30 @@ public interface Cluster { */ ClusterEntityStatus provisioningState(); + /** + * Gets the isDoubleEncryptionEnabled property: Configures whether cluster will use double encryption. This Property + * can not be modified after cluster creation. Default value is 'true'. + * + * @return the isDoubleEncryptionEnabled value. + */ + Boolean isDoubleEncryptionEnabled(); + + /** + * Gets the isAvailabilityZonesEnabled property: Sets whether the cluster will support availability zones. This can + * be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be + * modified after cluster creation. Default value is 'true' if region supports Availability Zones. + * + * @return the isAvailabilityZonesEnabled value. + */ + Boolean isAvailabilityZonesEnabled(); + + /** + * Gets the billingType property: The cluster's billing type. + * + * @return the billingType value. + */ + BillingType billingType(); + /** * Gets the keyVaultProperties property: The associated key properties. * @@ -88,6 +106,34 @@ public interface Cluster { */ KeyVaultProperties keyVaultProperties(); + /** + * Gets the lastModifiedDate property: The last time the cluster was updated. + * + * @return the lastModifiedDate value. + */ + String lastModifiedDate(); + + /** + * Gets the createdDate property: The cluster creation time. + * + * @return the createdDate value. + */ + String createdDate(); + + /** + * Gets the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. + * + * @return the associatedWorkspaces value. + */ + List associatedWorkspaces(); + + /** + * Gets the capacityReservationProperties property: Additional properties for capacity reservation. + * + * @return the capacityReservationProperties value. + */ + CapacityReservationProperties capacityReservationProperties(); + /** * Gets the region of the resource. * @@ -157,8 +203,12 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithSku, - DefinitionStages.WithNextLink, - DefinitionStages.WithKeyVaultProperties { + DefinitionStages.WithIsDoubleEncryptionEnabled, + DefinitionStages.WithIsAvailabilityZonesEnabled, + DefinitionStages.WithBillingType, + DefinitionStages.WithKeyVaultProperties, + DefinitionStages.WithAssociatedWorkspaces, + DefinitionStages.WithCapacityReservationProperties { /** * Executes the create request. * @@ -204,15 +254,43 @@ interface WithSku { */ WithCreate withSku(ClusterSku sku); } - /** The stage of the Cluster definition allowing to specify nextLink. */ - interface WithNextLink { + /** The stage of the Cluster definition allowing to specify isDoubleEncryptionEnabled. */ + interface WithIsDoubleEncryptionEnabled { /** - * Specifies the nextLink property: The link used to get the next page of recommendations.. + * Specifies the isDoubleEncryptionEnabled property: Configures whether cluster will use double encryption. + * This Property can not be modified after cluster creation. Default value is 'true'. * - * @param nextLink The link used to get the next page of recommendations. + * @param isDoubleEncryptionEnabled Configures whether cluster will use double encryption. This Property can + * not be modified after cluster creation. Default value is 'true'. * @return the next definition stage. */ - WithCreate withNextLink(String nextLink); + WithCreate withIsDoubleEncryptionEnabled(Boolean isDoubleEncryptionEnabled); + } + /** The stage of the Cluster definition allowing to specify isAvailabilityZonesEnabled. */ + interface WithIsAvailabilityZonesEnabled { + /** + * Specifies the isAvailabilityZonesEnabled property: Sets whether the cluster will support availability + * zones. This can be set as true only in regions where Azure Data Explorer support Availability Zones. This + * Property can not be modified after cluster creation. Default value is 'true' if region supports + * Availability Zones.. + * + * @param isAvailabilityZonesEnabled Sets whether the cluster will support availability zones. This can be + * set as true only in regions where Azure Data Explorer support Availability Zones. This Property can + * not be modified after cluster creation. Default value is 'true' if region supports Availability + * Zones. + * @return the next definition stage. + */ + WithCreate withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled); + } + /** The stage of the Cluster definition allowing to specify billingType. */ + interface WithBillingType { + /** + * Specifies the billingType property: The cluster's billing type.. + * + * @param billingType The cluster's billing type. + * @return the next definition stage. + */ + WithCreate withBillingType(BillingType billingType); } /** The stage of the Cluster definition allowing to specify keyVaultProperties. */ interface WithKeyVaultProperties { @@ -224,6 +302,27 @@ interface WithKeyVaultProperties { */ WithCreate withKeyVaultProperties(KeyVaultProperties keyVaultProperties); } + /** The stage of the Cluster definition allowing to specify associatedWorkspaces. */ + interface WithAssociatedWorkspaces { + /** + * Specifies the associatedWorkspaces property: The list of Log Analytics workspaces associated with the + * cluster. + * + * @param associatedWorkspaces The list of Log Analytics workspaces associated with the cluster. + * @return the next definition stage. + */ + WithCreate withAssociatedWorkspaces(List associatedWorkspaces); + } + /** The stage of the Cluster definition allowing to specify capacityReservationProperties. */ + interface WithCapacityReservationProperties { + /** + * Specifies the capacityReservationProperties property: Additional properties for capacity reservation. + * + * @param capacityReservationProperties Additional properties for capacity reservation. + * @return the next definition stage. + */ + WithCreate withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties); + } } /** * Begins update for the Cluster resource. @@ -233,7 +332,12 @@ interface WithKeyVaultProperties { Cluster.Update update(); /** The template for Cluster update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithKeyVaultProperties { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithSku, + UpdateStages.WithKeyVaultProperties, + UpdateStages.WithBillingType { /** * Executes the update request. * @@ -261,6 +365,16 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Cluster update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } /** The stage of the Cluster update allowing to specify sku. */ interface WithSku { /** @@ -281,6 +395,16 @@ interface WithKeyVaultProperties { */ Update withKeyVaultProperties(KeyVaultProperties keyVaultProperties); } + /** The stage of the Cluster update allowing to specify billingType. */ + interface WithBillingType { + /** + * Specifies the billingType property: The cluster's billing type.. + * + * @param billingType The cluster's billing type. + * @return the next definition stage. + */ + Update withBillingType(BillingType billingType); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterPatch.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterPatch.java index 34be5ae9d38f6..096368a422669 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterPatch.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterPatch.java @@ -5,18 +5,30 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.fluent.models.ClusterPatchProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The top level Log Analytics cluster resource container. */ -@JsonFlatten @Fluent -public class ClusterPatch { +public final class ClusterPatch { @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPatch.class); + /* + * Log Analytics cluster properties. + */ + @JsonProperty(value = "properties") + private ClusterPatchProperties innerProperties; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + /* * The sku properties. */ @@ -27,13 +39,37 @@ public class ClusterPatch { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The associated key properties. + /** + * Get the innerProperties property: Log Analytics cluster properties. + * + * @return the innerProperties value. + */ + private ClusterPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. */ - @JsonProperty(value = "properties.keyVaultProperties") - private KeyVaultProperties keyVaultProperties; + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withIdentity(Identity identity) { + this.identity = identity; + return this; + } /** * Get the sku property: The sku properties. @@ -81,7 +117,7 @@ public ClusterPatch withTags(Map tags) { * @return the keyVaultProperties value. */ public KeyVaultProperties keyVaultProperties() { - return this.keyVaultProperties; + return this.innerProperties() == null ? null : this.innerProperties().keyVaultProperties(); } /** @@ -91,7 +127,33 @@ public KeyVaultProperties keyVaultProperties() { * @return the ClusterPatch object itself. */ public ClusterPatch withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { - this.keyVaultProperties = keyVaultProperties; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withKeyVaultProperties(keyVaultProperties); + return this; + } + + /** + * Get the billingType property: The cluster's billing type. + * + * @return the billingType value. + */ + public BillingType billingType() { + return this.innerProperties() == null ? null : this.innerProperties().billingType(); + } + + /** + * Set the billingType property: The cluster's billing type. + * + * @param billingType the billingType value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withBillingType(BillingType billingType) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withBillingType(billingType); return this; } @@ -101,11 +163,14 @@ public ClusterPatch withKeyVaultProperties(KeyVaultProperties keyVaultProperties * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } if (sku() != null) { sku().validate(); } - if (keyVaultProperties() != null) { - keyVaultProperties().validate(); - } } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java index 1b2fb5bcba651..a3f82db8fcd99 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java @@ -18,7 +18,7 @@ public final class ClusterSku { * The capacity value */ @JsonProperty(value = "capacity") - private Long capacity; + private Capacity capacity; /* * The name of the SKU. @@ -31,7 +31,7 @@ public final class ClusterSku { * * @return the capacity value. */ - public Long capacity() { + public Capacity capacity() { return this.capacity; } @@ -41,7 +41,7 @@ public Long capacity() { * @param capacity the capacity value to set. * @return the ClusterSku object itself. */ - public ClusterSku withCapacity(Long capacity) { + public ClusterSku withCapacity(Capacity capacity) { this.capacity = capacity; return this; } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/DataExport.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/DataExport.java index a45b17f9f3da8..545cac1cab94c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/DataExport.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/DataExport.java @@ -75,11 +75,11 @@ public interface DataExport { String resourceId(); /** - * Gets the typePropertiesDestinationType property: The type of the destination resource. + * Gets the typePropertiesType property: The type of the destination resource. * - * @return the typePropertiesDestinationType value. + * @return the typePropertiesType value. */ - Type typePropertiesDestinationType(); + Type typePropertiesType(); /** * Gets the eventHubName property: Optional. Allows to define an Event Hub name. Not applicable when destination is diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ErrorAdditionalInfo.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ErrorAdditionalInfo.java deleted file mode 100644 index 697ee10baa222..0000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ErrorAdditionalInfo.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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource management error additional info. */ -@Immutable -public final class ErrorAdditionalInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); - - /* - * The additional info type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The additional info. - */ - @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) - private Object info; - - /** - * Get the type property: The additional info type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the info property: The additional info. - * - * @return the info value. - */ - public Object info() { - return this.info; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Identity.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Identity.java index 2115f49ea7fa1..76ca0c5517640 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Identity.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Identity.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Identity for the resource. */ @Fluent @@ -27,11 +29,20 @@ public class Identity { private String tenantId; /* - * The identity type. + * Type of managed service identity. */ @JsonProperty(value = "type", required = true) private IdentityType type; + /* + * The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + /** * Get the principalId property: The principal ID of resource identity. * @@ -51,7 +62,7 @@ public String tenantId() { } /** - * Get the type property: The identity type. + * Get the type property: Type of managed service identity. * * @return the type value. */ @@ -60,7 +71,7 @@ public IdentityType type() { } /** - * Set the type property: The identity type. + * Set the type property: Type of managed service identity. * * @param type the type value to set. * @return the Identity object itself. @@ -70,6 +81,30 @@ public Identity withType(IdentityType type) { return this; } + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + /** * Validates the instance. * @@ -80,5 +115,15 @@ public void validate() { throw logger .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } } } 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 457f03780ba35..b8566c9eb059e 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 @@ -12,6 +12,9 @@ public enum IdentityType { /** Enum value SystemAssigned. */ SYSTEM_ASSIGNED("SystemAssigned"), + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + /** Enum value None. */ NONE("None"); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/KeyVaultProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/KeyVaultProperties.java index ac2c6827af82d..3a6d9052ff476 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/KeyVaultProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/KeyVaultProperties.java @@ -33,6 +33,12 @@ public final class KeyVaultProperties { @JsonProperty(value = "keyVersion") private String keyVersion; + /* + * Selected key minimum required size. + */ + @JsonProperty(value = "keyRsaSize") + private Integer keyRsaSize; + /** * Get the keyVaultUri property: The Key Vault uri which holds they key associated with the Log Analytics cluster. * @@ -93,6 +99,26 @@ public KeyVaultProperties withKeyVersion(String keyVersion) { return this; } + /** + * Get the keyRsaSize property: Selected key minimum required size. + * + * @return the keyRsaSize value. + */ + public Integer keyRsaSize() { + return this.keyRsaSize; + } + + /** + * Set the keyRsaSize property: Selected key minimum required size. + * + * @param keyRsaSize the keyRsaSize value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyRsaSize(Integer keyRsaSize) { + this.keyRsaSize = keyRsaSize; + return this; + } + /** * Validates the instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/OperationStatus.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/OperationStatus.java index 1d13df86d3f51..b432cda28adaa 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/OperationStatus.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/OperationStatus.java @@ -45,7 +45,7 @@ public interface OperationStatus { String status(); /** - * Gets the error property: The error detail of the operation if any. + * Gets the error property: Error response The error detail of the operation if any. * * @return the error value. */ diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SavedSearch.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SavedSearch.java index 7724013b89165..6d6b884e6f916 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SavedSearch.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SavedSearch.java @@ -32,7 +32,8 @@ public interface SavedSearch { String type(); /** - * Gets the etag property: The ETag of the saved search. + * Gets the etag property: The ETag of the saved search. To override an existing saved search, use "*" or specify + * the current Etag. * * @return the etag value. */ @@ -191,9 +192,11 @@ interface WithTags { /** The stage of the SavedSearch definition allowing to specify etag. */ interface WithEtag { /** - * Specifies the etag property: The ETag of the saved search.. + * Specifies the etag property: The ETag of the saved search. To override an existing saved search, use "*" + * or specify the current Etag. * - * @param etag The ETag of the saved search. + * @param etag The ETag of the saved search. To override an existing saved search, use "*" or specify the + * current Etag. * @return the next definition stage. */ WithCreate withEtag(String etag); @@ -283,9 +286,11 @@ interface WithTags { /** The stage of the SavedSearch update allowing to specify etag. */ interface WithEtag { /** - * Specifies the etag property: The ETag of the saved search.. + * Specifies the etag property: The ETag of the saved search. To override an existing saved search, use "*" + * or specify the current Etag. * - * @param etag The ETag of the saved search. + * @param etag The ETag of the saved search. To override an existing saved search, use "*" or specify the + * current Etag. * @return the next definition stage. */ Update withEtag(String etag); 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 c4a2fa65b8f66..7430140564965 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.loganalytics.models; +import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; /** An immutable client-side representation of Table. */ @@ -30,17 +31,166 @@ public interface Table { String type(); /** - * Gets the retentionInDays property: The data table data retention in days, between 30 and 730. Setting this + * Gets the retentionInDays property: The data table data retention in days, between 7 and 730. Setting this * property to null will default to the workspace retention. * * @return the retentionInDays value. */ Integer retentionInDays(); + /** + * Gets the isTroubleshootingAllowed property: Specifies if IsTroubleshootingEnabled property can be set for this + * table. + * + * @return the isTroubleshootingAllowed value. + */ + Boolean isTroubleshootingAllowed(); + + /** + * Gets the isTroubleshootEnabled property: Enable or disable troubleshoot for this table. + * + * @return the isTroubleshootEnabled value. + */ + Boolean isTroubleshootEnabled(); + + /** + * Gets the lastTroubleshootDate property: Last time when troubleshooting was set for this table. + * + * @return the lastTroubleshootDate value. + */ + String lastTroubleshootDate(); + /** * Gets the inner com.azure.resourcemanager.loganalytics.fluent.models.TableInner object. * * @return the inner object. */ TableInner innerModel(); + + /** The entirety of the Table definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Table definition stages. */ + interface DefinitionStages { + /** The first stage of the Table definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Table definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the Table definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithRetentionInDays, DefinitionStages.WithIsTroubleshootEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + Table create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Table create(Context context); + } + /** The stage of the Table definition allowing to specify retentionInDays. */ + interface WithRetentionInDays { + /** + * Specifies the retentionInDays property: The data table data retention in days, between 7 and 730. Setting + * this property to null will default to the workspace retention.. + * + * @param retentionInDays The data table data retention in days, between 7 and 730. Setting this property to + * null will default to the workspace retention. + * @return the next definition stage. + */ + WithCreate withRetentionInDays(Integer retentionInDays); + } + /** The stage of the Table definition allowing to specify isTroubleshootEnabled. */ + interface WithIsTroubleshootEnabled { + /** + * Specifies the isTroubleshootEnabled property: Enable or disable troubleshoot for this table.. + * + * @param isTroubleshootEnabled Enable or disable troubleshoot for this table. + * @return the next definition stage. + */ + WithCreate withIsTroubleshootEnabled(Boolean isTroubleshootEnabled); + } + } + /** + * Begins update for the Table resource. + * + * @return the stage of resource update. + */ + Table.Update update(); + + /** The template for Table update. */ + interface Update extends UpdateStages.WithRetentionInDays, UpdateStages.WithIsTroubleshootEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Table apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Table apply(Context context); + } + /** The Table update stages. */ + interface UpdateStages { + /** The stage of the Table update allowing to specify retentionInDays. */ + interface WithRetentionInDays { + /** + * Specifies the retentionInDays property: The data table data retention in days, between 7 and 730. Setting + * this property to null will default to the workspace retention.. + * + * @param retentionInDays The data table data retention in days, between 7 and 730. Setting this property to + * null will default to the workspace retention. + * @return the next definition stage. + */ + Update withRetentionInDays(Integer retentionInDays); + } + /** The stage of the Table update allowing to specify isTroubleshootEnabled. */ + interface WithIsTroubleshootEnabled { + /** + * Specifies the isTroubleshootEnabled property: Enable or disable troubleshoot for this table.. + * + * @param isTroubleshootEnabled Enable or disable troubleshoot for this table. + * @return the next definition stage. + */ + Update withIsTroubleshootEnabled(Boolean isTroubleshootEnabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Table refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Table refresh(Context context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Tables.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Tables.java index 4d6cbfd33178a..51b96aaecf138 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Tables.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Tables.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; /** Resource collection API of Tables. */ public interface Tables { @@ -37,59 +36,60 @@ public interface Tables { PagedIterable
listByWorkspace(String resourceGroupName, String workspaceName, Context context); /** - * Updates a Log Analytics workspace table properties. + * Gets a Log Analytics workspace table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param tableName The name of the table. - * @param parameters The parameters required to update table properties. * @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 workspace data table definition. + * @return a Log Analytics workspace table. */ - Table update(String resourceGroupName, String workspaceName, String tableName, TableInner parameters); + Table get(String resourceGroupName, String workspaceName, String tableName); /** - * Updates a Log Analytics workspace table properties. + * Gets a Log Analytics workspace table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param tableName The name of the table. - * @param parameters The parameters required to update table properties. * @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 workspace data table definition. + * @return a Log Analytics workspace table. */ - Response
updateWithResponse( - String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context); + Response
getWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context); /** * Gets a Log Analytics workspace table. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Log Analytics workspace table. */ - Table get(String resourceGroupName, String workspaceName, String tableName); + Table getById(String id); /** * Gets a Log Analytics workspace table. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Log Analytics workspace table. */ - Response
getWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context); + Response
getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Table resource. + * + * @param name resource name. + * @return the first stage of the new Table definition. + */ + Table.DefinitionStages.Blank define(String name); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/UserIdentityProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/UserIdentityProperties.java new file mode 100644 index 0000000000000..09534dfdca5a1 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/UserIdentityProperties.java @@ -0,0 +1,54 @@ +// 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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** User assigned identity properties. */ +@Immutable +public final class UserIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserIdentityProperties.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/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 44ce1350abae5..1ce4df1ca90e6 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 @@ -137,7 +137,7 @@ public interface Workspace { * * @return the features value. */ - Map features(); + WorkspaceFeatures features(); /** * Gets the region of the resource. @@ -333,7 +333,7 @@ interface WithFeatures { * @param features Workspace features. * @return the next definition stage. */ - WithCreate withFeatures(Map features); + WithCreate withFeatures(WorkspaceFeatures features); } } /** @@ -464,7 +464,7 @@ interface WithFeatures { * @param features Workspace features. * @return the next definition stage. */ - Update withFeatures(Map features); + Update withFeatures(WorkspaceFeatures features); } } /** 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 new file mode 100644 index 0000000000000..292cb45fea1a0 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java @@ -0,0 +1,196 @@ +// 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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** Workspace features. */ +@Fluent +public final class WorkspaceFeatures { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceFeatures.class); + + /* + * Flag that indicate if data should be exported. + */ + @JsonProperty(value = "enableDataExport") + private Boolean enableDataExport; + + /* + * Flag that describes if we want to remove the data after 30 days. + */ + @JsonProperty(value = "immediatePurgeDataOn30Days") + private Boolean immediatePurgeDataOn30Days; + + /* + * Flag that indicate which permission to use - resource or workspace or + * both. + */ + @JsonProperty(value = "enableLogAccessUsingOnlyResourcePermissions") + private Boolean enableLogAccessUsingOnlyResourcePermissions; + + /* + * Dedicated LA cluster resourceId that is linked to the workspaces. + */ + @JsonProperty(value = "clusterResourceId") + private String clusterResourceId; + + /* + * Disable Non-AAD based Auth. + */ + @JsonProperty(value = "disableLocalAuth") + private Boolean disableLocalAuth; + + /* + * Workspace features. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the enableDataExport property: Flag that indicate if data should be exported. + * + * @return the enableDataExport value. + */ + public Boolean enableDataExport() { + return this.enableDataExport; + } + + /** + * Set the enableDataExport property: Flag that indicate if data should be exported. + * + * @param enableDataExport the enableDataExport value to set. + * @return the WorkspaceFeatures object itself. + */ + public WorkspaceFeatures withEnableDataExport(Boolean enableDataExport) { + this.enableDataExport = enableDataExport; + return this; + } + + /** + * Get the immediatePurgeDataOn30Days property: Flag that describes if we want to remove the data after 30 days. + * + * @return the immediatePurgeDataOn30Days value. + */ + public Boolean immediatePurgeDataOn30Days() { + return this.immediatePurgeDataOn30Days; + } + + /** + * Set the immediatePurgeDataOn30Days property: Flag that describes if we want to remove the data after 30 days. + * + * @param immediatePurgeDataOn30Days the immediatePurgeDataOn30Days value to set. + * @return the WorkspaceFeatures object itself. + */ + public WorkspaceFeatures withImmediatePurgeDataOn30Days(Boolean immediatePurgeDataOn30Days) { + this.immediatePurgeDataOn30Days = immediatePurgeDataOn30Days; + return this; + } + + /** + * Get the enableLogAccessUsingOnlyResourcePermissions property: Flag that indicate which permission to use - + * resource or workspace or both. + * + * @return the enableLogAccessUsingOnlyResourcePermissions value. + */ + public Boolean enableLogAccessUsingOnlyResourcePermissions() { + return this.enableLogAccessUsingOnlyResourcePermissions; + } + + /** + * Set the enableLogAccessUsingOnlyResourcePermissions property: Flag that indicate which permission to use - + * resource or workspace or both. + * + * @param enableLogAccessUsingOnlyResourcePermissions the enableLogAccessUsingOnlyResourcePermissions value to set. + * @return the WorkspaceFeatures object itself. + */ + public WorkspaceFeatures withEnableLogAccessUsingOnlyResourcePermissions( + Boolean enableLogAccessUsingOnlyResourcePermissions) { + this.enableLogAccessUsingOnlyResourcePermissions = enableLogAccessUsingOnlyResourcePermissions; + return this; + } + + /** + * Get the clusterResourceId property: Dedicated LA cluster resourceId that is linked to the workspaces. + * + * @return the clusterResourceId value. + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the clusterResourceId property: Dedicated LA cluster resourceId that is linked to the workspaces. + * + * @param clusterResourceId the clusterResourceId value to set. + * @return the WorkspaceFeatures object itself. + */ + public WorkspaceFeatures withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the disableLocalAuth property: Disable Non-AAD based Auth. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: Disable Non-AAD based Auth. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the WorkspaceFeatures object itself. + */ + public WorkspaceFeatures withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** + * Get the additionalProperties property: Workspace features. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Workspace features. + * + * @param additionalProperties the additionalProperties value to set. + * @return the WorkspaceFeatures object itself. + */ + public WorkspaceFeatures withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 c1d0c35e8ed38..d4f17e4a51417 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 @@ -5,99 +5,40 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** The top level Workspace resource container. */ -@JsonFlatten @Fluent -public class WorkspacePatch extends AzureEntityResource { +public final class WorkspacePatch extends AzureEntityResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacePatch.class); /* - * Resource tags. Optional. - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * The provisioning state of the workspace. - */ - @JsonProperty(value = "properties.provisioningState") - private WorkspaceEntityStatus provisioningState; - - /* - * This is a read-only property. Represents the ID associated with the - * workspace. - */ - @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; - - /* - * The SKU of the workspace. - */ - @JsonProperty(value = "properties.sku") - private WorkspaceSku sku; - - /* - * The workspace data retention in days. Allowed values are per pricing - * plan. See pricing tiers documentation for details. - */ - @JsonProperty(value = "properties.retentionInDays") - private Integer retentionInDays; - - /* - * The daily volume cap for ingestion. - */ - @JsonProperty(value = "properties.workspaceCapping") - private WorkspaceCapping workspaceCapping; - - /* - * Workspace creation date. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private String createdDate; - - /* - * Workspace modification date. - */ - @JsonProperty(value = "properties.modifiedDate", access = JsonProperty.Access.WRITE_ONLY) - private String modifiedDate; - - /* - * The network access type for accessing Log Analytics ingestion. + * Workspace properties. */ - @JsonProperty(value = "properties.publicNetworkAccessForIngestion") - private PublicNetworkAccessType publicNetworkAccessForIngestion; + @JsonProperty(value = "properties") + private WorkspaceProperties innerProperties; /* - * The network access type for accessing Log Analytics query. - */ - @JsonProperty(value = "properties.publicNetworkAccessForQuery") - private PublicNetworkAccessType publicNetworkAccessForQuery; - - /* - * Indicates whether customer managed storage is mandatory for query - * management. - */ - @JsonProperty(value = "properties.forceCmkForQuery") - private Boolean forceCmkForQuery; - - /* - * List of linked private link scope resources. + * Resource tags. Optional. */ - @JsonProperty(value = "properties.privateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) - private List privateLinkScopedResources; + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * Workspace features. + /** + * Get the innerProperties property: Workspace properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.features") - private Map features; + private WorkspaceProperties innerProperties() { + return this.innerProperties; + } /** * Get the tags property: Resource tags. Optional. @@ -125,7 +66,7 @@ public WorkspacePatch withTags(Map tags) { * @return the provisioningState value. */ public WorkspaceEntityStatus provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -135,7 +76,10 @@ public WorkspaceEntityStatus provisioningState() { * @return the WorkspacePatch object itself. */ public WorkspacePatch withProvisioningState(WorkspaceEntityStatus provisioningState) { - this.provisioningState = provisioningState; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); return this; } @@ -145,7 +89,7 @@ public WorkspacePatch withProvisioningState(WorkspaceEntityStatus provisioningSt * @return the customerId value. */ public String customerId() { - return this.customerId; + return this.innerProperties() == null ? null : this.innerProperties().customerId(); } /** @@ -154,7 +98,7 @@ public String customerId() { * @return the sku value. */ public WorkspaceSku sku() { - return this.sku; + return this.innerProperties() == null ? null : this.innerProperties().sku(); } /** @@ -164,7 +108,10 @@ public WorkspaceSku sku() { * @return the WorkspacePatch object itself. */ public WorkspacePatch withSku(WorkspaceSku sku) { - this.sku = sku; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withSku(sku); return this; } @@ -175,7 +122,7 @@ public WorkspacePatch withSku(WorkspaceSku sku) { * @return the retentionInDays value. */ public Integer retentionInDays() { - return this.retentionInDays; + return this.innerProperties() == null ? null : this.innerProperties().retentionInDays(); } /** @@ -186,7 +133,10 @@ public Integer retentionInDays() { * @return the WorkspacePatch object itself. */ public WorkspacePatch withRetentionInDays(Integer retentionInDays) { - this.retentionInDays = retentionInDays; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withRetentionInDays(retentionInDays); return this; } @@ -196,7 +146,7 @@ public WorkspacePatch withRetentionInDays(Integer retentionInDays) { * @return the workspaceCapping value. */ public WorkspaceCapping workspaceCapping() { - return this.workspaceCapping; + return this.innerProperties() == null ? null : this.innerProperties().workspaceCapping(); } /** @@ -206,7 +156,10 @@ public WorkspaceCapping workspaceCapping() { * @return the WorkspacePatch object itself. */ public WorkspacePatch withWorkspaceCapping(WorkspaceCapping workspaceCapping) { - this.workspaceCapping = workspaceCapping; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withWorkspaceCapping(workspaceCapping); return this; } @@ -216,7 +169,7 @@ public WorkspacePatch withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * @return the createdDate value. */ public String createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -225,7 +178,7 @@ public String createdDate() { * @return the modifiedDate value. */ public String modifiedDate() { - return this.modifiedDate; + return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } /** @@ -234,7 +187,7 @@ public String modifiedDate() { * @return the publicNetworkAccessForIngestion value. */ public PublicNetworkAccessType publicNetworkAccessForIngestion() { - return this.publicNetworkAccessForIngestion; + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccessForIngestion(); } /** @@ -244,7 +197,10 @@ public PublicNetworkAccessType publicNetworkAccessForIngestion() { * @return the WorkspacePatch object itself. */ public WorkspacePatch withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion) { - this.publicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withPublicNetworkAccessForIngestion(publicNetworkAccessForIngestion); return this; } @@ -254,7 +210,7 @@ public WorkspacePatch withPublicNetworkAccessForIngestion(PublicNetworkAccessTyp * @return the publicNetworkAccessForQuery value. */ public PublicNetworkAccessType publicNetworkAccessForQuery() { - return this.publicNetworkAccessForQuery; + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccessForQuery(); } /** @@ -264,7 +220,10 @@ public PublicNetworkAccessType publicNetworkAccessForQuery() { * @return the WorkspacePatch object itself. */ public WorkspacePatch withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery) { - this.publicNetworkAccessForQuery = publicNetworkAccessForQuery; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withPublicNetworkAccessForQuery(publicNetworkAccessForQuery); return this; } @@ -274,7 +233,7 @@ public WorkspacePatch withPublicNetworkAccessForQuery(PublicNetworkAccessType pu * @return the forceCmkForQuery value. */ public Boolean forceCmkForQuery() { - return this.forceCmkForQuery; + return this.innerProperties() == null ? null : this.innerProperties().forceCmkForQuery(); } /** @@ -284,7 +243,10 @@ public Boolean forceCmkForQuery() { * @return the WorkspacePatch object itself. */ public WorkspacePatch withForceCmkForQuery(Boolean forceCmkForQuery) { - this.forceCmkForQuery = forceCmkForQuery; + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withForceCmkForQuery(forceCmkForQuery); return this; } @@ -294,7 +256,7 @@ public WorkspacePatch withForceCmkForQuery(Boolean forceCmkForQuery) { * @return the privateLinkScopedResources value. */ public List privateLinkScopedResources() { - return this.privateLinkScopedResources; + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopedResources(); } /** @@ -302,8 +264,8 @@ public List privateLinkScopedResources() { * * @return the features value. */ - public Map features() { - return this.features; + public WorkspaceFeatures features() { + return this.innerProperties() == null ? null : this.innerProperties().features(); } /** @@ -312,8 +274,11 @@ public Map features() { * @param features the features value to set. * @return the WorkspacePatch object itself. */ - public WorkspacePatch withFeatures(Map features) { - this.features = features; + public WorkspacePatch withFeatures(WorkspaceFeatures features) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFeatures(features); return this; } @@ -325,14 +290,8 @@ public WorkspacePatch withFeatures(Map features) { @Override public void validate() { super.validate(); - if (sku() != null) { - sku().validate(); - } - if (workspaceCapping() != null) { - workspaceCapping().validate(); - } - if (privateLinkScopedResources() != null) { - privateLinkScopedResources().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 798779b881d43..4d90829a3df55 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 @@ -21,18 +21,11 @@ public final class WorkspaceSku { private WorkspaceSkuNameEnum name; /* - * The capacity reservation level for this workspace, when + * The capacity reservation level in GB for this workspace, when * CapacityReservation sku is selected. */ @JsonProperty(value = "capacityReservationLevel") - private Integer capacityReservationLevel; - - /* - * The maximum capacity reservation level available for this workspace, - * when CapacityReservation sku is selected. - */ - @JsonProperty(value = "maxCapacityReservationLevel", access = JsonProperty.Access.WRITE_ONLY) - private Integer maxCapacityReservationLevel; + private CapacityReservationLevel capacityReservationLevel; /* * The last time when the sku was updated. @@ -61,37 +54,27 @@ public WorkspaceSku withName(WorkspaceSkuNameEnum name) { } /** - * Get the capacityReservationLevel property: The capacity reservation level for this workspace, when + * Get the capacityReservationLevel property: The capacity reservation level in GB for this workspace, when * CapacityReservation sku is selected. * * @return the capacityReservationLevel value. */ - public Integer capacityReservationLevel() { + public CapacityReservationLevel capacityReservationLevel() { return this.capacityReservationLevel; } /** - * Set the capacityReservationLevel property: The capacity reservation level for this workspace, when + * Set the capacityReservationLevel property: The capacity reservation level in GB for this workspace, when * CapacityReservation sku is selected. * * @param capacityReservationLevel the capacityReservationLevel value to set. * @return the WorkspaceSku object itself. */ - public WorkspaceSku withCapacityReservationLevel(Integer capacityReservationLevel) { + public WorkspaceSku withCapacityReservationLevel(CapacityReservationLevel capacityReservationLevel) { this.capacityReservationLevel = capacityReservationLevel; return this; } - /** - * Get the maxCapacityReservationLevel property: The maximum capacity reservation level available for this - * workspace, when CapacityReservation sku is selected. - * - * @return the maxCapacityReservationLevel value. - */ - public Integer maxCapacityReservationLevel() { - return this.maxCapacityReservationLevel; - } - /** * Get the lastSkuUpdate property: The last time when the sku was updated. * 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 new file mode 100644 index 0000000000000..6767da818dadf --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for AvailableServiceTiers ListByWorkspace. */ +public final class AvailableServiceTiersListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesAvailableServiceTiers.json + */ + /** + * Sample code: AvailableServiceTiers. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void availableServiceTiers(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.availableServiceTiers().listByWorkspaceWithResponse("rg1", "workspace1", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..f0cf79b4fe478 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// 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.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. */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersCreate.json + */ + /** + * Sample code: ClustersCreate. + * + * @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(); + } + + @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/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 new file mode 100644 index 0000000000000..152dee3b2209c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters Delete. */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersDelete.json + */ + /** + * Sample code: ClustersDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().delete("oiautorest6685", "oiautorest6685", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..fe72eb15d8b75 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters GetByResourceGroup. */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersGet.json + */ + /** + * Sample code: ClustersGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..698e8e0f41bea --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters ListByResourceGroup. */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersListByResourceGroup.json + */ + /** + * Sample code: ClustersGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().listByResourceGroup("oiautorest6685", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..aa1d5b7234775 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters List. */ +public final class ClustersListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersSubscriptionList.json + */ + /** + * Sample code: ClustersSubscriptionList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.clusters().list(Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..04940b930c26f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java @@ -0,0 +1,68 @@ +// 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.Context; +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.Identity; +import com.azure.resourcemanager.loganalytics.models.IdentityType; +import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; +import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersUpdate.json + */ + /** + * Sample code: ClustersPatch. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void clustersPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("tag1", "val1")) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserIdentityProperties()))) + .withSku( + new ClusterSku() + .withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) + .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyVaultUri("https://aztest2170.vault.azure.net") + .withKeyName("aztest2170cert") + .withKeyVersion("654ft6c4e63845cbb50fd6fg51540429") + .withKeyRsaSize(1024)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 0000000000000..8b62a268bfa5c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import java.util.Arrays; + +/** Samples for DataExports CreateOrUpdate. */ +public final class DataExportsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportCreateOrUpdate.json + */ + /** + * Sample code: DataExportCreate. + * + * @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(); + } +} 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 new file mode 100644 index 0000000000000..0dd6299f48d24 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for DataExports Delete. */ +public final class DataExportsDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportDelete.json + */ + /** + * Sample code: DataExportDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataExportDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().deleteWithResponse("RgTest1", "DeWnTest1234", "export1", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..76d9bfc5e2594 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for DataExports Get. */ +public final class DataExportsGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportGet.json + */ + /** + * Sample code: DataExportGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().getWithResponse("RgTest1", "DeWnTest1234", "export1", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..1c410768e331c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for DataExports ListByWorkspace. */ +public final class DataExportsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportListByWorkspace.json + */ + /** + * Sample code: DataExportGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataExportGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataExports().listByWorkspace("RgTest1", "DeWnTest1234", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..c8581e2d6759f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java @@ -0,0 +1,38 @@ +// 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.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.loganalytics.models.DataSourceKind; +import java.io.IOException; + +/** Samples for DataSources CreateOrUpdate. */ +public final class DataSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesCreate.json + */ + /** + * Sample code: DataSourcesCreate. + * + * @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) + .create(); + } +} 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 new file mode 100644 index 0000000000000..263a6746929fc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for DataSources Delete. */ +public final class DataSourcesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesDelete.json + */ + /** + * Sample code: DataSourcesDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataSourcesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataSources().deleteWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..18327723f0202 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for DataSources Get. */ +public final class DataSourcesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesGet.json + */ + /** + * Sample code: DataSourcesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataSourcesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.dataSources().getWithResponse("OIAutoRest5123", "AzTest9724", "AzTestDS774", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..227a5a9f34641 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DataSources ListByWorkspace. */ +public final class DataSourcesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesListByWorkspace.json + */ + /** + * Sample code: DataSourcesListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void dataSourcesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .dataSources() + .listByWorkspace("OIAutoRest5123", "AzTest9724", "kind='WindowsEvent'", null, Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..3484f0a8216b2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for DeletedWorkspaces ListByResourceGroup. */ +public final class DeletedWorkspacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesListByResourceGroup.json + */ + /** + * Sample code: WorkspacesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.deletedWorkspaces().listByResourceGroup("oiautorest6685", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..97ea7972f108f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for DeletedWorkspaces List. */ +public final class DeletedWorkspacesListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesSubscriptionList.json + */ + /** + * Sample code: WorkspacesSubscriptionList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.deletedWorkspaces().list(Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..95565bba5c4cc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Gateways Delete. */ +public final class GatewaysDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGatewaysDelete.json + */ + /** + * Sample code: DeleteGateways. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void deleteGateways(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .gateways() + .deleteWithResponse("OIAutoRest5123", "aztest5048", "00000000-0000-0000-0000-00000000000", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..b60f112540d58 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for IntelligencePacks Disable. */ +public final class IntelligencePacksDisableSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDisableIntelligencePack.json + */ + /** + * Sample code: IntelligencePacksDisable. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void intelligencePacksDisable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks().disableWithResponse("rg1", "TestLinkWS", "ChangeTracking", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..5a9a644e63ad0 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for IntelligencePacks Enable. */ +public final class IntelligencePacksEnableSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesEnableIntelligencePack.json + */ + /** + * Sample code: IntelligencePacksEnable. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void intelligencePacksEnable(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks().enableWithResponse("rg1", "TestLinkWS", "ChangeTracking", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..bce3cb4ebc347 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for IntelligencePacks List. */ +public final class IntelligencePacksListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListIntelligencePacks.json + */ + /** + * Sample code: IntelligencePacksList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void intelligencePacksList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.intelligencePacks().listWithResponse("rg1", "TestLinkWS", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..159e9be17ac4f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** Samples for LinkedServices CreateOrUpdate. */ +public final class LinkedServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesCreate.json + */ + /** + * Sample code: LinkedServicesCreate. + * + * @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") + .create(); + } +} 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 new file mode 100644 index 0000000000000..47366e5b2f2cc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkedServices Delete. */ +public final class LinkedServicesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesDelete.json + */ + /** + * Sample code: LinkedServicesDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void linkedServicesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices().delete("rg1", "TestLinkWS", "Cluster", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..5f27716eab025 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkedServices Get. */ +public final class LinkedServicesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-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", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..d618d2fa27f94 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkedServices ListByWorkspace. */ +public final class LinkedServicesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesListByWorkspace.json + */ + /** + * Sample code: LinkedServicesListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void linkedServicesListByWorkspace( + com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedServices().listByWorkspace("mms-eus", "TestLinkWS", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..525c45c7207c8 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.resourcemanager.loganalytics.models.DataSourceType; +import java.util.Arrays; + +/** Samples for LinkedStorageAccounts CreateOrUpdate. */ +public final class LinkedStorageAccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsCreate.json + */ + /** + * Sample code: LinkedStorageAccountsCreate. + * + * @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(); + } +} 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 new file mode 100644 index 0000000000000..f61f09fecc9a6 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; +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/2020-08-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, Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..0972a2ac456f9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.models.DataSourceType; + +/** Samples for LinkedStorageAccounts Get. */ +public final class LinkedStorageAccountsGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsGet.json + */ + /** + * Sample code: LinkedStorageAccountsGet. + * + * @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, Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..d80b7395362ca --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkedStorageAccounts ListByWorkspace. */ +public final class LinkedStorageAccountsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsListByWorkspace.json + */ + /** + * Sample code: Gets list of linked storage accounts on a workspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void getsListOfLinkedStorageAccountsOnAWorkspace( + com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.linkedStorageAccounts().listByWorkspace("mms-eus", "testLinkStorageAccountsWS", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..4a062b0455c3f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagementGroups List. */ +public final class ManagementGroupsListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json + */ + /** + * Sample code: WorkspacesListManagementGroups. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesListManagementGroups( + com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.managementGroups().list("rg1", "TestLinkWS", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..7cbaf590cc78a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationStatuses Get. */ +public final class OperationStatusesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.json + */ + /** + * Sample code: Get specific operation status. + * + * @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", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..548761e6abecf --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-10-01/examples/OperationsListByTenant.json + */ + /** + * Sample code: Get specific operation status. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void getSpecificOperationStatus(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.operations().list(Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..feb710f25f408 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.resourcemanager.loganalytics.models.Tag; +import java.util.Arrays; + +/** Samples for SavedSearches CreateOrUpdate. */ +public final class SavedSearchesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json + */ + /** + * Sample code: SavedSearchCreateOrUpdate. + * + * @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(); + } +} 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 new file mode 100644 index 0000000000000..5e92dc4fc78c2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SavedSearches Delete. */ +public final class SavedSearchesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDeleteSavedSearches.json + */ + /** + * Sample code: SavedSearchesDelete. + * + * @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", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..13a11aaf8c9a0 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SavedSearches Get. */ +public final class SavedSearchesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesGet.json + */ + /** + * Sample code: SavedSearchesGet. + * + * @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", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..490d1acabb6ed --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for SavedSearches ListByWorkspace. */ +public final class SavedSearchesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesListByWorkspace.json + */ + /** + * Sample code: SavedSearchesList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void savedSearchesList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.savedSearches().listByWorkspaceWithResponse("TestRG", "TestWS", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..8c084078b77ec --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Schema Get. */ +public final class SchemaGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesGetSchema.json + */ + /** + * Sample code: WorkspacesGetSchema. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesGetSchema(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.schemas().getWithResponse("mms-eus", "atlantisdemo", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..54d8dbb45b571 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedKeysOperation GetSharedKeys. */ +public final class SharedKeysOperationGetSharedKeysSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGetSharedKeys.json + */ + /** + * Sample code: SharedKeysList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void sharedKeysList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.sharedKeysOperations().getSharedKeysWithResponse("rg1", "TestLinkWS", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..73405bc5e328b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedKeysOperation Regenerate. */ +public final class SharedKeysOperationRegenerateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesRegenerateSharedKeys.json + */ + /** + * Sample code: RegenerateSharedKeys. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void regenerateSharedKeys(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.sharedKeysOperations().regenerateWithResponse("rg1", "workspace1", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..81d88ae4da847 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.resourcemanager.loganalytics.models.StorageAccount; +import java.util.Arrays; + +/** Samples for StorageInsightConfigs CreateOrUpdate. */ +public final class StorageInsightConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsCreateOrUpdate.json + */ + /** + * Sample code: StorageInsightsCreate. + * + * @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("1234")) + .create(); + } +} 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 new file mode 100644 index 0000000000000..be25c5eb9070d --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for StorageInsightConfigs Delete. */ +public final class StorageInsightConfigsDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsDelete.json + */ + /** + * Sample code: StorageInsightsDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void storageInsightsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .storageInsightConfigs() + .deleteWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..0591beab3d5d8 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageInsightConfigs Get. */ +public final class StorageInsightConfigsGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsGet.json + */ + /** + * Sample code: StorageInsightsGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void storageInsightsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs().getWithResponse("OIAutoRest5123", "aztest5048", "AzTestSI1110", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..414bbc9f71320 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageInsightConfigs ListByWorkspace. */ +public final class StorageInsightConfigsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsListByWorkspace.json + */ + /** + * Sample code: StorageInsightsList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void storageInsightsList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.storageInsightConfigs().listByWorkspace("OIAutoRest5123", "aztest5048", Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateSamples.java new file mode 100644 index 0000000000000..7458ed5fe84a8 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** Samples for Tables Create. */ +public final class TablesCreateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesCreate.json + */ + /** + * Sample code: TablesSet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesSet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager + .tables() + .define("table1") + .withExistingWorkspace("oiautorest6685", "oiautorest6685") + .withRetentionInDays(40) + .withIsTroubleshootEnabled(false) + .create(); + } +} 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 new file mode 100644 index 0000000000000..304d465482702 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Tables Get. */ +public final class TablesGetSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesGet.json + */ + /** + * Sample code: TablesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables().getWithResponse("oiautorest6685", "oiautorest6685", "table1", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..a011deaa97072 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Tables ListByWorkspace. */ +public final class TablesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesList.json + */ + /** + * Sample code: TablesListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.tables().listByWorkspace("oiautorest6685", "oiautorest6685", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..1666afa27a16b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.models.Table; + +/** Samples for Tables Update. */ +public final class TablesUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/TablesUpdate.json + */ + /** + * Sample code: TablesSet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void tablesSet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Table resource = + manager.tables().getWithResponse("oiautorest6685", "oiautorest6685", "table1", Context.NONE).getValue(); + resource.update().withRetentionInDays(40).withIsTroubleshootEnabled(true).apply(); + } +} 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 new file mode 100644 index 0000000000000..19a3783d62b2f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-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", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..7141f97c990c8 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkspacePurge GetPurgeStatus. */ +public final class WorkspacePurgeGetPurgeStatusSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeOperation.json + */ + /** + * Sample code: WorkspacePurgeOperation. + * + * @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", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..6e95ae4d83b98 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBody; +import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBodyFilters; +import java.util.Arrays; + +/** Samples for WorkspacePurge Purge. */ +public final class WorkspacePurgePurgeSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-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"))), + Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..c4782fb05c02c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; +import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Workspaces CreateOrUpdate. */ +public final class WorkspacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesCreate.json + */ + /** + * Sample code: WorkspacesCreate. + * + * @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(); + } + + @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/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 new file mode 100644 index 0000000000000..a8f094b3e9fa9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces Delete. */ +public final class WorkspacesDeleteSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesDelete.json + */ + /** + * Sample code: WorkspacesDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().delete("oiautorest6685", "oiautorest6685", null, 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 new file mode 100644 index 0000000000000..7c4237810e63b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces GetByResourceGroup. */ +public final class WorkspacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesGet.json + */ + /** + * Sample code: WorkspaceGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspaceGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..36ebdbd3255d5 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces ListByResourceGroup. */ +public final class WorkspacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesListByResourceGroup.json + */ + /** + * Sample code: WorkspacesGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().listByResourceGroup("oiautorest6685", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..ee5da19e6ab88 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces List. */ +public final class WorkspacesListSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesSubscriptionList.json + */ + /** + * Sample code: WorkspacesSubscriptionList. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesSubscriptionList(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().list(Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..59060e4faddf9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.Context; +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 Workspaces Update. */ +public final class WorkspacesUpdateSamples { + /* + * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesUpdate.json + */ + /** + * Sample code: WorkspacesPatch. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesPatch(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + Workspace resource = + manager + .workspaces() + .getByResourceGroupWithResponse("oiautorest6685", "oiautorest6685", Context.NONE) + .getValue(); + resource + .update() + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018)) + .withRetentionInDays(30) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(-1.0)) + .apply(); + } +}