diff --git a/eng/automation/api-specs.yaml b/eng/automation/api-specs.yaml index 1099611e15fa..5b00ec3e97e2 100644 --- a/eng/automation/api-specs.yaml +++ b/eng/automation/api-specs.yaml @@ -110,6 +110,8 @@ offazurespringboot: service: springappdiscovery operationalinsights: service: loganalytics +operationalinsights/Microsoft.OperationalInsights/OperationalInsights: + service: loganalytics oracle: service: oracledatabase paloaltonetworks: diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 37c62f75daba..9e332145b9d9 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -307,7 +307,7 @@ com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.5.0;1.6.0 com.azure.resourcemanager:azure-resourcemanager-kusto;1.2.0;1.3.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.1.0;2.0.0 com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.2.0;1.3.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confluent;1.2.0;1.3.0-beta.1 diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md index 2dd0a420e7db..a2d2c16e79bf 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md @@ -1,14 +1,208 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 2.0.0 (2025-12-22) -### Features Added +- Azure Resource Manager LogAnalytics client library for Java. This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2025-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.AzureResourceProperties` was removed + +#### `models.SystemDataAutoGenerated` was removed + +#### `models.CreatedByType` was removed + +#### `models.QueryPacksResource` was removed + +#### `models.Capacity` was removed + +#### `models.CapacityReservationLevel` was removed + +#### `models.CapacityReservationProperties` was modified + +* `java.lang.String lastSkuUpdate()` -> `java.time.OffsetDateTime lastSkuUpdate()` + +#### `models.WorkspacePatch` was modified + +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` +* `java.lang.String modifiedDate()` -> `java.time.OffsetDateTime modifiedDate()` + +#### `models.Workspace` was modified + +* `java.lang.String modifiedDate()` -> `java.time.OffsetDateTime modifiedDate()` +* `models.SystemDataAutoGenerated systemData()` -> `com.azure.core.management.SystemData systemData()` +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` + +#### `models.WorkspaceSku` was modified + +* `java.lang.String lastSkuUpdate()` -> `java.time.OffsetDateTime lastSkuUpdate()` +* `models.CapacityReservationLevel capacityReservationLevel()` -> `java.lang.Integer capacityReservationLevel()` +* `withCapacityReservationLevel(models.CapacityReservationLevel)` was removed + +#### `models.AssociatedWorkspace` was modified + +* `java.lang.String associateDate()` -> `java.time.OffsetDateTime associateDate()` +* `java.lang.String workspaceId()` -> `java.util.UUID workspaceId()` + +#### `models.Table` was modified + +* `models.SystemDataAutoGenerated systemData()` -> `com.azure.core.management.SystemData systemData()` + +#### `models.Cluster` was modified + +* `java.lang.String lastModifiedDate()` -> `java.time.OffsetDateTime lastModifiedDate()` +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` + +#### `models.IdentityType` was modified + +* `IdentityType()` was removed +* `java.util.Collection values()` -> `models.IdentityType[] values()` + +#### `models.ClusterSku` was modified + +* `models.Capacity capacity()` -> `java.lang.Long capacity()` +* `withCapacity(models.Capacity)` was removed + +### Features Added + +* `models.SummaryLogs$DefinitionStages` was added + +* `models.WorkspaceReplicationProperties` was added + +* `models.AccessRulePropertiesSubscriptionsItem` was added + +* `models.WorkspaceFailoverProperties` was added + +* `models.SummaryLogs$Definition` was added + +* `models.SummaryLogsListResult` was added + +* `models.ProvisioningIssue` was added + +* `models.AccessRuleProperties` was added + +* `models.ClusterReplicationProperties` was added + +* `models.ClusterReplicationState` was added + +* `models.SummaryLogsOperations` was added + +* `models.NetworkSecurityPerimeterConfigurationListResult` was added + +* `models.AccessRule` was added + +* `models.RuleDefinition` was added + +* `models.NetworkSecurityPerimeter` was added + +* `models.ResourceAssociation` was added + +* `models.NetworkSecurityProfile` was added + +* `models.NetworkSecurityPerimeterConfigurationProperties` was added + +* `models.SummaryLogs$UpdateStages` was added + +* `models.IssueType` was added + +* `models.AccessRuleDirection` was added + +* `models.SummaryLogsRetryBin` was added + +* `models.ResourceAssociationAccessMode` was added + +* `models.Severity` was added + +* `models.StatusCodeEnum` was added + +* `models.NetworkSecurityPerimeterConfigurationProvisioningState` was added + +* `models.SummaryLogs$Update` was added + +* `models.ProvisioningIssueProperties` was added + +* `models.NetworkSecurityPerimeterConfiguration` was added + +* `models.WorkspaceReplicationState` was added + +* `models.RuleTypeEnum` was added + +* `models.SummaryLogsRetryBinProperties` was added + +* `models.SummaryLogs` was added + +* `models.TimeSelectorEnum` was added + +* `models.WorkspaceFailoverState` was added + +#### `models.Cluster$Definition` was modified + +* `withReplication(models.ClusterReplicationProperties)` was added + +#### `LogAnalyticsManager` was modified + +* `summaryLogsOperations()` was added + +#### `models.WorkspaceFeatures` was modified + +* `unifiedSentinelBillingOnly()` was added +* `associations()` was added + +#### `models.Workspace$Update` was modified + +* `withFailover(models.WorkspaceFailoverProperties)` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added + +#### `models.Workspace$Definition` was modified + +* `withFailover(models.WorkspaceFailoverProperties)` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added + +#### `models.WorkspacePatch` was modified + +* `failover()` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added +* `replication()` was added +* `withFailover(models.WorkspaceFailoverProperties)` was added + +#### `models.Workspace` was modified + +* `replication()` was added +* `failover()` was added + +#### `models.LogAnalyticsQueryPack` was modified + +* `systemData()` was added + +#### `models.WorkspaceSku` was modified + +* `withCapacityReservationLevel(java.lang.Integer)` was added + +#### `models.Workspaces` was modified + +* `listNsp(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getNsp(java.lang.String,java.lang.String,java.lang.String)` was added +* `failover(java.lang.String,java.lang.String,java.lang.String)` was added +* `failback(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `failover(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `reconcileNsp(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `failback(java.lang.String,java.lang.String)` was added +* `getNspWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `reconcileNsp(java.lang.String,java.lang.String,java.lang.String)` was added +* `listNsp(java.lang.String,java.lang.String)` was added + +#### `models.Cluster` was modified + +* `replication()` was added + +#### `models.IdentityType` was modified + +* `valueOf(java.lang.String)` was added +* `toString()` was added + +#### `models.ClusterSku` was modified -### Other Changes +* `withCapacity(java.lang.Long)` was added ## 1.1.0 (2024-12-13) diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md index 0badc4533918..2d6a5400ad82 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md @@ -2,7 +2,7 @@ Azure Resource Manager LogAnalytics client library for Java. -This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2025-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-loganalytics - 1.2.0-beta.1 + 2.0.0 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ LogAnalyticsManager manager = LogAnalyticsManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -107,5 +107,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md index 672f15ccedf6..b42d29de4b1f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md @@ -111,6 +111,16 @@ - [Get](#storageinsightconfigs_get) - [ListByWorkspace](#storageinsightconfigs_listbyworkspace) +## SummaryLogsOperation + +- [CreateOrUpdate](#summarylogsoperation_createorupdate) +- [Delete](#summarylogsoperation_delete) +- [Get](#summarylogsoperation_get) +- [ListByWorkspace](#summarylogsoperation_listbyworkspace) +- [RetryBin](#summarylogsoperation_retrybin) +- [Start](#summarylogsoperation_start) +- [Stop](#summarylogsoperation_stop) + ## Tables - [CancelSearch](#tables_cancelsearch) @@ -134,9 +144,14 @@ - [CreateOrUpdate](#workspaces_createorupdate) - [Delete](#workspaces_delete) +- [Failback](#workspaces_failback) +- [Failover](#workspaces_failover) - [GetByResourceGroup](#workspaces_getbyresourcegroup) +- [GetNsp](#workspaces_getnsp) - [List](#workspaces_list) - [ListByResourceGroup](#workspaces_listbyresourcegroup) +- [ListNsp](#workspaces_listnsp) +- [ReconcileNsp](#workspaces_reconcilensp) - [Update](#workspaces_update) ### AvailableServiceTiers_ListByWorkspace @@ -147,8 +162,8 @@ public final class AvailableServiceTiersListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesAvailableServiceTiers.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesAvailableServiceTiers.json */ /** * Sample code: AvailableServiceTiers. @@ -165,7 +180,6 @@ public final class AvailableServiceTiersListByWorkspaceSamples { ### Clusters_CreateOrUpdate ```java -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; import java.util.HashMap; @@ -177,8 +191,8 @@ import java.util.Map; public final class ClustersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersCreate.json */ /** * Sample code: ClustersCreate. @@ -188,11 +202,10 @@ public final class ClustersCreateOrUpdateSamples { public static void clustersCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { manager.clusters() .define("oiautorest6685") - .withRegion("australiasoutheast") + .withRegion("eastus") .withExistingResourceGroup("oiautorest6685") .withTags(mapOf("tag1", "val1")) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(100L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .create(); } @@ -219,8 +232,8 @@ public final class ClustersCreateOrUpdateSamples { public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersDelete.json */ /** * Sample code: ClustersDelete. @@ -242,8 +255,8 @@ public final class ClustersDeleteSamples { public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersGet.json */ /** * Sample code: ClustersGet. @@ -266,8 +279,8 @@ public final class ClustersGetByResourceGroupSamples { public final class ClustersListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersSubscriptionList.json */ /** * Sample code: ClustersSubscriptionList. @@ -289,8 +302,8 @@ public final class ClustersListSamples { public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersListByResourceGroup.json */ /** * Sample code: ClustersGet. @@ -306,7 +319,6 @@ public final class ClustersListByResourceGroupSamples { ### Clusters_Update ```java -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.Cluster; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; @@ -323,8 +335,8 @@ import java.util.Map; public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersUpdate.json */ /** * Sample code: ClustersPatch. @@ -341,8 +353,7 @@ public final class ClustersUpdateSamples { .withUserAssignedIdentities(mapOf( "/subscriptions/53bc36c5-91e1-4d09-92c9-63b89e571926/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", new UserAssignedIdentity()))) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(1000L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .withKeyVaultProperties(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") .withKeyName("fakeTokenPlaceholder") .withKeyVersion("fakeTokenPlaceholder") @@ -375,8 +386,8 @@ import java.util.Arrays; public final class DataExportsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportCreateOrUpdate.json */ /** * Sample code: DataExportCreate. @@ -404,8 +415,8 @@ public final class DataExportsCreateOrUpdateSamples { public final class DataExportsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportDelete.json */ /** * Sample code: DataExportDelete. @@ -428,8 +439,8 @@ public final class DataExportsDeleteSamples { public final class DataExportsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportGet.json */ /** * Sample code: DataExportGet. @@ -451,8 +462,8 @@ public final class DataExportsGetSamples { public final class DataExportsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportListByWorkspace.json */ /** * Sample code: DataExportGet. @@ -479,8 +490,8 @@ import java.io.IOException; public final class DataSourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesCreate.json */ /** * Sample code: DataSourcesCreate. @@ -511,8 +522,8 @@ public final class DataSourcesCreateOrUpdateSamples { public final class DataSourcesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesDelete.json */ /** * Sample code: DataSourcesDelete. @@ -535,8 +546,8 @@ public final class DataSourcesDeleteSamples { public final class DataSourcesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesGet.json */ /** * Sample code: DataSourcesGet. @@ -559,8 +570,8 @@ public final class DataSourcesGetSamples { public final class DataSourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesListByWorkspace.json */ /** * Sample code: DataSourcesListByWorkspace. @@ -584,8 +595,8 @@ public final class DataSourcesListByWorkspaceSamples { public final class DeletedWorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. @@ -607,8 +618,8 @@ public final class DeletedWorkspacesListSamples { public final class DeletedWorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. @@ -630,8 +641,8 @@ public final class DeletedWorkspacesListByResourceGroupSamples { public final class GatewaysDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGatewaysDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGatewaysDelete.json */ /** * Sample code: DeleteGateways. @@ -655,8 +666,8 @@ public final class GatewaysDeleteSamples { public final class IntelligencePacksDisableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDisableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDisableIntelligencePack.json */ /** * Sample code: IntelligencePacksDisable. @@ -679,8 +690,8 @@ public final class IntelligencePacksDisableSamples { public final class IntelligencePacksEnableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesEnableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesEnableIntelligencePack.json */ /** * Sample code: IntelligencePacksEnable. @@ -703,8 +714,8 @@ public final class IntelligencePacksEnableSamples { public final class IntelligencePacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListIntelligencePacks.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListIntelligencePacks.json */ /** * Sample code: IntelligencePacksList. @@ -726,8 +737,8 @@ public final class IntelligencePacksListSamples { public final class LinkedServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesCreate.json */ /** * Sample code: LinkedServicesCreate. @@ -754,8 +765,8 @@ public final class LinkedServicesCreateOrUpdateSamples { public final class LinkedServicesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesDelete.json */ /** * Sample code: LinkedServicesDelete. @@ -777,8 +788,8 @@ public final class LinkedServicesDeleteSamples { public final class LinkedServicesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesGet.json */ /** * Sample code: LinkedServicesGet. @@ -800,8 +811,8 @@ public final class LinkedServicesGetSamples { public final class LinkedServicesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesListByWorkspace.json */ /** * Sample code: LinkedServicesListByWorkspace. @@ -827,8 +838,8 @@ import java.util.Arrays; public final class LinkedStorageAccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsCreate.json */ /** * Sample code: LinkedStorageAccountsCreate. @@ -858,8 +869,8 @@ import com.azure.resourcemanager.loganalytics.models.DataSourceType; public final class LinkedStorageAccountsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsDelete.json */ /** * Sample code: LinkedStorageAccountsDelete. @@ -885,8 +896,8 @@ import com.azure.resourcemanager.loganalytics.models.DataSourceType; public final class LinkedStorageAccountsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsGet.json */ /** * Sample code: LinkedStorageAccountsGet. @@ -910,8 +921,8 @@ public final class LinkedStorageAccountsGetSamples { public final class LinkedStorageAccountsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsListByWorkspace.json */ /** * Sample code: Gets list of linked storage accounts on a workspace. @@ -935,8 +946,8 @@ public final class LinkedStorageAccountsListByWorkspaceSamples { public final class ManagementGroupsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListManagementGroups.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListManagementGroups.json */ /** * Sample code: WorkspacesListManagementGroups. @@ -959,8 +970,8 @@ public final class ManagementGroupsListSamples { public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * OperationStatusesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationStatusesGet.json */ /** * Sample code: Get specific operation status. @@ -983,8 +994,8 @@ public final class OperationStatusesGetSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * OperationsListByTenant.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationsListByTenant.json */ /** * Sample code: Get specific operation status. @@ -1006,8 +1017,8 @@ public final class OperationsListSamples { public final class QueriesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesDelete.json */ /** * Sample code: QueryDelete. @@ -1031,8 +1042,8 @@ public final class QueriesDeleteSamples { public final class QueriesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesGet.json */ /** * Sample code: QueryGet. @@ -1056,8 +1067,8 @@ public final class QueriesGetSamples { public final class QueriesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesList.json */ /** * Sample code: QueryList. @@ -1084,8 +1095,8 @@ import java.util.Map; public final class QueriesPutSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesPut.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesPut.json */ /** * Sample code: QueryPut. @@ -1134,8 +1145,8 @@ import java.util.Map; public final class QueriesSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesSearch.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesSearch.json */ /** * Sample code: QuerySearch. @@ -1181,8 +1192,8 @@ import java.util.Map; public final class QueriesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesUpdate.json */ /** * Sample code: QueryPatch. @@ -1230,8 +1241,8 @@ import java.util.Map; public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreate.json */ /** * Sample code: QueryPackCreate. @@ -1248,8 +1259,8 @@ public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdate.json */ /** * Sample code: QueryPackUpdate. @@ -1292,8 +1303,8 @@ import java.util.Map; public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreateNoName.json */ /** * Sample code: QueryPackCreateNoName. @@ -1308,8 +1319,8 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackUpdateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackUpdateNoName.json */ /** * Sample code: QueryPackUpdateNoName. @@ -1346,8 +1357,8 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { public final class QueryPacksDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksDelete.json */ /** * Sample code: QueryPacksDelete. @@ -1370,8 +1381,8 @@ public final class QueryPacksDeleteSamples { public final class QueryPacksGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksGet.json */ /** * Sample code: QueryPackGet. @@ -1394,8 +1405,8 @@ public final class QueryPacksGetByResourceGroupSamples { public final class QueryPacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksList.json */ /** * Sample code: QueryPacksList. @@ -1417,8 +1428,8 @@ public final class QueryPacksListSamples { public final class QueryPacksListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksListByResourceGroup.json */ /** * Sample code: QueryPackListByResourceGroup. @@ -1445,8 +1456,8 @@ import java.util.Map; public final class QueryPacksUpdateTagsSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdateTagsOnly.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdateTagsOnly.json */ /** * Sample code: QueryPackUpdateTagsOnly. @@ -1486,8 +1497,8 @@ import java.util.Arrays; public final class SavedSearchesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json */ /** * Sample code: SavedSearchCreateOrUpdate. @@ -1519,8 +1530,8 @@ public final class SavedSearchesCreateOrUpdateSamples { public final class SavedSearchesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDeleteSavedSearches.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDeleteSavedSearches.json */ /** * Sample code: SavedSearchesDelete. @@ -1544,8 +1555,8 @@ public final class SavedSearchesDeleteSamples { public final class SavedSearchesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesGet.json */ /** * Sample code: SavedSearchesGet. @@ -1569,8 +1580,8 @@ public final class SavedSearchesGetSamples { public final class SavedSearchesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesListByWorkspace.json */ /** * Sample code: SavedSearchesList. @@ -1592,8 +1603,8 @@ public final class SavedSearchesListByWorkspaceSamples { public final class SchemaGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesGetSchema.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesGetSchema.json */ /** * Sample code: WorkspacesGetSchema. @@ -1615,8 +1626,8 @@ public final class SchemaGetSamples { public final class SharedKeysOperationGetSharedKeysSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGetSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGetSharedKeys.json */ /** * Sample code: SharedKeysList. @@ -1638,8 +1649,8 @@ public final class SharedKeysOperationGetSharedKeysSamples { public final class SharedKeysOperationRegenerateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesRegenerateSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesRegenerateSharedKeys.json */ /** * Sample code: RegenerateSharedKeys. @@ -1664,8 +1675,8 @@ import java.util.Arrays; public final class StorageInsightConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsCreateOrUpdate.json */ /** * Sample code: StorageInsightsCreate. @@ -1695,8 +1706,8 @@ public final class StorageInsightConfigsCreateOrUpdateSamples { public final class StorageInsightConfigsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsDelete.json */ /** * Sample code: StorageInsightsDelete. @@ -1719,8 +1730,8 @@ public final class StorageInsightConfigsDeleteSamples { public final class StorageInsightConfigsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsGet.json */ /** * Sample code: StorageInsightsGet. @@ -1743,8 +1754,8 @@ public final class StorageInsightConfigsGetSamples { public final class StorageInsightConfigsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsListByWorkspace.json */ /** * Sample code: StorageInsightsList. @@ -1758,6 +1769,192 @@ public final class StorageInsightConfigsListByWorkspaceSamples { } ``` +### SummaryLogsOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation CreateOrUpdate. + */ +public final class SummaryLogsOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsUpsert.json + */ + /** + * Sample code: SummaryLogsUpsert. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .define("summarylogs1") + .withExistingWorkspace("oiautorest6685", "oiautorest6685") + .withRuleType(RuleTypeEnum.USER) + .withRuleDefinition(new RuleDefinition().withQuery("MyTable_CL") + .withBinSize(180) + .withBinDelay(10) + .withBinStartTime(OffsetDateTime.parse("2020-02-03T04:05:06Z"))) + .create(); + } +} +``` + +### SummaryLogsOperation_Delete + +```java +/** + * Samples for SummaryLogsOperation Delete. + */ +public final class SummaryLogsOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsDelete.json + */ + /** + * Sample code: SummaryLogsDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .delete("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_Get + +```java +/** + * Samples for SummaryLogsOperation Get. + */ +public final class SummaryLogsOperationGetSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsGet.json + */ + /** + * Sample code: SummaryLogsGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .getWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_ListByWorkspace + +```java +/** + * Samples for SummaryLogsOperation ListByWorkspace. + */ +public final class SummaryLogsOperationListByWorkspaceSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsList.json + */ + /** + * Sample code: SummaryLogsListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .listByWorkspace("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_RetryBin + +```java +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation RetryBin. + */ +public final class SummaryLogsOperationRetryBinSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsRetryBin.json + */ + /** + * Sample code: SummaryLogsRetryBin. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsRetryBin(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .retryBin("oiautorest6685", "oiautorest6685", "summarylogs1", + new SummaryLogsRetryBin().withProperties(new SummaryLogsRetryBinProperties() + .withRetryBinStartTime(OffsetDateTime.parse("2020-02-03T04:00:00Z"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_Start + +```java +/** + * Samples for SummaryLogsOperation Start. + */ +public final class SummaryLogsOperationStartSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStart.json + */ + /** + * Sample code: SummaryLogsStart. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStart(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .start("exampleresourcegroup", "exampleworkspace", "summarylogs3", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_Stop + +```java +/** + * Samples for SummaryLogsOperation Stop. + */ +public final class SummaryLogsOperationStopSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStop.json + */ + /** + * Sample code: SummaryLogsStop. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStop(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .stopWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} +``` + ### Tables_CancelSearch ```java @@ -1767,8 +1964,8 @@ public final class StorageInsightConfigsListByWorkspaceSamples { public final class TablesCancelSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesSearchCancel.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesSearchCancel.json */ /** * Sample code: TablesSearchCancel. @@ -1797,8 +1994,8 @@ import java.util.Arrays; public final class TablesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. @@ -1827,8 +2024,8 @@ public final class TablesCreateOrUpdateSamples { public final class TablesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesDelete.json */ /** * Sample code: TablesDelete. @@ -1850,8 +2047,8 @@ public final class TablesDeleteSamples { public final class TablesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesGet.json */ /** * Sample code: TablesGet. @@ -1874,8 +2071,8 @@ public final class TablesGetSamples { public final class TablesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesList.json */ /** * Sample code: TablesListByWorkspace. @@ -1897,8 +2094,8 @@ public final class TablesListByWorkspaceSamples { public final class TablesMigrateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesMigrate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesMigrate.json */ /** * Sample code: TablesMigrate. @@ -1927,8 +2124,8 @@ import java.util.Arrays; public final class TablesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. @@ -1958,8 +2155,8 @@ public final class TablesUpdateSamples { public final class UsagesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListUsages.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListUsages.json */ /** * Sample code: UsagesList. @@ -1981,8 +2178,8 @@ public final class UsagesListSamples { public final class WorkspacePurgeGetPurgeStatusSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeOperation.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeOperation.json */ /** * Sample code: WorkspacePurgeOperation. @@ -2010,8 +2207,8 @@ import java.util.Arrays; public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeResourceId.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeResourceId.json */ /** * Sample code: WorkspacePurgeResourceId. @@ -2030,8 +2227,8 @@ public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurge.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurge.json */ /** * Sample code: WorkspacePurge. @@ -2064,8 +2261,8 @@ import java.util.Map; public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesCreate.json */ /** * Sample code: WorkspacesCreate. @@ -2106,8 +2303,8 @@ public final class WorkspacesCreateOrUpdateSamples { public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDelete.json */ /** * Sample code: WorkspacesDelete. @@ -2120,6 +2317,52 @@ public final class WorkspacesDeleteSamples { } ``` +### Workspaces_Failback + +```java +/** + * Samples for Workspaces Failback. + */ +public final class WorkspacesFailbackSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailback.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failback("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_Failover + +```java +/** + * Samples for Workspaces Failover. + */ +public final class WorkspacesFailoverSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailover.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failover("oiautorest6685", "eastus", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} +``` + ### Workspaces_GetByResourceGroup ```java @@ -2129,8 +2372,8 @@ public final class WorkspacesDeleteSamples { public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGet.json */ /** * Sample code: WorkspaceGet. @@ -2144,6 +2387,32 @@ public final class WorkspacesGetByResourceGroupSamples { } ``` +### Workspaces_GetNsp + +```java +/** + * Samples for Workspaces GetNsp. + */ +public final class WorkspacesGetNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Get.json + */ + /** + * Sample code: Get NSP config by name for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + getNSPConfigByNameForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .getNspWithResponse("exampleRG", "someWorkspace", "somePerimeterConfiguration", + com.azure.core.util.Context.NONE); + } +} +``` + ### Workspaces_List ```java @@ -2153,8 +2422,8 @@ public final class WorkspacesGetByResourceGroupSamples { public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. @@ -2176,8 +2445,8 @@ public final class WorkspacesListSamples { public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. @@ -2190,6 +2459,55 @@ public final class WorkspacesListByResourceGroupSamples { } ``` +### Workspaces_ListNsp + +```java +/** + * Samples for Workspaces ListNsp. + */ +public final class WorkspacesListNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_List.json + */ + /** + * Sample code: List NSP configs by Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + listNSPConfigsByScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().listNsp("exampleRG", "someWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_ReconcileNsp + +```java +/** + * Samples for Workspaces ReconcileNsp. + */ +public final class WorkspacesReconcileNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Reconcile.json + */ + /** + * Sample code: Reconcile NSP config for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + reconcileNSPConfigForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .reconcileNsp("exampleRG", "someWorkspace", "somePerimeterConfiguration", com.azure.core.util.Context.NONE); + } +} +``` + ### Workspaces_Update ```java @@ -2204,8 +2522,8 @@ import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesUpdate.json */ /** * Sample code: WorkspacesPatch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml index eb5b604f5d24..8e25000311ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-loganalytics - 1.2.0-beta.1 + 2.0.0 jar Microsoft Azure SDK for LogAnalytics Management - This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2022-10. + This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2025-07-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - false true diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java index d6bdc947ef43..67e3a361ae94 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.OperationalInsightsManagementClient; import com.azure.resourcemanager.loganalytics.implementation.AvailableServiceTiersImpl; @@ -43,6 +44,7 @@ import com.azure.resourcemanager.loganalytics.implementation.SchemasImpl; import com.azure.resourcemanager.loganalytics.implementation.SharedKeysOperationsImpl; import com.azure.resourcemanager.loganalytics.implementation.StorageInsightConfigsImpl; +import com.azure.resourcemanager.loganalytics.implementation.SummaryLogsOperationsImpl; import com.azure.resourcemanager.loganalytics.implementation.TablesImpl; import com.azure.resourcemanager.loganalytics.implementation.UsagesImpl; import com.azure.resourcemanager.loganalytics.implementation.WorkspacePurgesImpl; @@ -65,6 +67,7 @@ import com.azure.resourcemanager.loganalytics.models.Schemas; import com.azure.resourcemanager.loganalytics.models.SharedKeysOperations; import com.azure.resourcemanager.loganalytics.models.StorageInsightConfigs; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsOperations; import com.azure.resourcemanager.loganalytics.models.Tables; import com.azure.resourcemanager.loganalytics.models.Usages; import com.azure.resourcemanager.loganalytics.models.WorkspacePurges; @@ -73,6 +76,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -81,14 +85,16 @@ * Operational Insights Client. */ public final class LogAnalyticsManager { - private QueryPacks queryPacks; + private AvailableServiceTiers availableServiceTiers; - private Queries queries; + private Clusters clusters; private DataExports dataExports; private DataSources dataSources; + private Gateways gateways; + private IntelligencePacks intelligencePacks; private LinkedServices linkedServices; @@ -97,33 +103,33 @@ public final class LogAnalyticsManager { private ManagementGroups managementGroups; - private OperationStatuses operationStatuses; + private Operations operations; - private SharedKeysOperations sharedKeysOperations; + private OperationStatuses operationStatuses; - private Usages usages; + private Queries queries; - private StorageInsightConfigs storageInsightConfigs; + private QueryPacks queryPacks; private SavedSearches savedSearches; - private AvailableServiceTiers availableServiceTiers; + private Schemas schemas; - private Gateways gateways; + private SharedKeysOperations sharedKeysOperations; - private Schemas schemas; + private StorageInsightConfigs storageInsightConfigs; - private WorkspacePurges workspacePurges; + private Tables tables; - private Clusters clusters; + private Usages usages; - private Operations operations; + private WorkspacePurges workspacePurges; private Workspaces workspaces; private DeletedWorkspaces deletedWorkspaces; - private Tables tables; + private SummaryLogsOperations summaryLogsOperations; private final OperationalInsightsManagementClient clientObject; @@ -177,6 +183,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-loganalytics.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -284,12 +293,14 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.loganalytics") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -336,27 +347,27 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile } /** - * Gets the resource collection API of QueryPacks. It manages LogAnalyticsQueryPack. + * Gets the resource collection API of AvailableServiceTiers. * - * @return Resource collection API of QueryPacks. + * @return Resource collection API of AvailableServiceTiers. */ - public QueryPacks queryPacks() { - if (this.queryPacks == null) { - this.queryPacks = new QueryPacksImpl(clientObject.getQueryPacks(), this); + public AvailableServiceTiers availableServiceTiers() { + if (this.availableServiceTiers == null) { + this.availableServiceTiers = new AvailableServiceTiersImpl(clientObject.getAvailableServiceTiers(), this); } - return queryPacks; + return availableServiceTiers; } /** - * Gets the resource collection API of Queries. It manages LogAnalyticsQueryPackQuery. + * Gets the resource collection API of Clusters. It manages Cluster. * - * @return Resource collection API of Queries. + * @return Resource collection API of Clusters. */ - public Queries queries() { - if (this.queries == null) { - this.queries = new QueriesImpl(clientObject.getQueries(), this); + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); } - return queries; + return clusters; } /** @@ -383,6 +394,18 @@ public DataSources dataSources() { return dataSources; } + /** + * Gets the resource collection API of Gateways. + * + * @return Resource collection API of Gateways. + */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + } + return gateways; + } + /** * Gets the resource collection API of IntelligencePacks. * @@ -432,51 +455,51 @@ public ManagementGroups managementGroups() { } /** - * Gets the resource collection API of OperationStatuses. + * Gets the resource collection API of Operations. * - * @return Resource collection API of OperationStatuses. + * @return Resource collection API of Operations. */ - public OperationStatuses operationStatuses() { - if (this.operationStatuses == null) { - this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return operationStatuses; + return operations; } /** - * Gets the resource collection API of SharedKeysOperations. + * Gets the resource collection API of OperationStatuses. * - * @return Resource collection API of SharedKeysOperations. + * @return Resource collection API of OperationStatuses. */ - public SharedKeysOperations sharedKeysOperations() { - if (this.sharedKeysOperations == null) { - this.sharedKeysOperations = new SharedKeysOperationsImpl(clientObject.getSharedKeysOperations(), this); + public OperationStatuses operationStatuses() { + if (this.operationStatuses == null) { + this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this); } - return sharedKeysOperations; + return operationStatuses; } /** - * Gets the resource collection API of Usages. + * Gets the resource collection API of Queries. It manages LogAnalyticsQueryPackQuery. * - * @return Resource collection API of Usages. + * @return Resource collection API of Queries. */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); + public Queries queries() { + if (this.queries == null) { + this.queries = new QueriesImpl(clientObject.getQueries(), this); } - return usages; + return queries; } /** - * Gets the resource collection API of StorageInsightConfigs. It manages StorageInsight. + * Gets the resource collection API of QueryPacks. It manages LogAnalyticsQueryPack. * - * @return Resource collection API of StorageInsightConfigs. + * @return Resource collection API of QueryPacks. */ - public StorageInsightConfigs storageInsightConfigs() { - if (this.storageInsightConfigs == null) { - this.storageInsightConfigs = new StorageInsightConfigsImpl(clientObject.getStorageInsightConfigs(), this); + public QueryPacks queryPacks() { + if (this.queryPacks == null) { + this.queryPacks = new QueryPacksImpl(clientObject.getQueryPacks(), this); } - return storageInsightConfigs; + return queryPacks; } /** @@ -492,75 +515,75 @@ public SavedSearches savedSearches() { } /** - * Gets the resource collection API of AvailableServiceTiers. + * Gets the resource collection API of Schemas. * - * @return Resource collection API of AvailableServiceTiers. + * @return Resource collection API of Schemas. */ - public AvailableServiceTiers availableServiceTiers() { - if (this.availableServiceTiers == null) { - this.availableServiceTiers = new AvailableServiceTiersImpl(clientObject.getAvailableServiceTiers(), this); + public Schemas schemas() { + if (this.schemas == null) { + this.schemas = new SchemasImpl(clientObject.getSchemas(), this); } - return availableServiceTiers; + return schemas; } /** - * Gets the resource collection API of Gateways. + * Gets the resource collection API of SharedKeysOperations. * - * @return Resource collection API of Gateways. + * @return Resource collection API of SharedKeysOperations. */ - public Gateways gateways() { - if (this.gateways == null) { - this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + public SharedKeysOperations sharedKeysOperations() { + if (this.sharedKeysOperations == null) { + this.sharedKeysOperations = new SharedKeysOperationsImpl(clientObject.getSharedKeysOperations(), this); } - return gateways; + return sharedKeysOperations; } /** - * Gets the resource collection API of Schemas. + * Gets the resource collection API of StorageInsightConfigs. It manages StorageInsight. * - * @return Resource collection API of Schemas. + * @return Resource collection API of StorageInsightConfigs. */ - public Schemas schemas() { - if (this.schemas == null) { - this.schemas = new SchemasImpl(clientObject.getSchemas(), this); + public StorageInsightConfigs storageInsightConfigs() { + if (this.storageInsightConfigs == null) { + this.storageInsightConfigs = new StorageInsightConfigsImpl(clientObject.getStorageInsightConfigs(), this); } - return schemas; + return storageInsightConfigs; } /** - * Gets the resource collection API of WorkspacePurges. + * Gets the resource collection API of Tables. It manages Table. * - * @return Resource collection API of WorkspacePurges. + * @return Resource collection API of Tables. */ - public WorkspacePurges workspacePurges() { - if (this.workspacePurges == null) { - this.workspacePurges = new WorkspacePurgesImpl(clientObject.getWorkspacePurges(), this); + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(clientObject.getTables(), this); } - return workspacePurges; + return tables; } /** - * Gets the resource collection API of Clusters. It manages Cluster. + * Gets the resource collection API of Usages. * - * @return Resource collection API of Clusters. + * @return Resource collection API of Usages. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); } - return clusters; + return usages; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of WorkspacePurges. * - * @return Resource collection API of Operations. + * @return Resource collection API of WorkspacePurges. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public WorkspacePurges workspacePurges() { + if (this.workspacePurges == null) { + this.workspacePurges = new WorkspacePurgesImpl(clientObject.getWorkspacePurges(), this); } - return operations; + return workspacePurges; } /** @@ -588,15 +611,15 @@ public DeletedWorkspaces deletedWorkspaces() { } /** - * Gets the resource collection API of Tables. It manages Table. + * Gets the resource collection API of SummaryLogsOperations. It manages SummaryLogs. * - * @return Resource collection API of Tables. + * @return Resource collection API of SummaryLogsOperations. */ - public Tables tables() { - if (this.tables == null) { - this.tables = new TablesImpl(clientObject.getTables(), this); + public SummaryLogsOperations summaryLogsOperations() { + if (this.summaryLogsOperations == null) { + this.summaryLogsOperations = new SummaryLogsOperationsImpl(clientObject.getSummaryLogsOperations(), this); } - return tables; + return summaryLogsOperations; } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java index 76c429b02fe3..876719a127c7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java @@ -25,6 +25,13 @@ public interface OperationalInsightsManagementClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -40,18 +47,18 @@ public interface OperationalInsightsManagementClient { Duration getDefaultPollInterval(); /** - * Gets the QueryPacksClient object to access its operations. + * Gets the AvailableServiceTiersClient object to access its operations. * - * @return the QueryPacksClient object. + * @return the AvailableServiceTiersClient object. */ - QueryPacksClient getQueryPacks(); + AvailableServiceTiersClient getAvailableServiceTiers(); /** - * Gets the QueriesClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the QueriesClient object. + * @return the ClustersClient object. */ - QueriesClient getQueries(); + ClustersClient getClusters(); /** * Gets the DataExportsClient object to access its operations. @@ -67,6 +74,13 @@ public interface OperationalInsightsManagementClient { */ DataSourcesClient getDataSources(); + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + GatewaysClient getGateways(); + /** * Gets the IntelligencePacksClient object to access its operations. * @@ -96,32 +110,32 @@ public interface OperationalInsightsManagementClient { ManagementGroupsClient getManagementGroups(); /** - * Gets the OperationStatusesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the OperationStatusesClient object. + * @return the OperationsClient object. */ - OperationStatusesClient getOperationStatuses(); + OperationsClient getOperations(); /** - * Gets the SharedKeysOperationsClient object to access its operations. + * Gets the OperationStatusesClient object to access its operations. * - * @return the SharedKeysOperationsClient object. + * @return the OperationStatusesClient object. */ - SharedKeysOperationsClient getSharedKeysOperations(); + OperationStatusesClient getOperationStatuses(); /** - * Gets the UsagesClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the UsagesClient object. + * @return the QueriesClient object. */ - UsagesClient getUsages(); + QueriesClient getQueries(); /** - * Gets the StorageInsightConfigsClient object to access its operations. + * Gets the QueryPacksClient object to access its operations. * - * @return the StorageInsightConfigsClient object. + * @return the QueryPacksClient object. */ - StorageInsightConfigsClient getStorageInsightConfigs(); + QueryPacksClient getQueryPacks(); /** * Gets the SavedSearchesClient object to access its operations. @@ -131,46 +145,46 @@ public interface OperationalInsightsManagementClient { SavedSearchesClient getSavedSearches(); /** - * Gets the AvailableServiceTiersClient object to access its operations. + * Gets the SchemasClient object to access its operations. * - * @return the AvailableServiceTiersClient object. + * @return the SchemasClient object. */ - AvailableServiceTiersClient getAvailableServiceTiers(); + SchemasClient getSchemas(); /** - * Gets the GatewaysClient object to access its operations. + * Gets the SharedKeysOperationsClient object to access its operations. * - * @return the GatewaysClient object. + * @return the SharedKeysOperationsClient object. */ - GatewaysClient getGateways(); + SharedKeysOperationsClient getSharedKeysOperations(); /** - * Gets the SchemasClient object to access its operations. + * Gets the StorageInsightConfigsClient object to access its operations. * - * @return the SchemasClient object. + * @return the StorageInsightConfigsClient object. */ - SchemasClient getSchemas(); + StorageInsightConfigsClient getStorageInsightConfigs(); /** - * Gets the WorkspacePurgesClient object to access its operations. + * Gets the TablesClient object to access its operations. * - * @return the WorkspacePurgesClient object. + * @return the TablesClient object. */ - WorkspacePurgesClient getWorkspacePurges(); + TablesClient getTables(); /** - * Gets the ClustersClient object to access its operations. + * Gets the UsagesClient object to access its operations. * - * @return the ClustersClient object. + * @return the UsagesClient object. */ - ClustersClient getClusters(); + UsagesClient getUsages(); /** - * Gets the OperationsClient object to access its operations. + * Gets the WorkspacePurgesClient object to access its operations. * - * @return the OperationsClient object. + * @return the WorkspacePurgesClient object. */ - OperationsClient getOperations(); + WorkspacePurgesClient getWorkspacePurges(); /** * Gets the WorkspacesClient object to access its operations. @@ -187,9 +201,9 @@ public interface OperationalInsightsManagementClient { DeletedWorkspacesClient getDeletedWorkspaces(); /** - * Gets the TablesClient object to access its operations. + * Gets the SummaryLogsOperationsClient object to access its operations. * - * @return the TablesClient object. + * @return the SummaryLogsOperationsClient object. */ - TablesClient getTables(); + SummaryLogsOperationsClient getSummaryLogsOperations(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/SummaryLogsOperationsClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/SummaryLogsOperationsClient.java new file mode 100644 index 000000000000..e00c3ef2b116 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/SummaryLogsOperationsClient.java @@ -0,0 +1,354 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; + +/** + * An instance of this class provides access to all the operations defined in SummaryLogsOperationsClient. + */ +public interface SummaryLogsOperationsClient { + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 the {@link SyncPoller} for polling of workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 the {@link SyncPoller} for polling of workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters, Context context); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters, Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SummaryLogsInner get(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters, Context context); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java index 9762af2104eb..03ec9dd954ce 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 @@ -11,6 +11,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; @@ -248,4 +249,259 @@ Response updateWithResponse(String resourceGroupName, String wor */ @ServiceMethod(returns = ReturnType.SINGLE) WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailover(String resourceGroupName, String location, String workspaceName, + Context context); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failover(String resourceGroupName, String location, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failback(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNsp(String resourceGroupName, String workspaceName); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNsp(String resourceGroupName, String workspaceName, + Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNspWithResponse(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityPerimeterConfigurationInner getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName, + Context context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java index dca539d1283f..695778d797e5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java @@ -13,10 +13,12 @@ import com.azure.resourcemanager.loganalytics.models.BillingType; import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -279,7 +281,7 @@ public ClusterInner withKeyVaultProperties(KeyVaultProperties keyVaultProperties * * @return the lastModifiedDate value. */ - public String lastModifiedDate() { + public OffsetDateTime lastModifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDate(); } @@ -288,7 +290,7 @@ public String lastModifiedDate() { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -338,6 +340,29 @@ public ClusterInner withCapacityReservationProperties(CapacityReservationPropert return this; } + /** + * Get the replication property: Cluster's replication properties. + * + * @return the replication value. + */ + public ClusterReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: Cluster's replication properties. + * + * @param replication the replication value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withReplication(ClusterReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + /** * Validates the instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java index 4e19d868af64..4e83811ad839 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,8 +14,10 @@ import com.azure.resourcemanager.loganalytics.models.BillingType; import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -58,12 +61,12 @@ public final class ClusterProperties implements JsonSerializable writer.writeJson(element)); jsonWriter.writeJsonField("capacityReservationProperties", this.capacityReservationProperties); + jsonWriter.writeJsonField("replication", this.replication); return jsonWriter.writeEndObject(); } @@ -308,9 +340,11 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti } else if ("keyVaultProperties".equals(fieldName)) { deserializedClusterProperties.keyVaultProperties = KeyVaultProperties.fromJson(reader); } else if ("lastModifiedDate".equals(fieldName)) { - deserializedClusterProperties.lastModifiedDate = reader.getString(); + deserializedClusterProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("createdDate".equals(fieldName)) { - deserializedClusterProperties.createdDate = reader.getString(); + deserializedClusterProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("associatedWorkspaces".equals(fieldName)) { List associatedWorkspaces = reader.readArray(reader1 -> AssociatedWorkspace.fromJson(reader1)); @@ -318,6 +352,8 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti } else if ("capacityReservationProperties".equals(fieldName)) { deserializedClusterProperties.capacityReservationProperties = CapacityReservationProperties.fromJson(reader); + } else if ("replication".equals(fieldName)) { + deserializedClusterProperties.replication = ClusterReplicationProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java index e5fc73ff7755..855631fc4208 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loganalytics.models.QueryPacksResource; import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -18,12 +19,17 @@ * An Log Analytics QueryPack definition. */ @Fluent -public final class LogAnalyticsQueryPackInner extends QueryPacksResource { +public final class LogAnalyticsQueryPackInner extends Resource { /* * Properties that define a Log Analytics QueryPack resource. */ private LogAnalyticsQueryPackProperties innerProperties = new LogAnalyticsQueryPackProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -54,6 +60,15 @@ private LogAnalyticsQueryPackProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -145,7 +160,6 @@ public String provisioningState() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() == null) { throw LOGGER.atError() @@ -200,6 +214,8 @@ public static LogAnalyticsQueryPackInner fromJson(JsonReader jsonReader) throws } else if ("properties".equals(fieldName)) { deserializedLogAnalyticsQueryPackInner.innerProperties = LogAnalyticsQueryPackProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogAnalyticsQueryPackInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java index 2d3af3ceef01..baf421ce5d1b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java @@ -5,11 +5,11 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loganalytics.models.AzureResourceProperties; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,29 +20,29 @@ * A Log Analytics QueryPack-Query definition. */ @Fluent -public final class LogAnalyticsQueryPackQueryInner extends AzureResourceProperties { +public final class LogAnalyticsQueryPackQueryInner extends ProxyResource { /* * Properties that define an Log Analytics QueryPack-Query resource. */ private LogAnalyticsQueryPackQueryProperties innerProperties; /* - * Read only system data + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; /* - * Azure resource type + * The type of the resource. */ private String type; /* - * Azure resource name + * The name of the resource. */ private String name; /* - * Azure resource Id + * Fully qualified resource Id for the resource. */ private String id; @@ -62,17 +62,16 @@ private LogAnalyticsQueryPackQueryProperties innerProperties() { } /** - * Get the systemData property: Read only system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ - @Override public SystemData systemData() { return this.systemData; } /** - * Get the type property: Azure resource type. + * Get the type property: The type of the resource. * * @return the type value. */ @@ -82,7 +81,7 @@ public String type() { } /** - * Get the name property: Azure resource name. + * Get the name property: The name of the resource. * * @return the name value. */ @@ -92,7 +91,7 @@ public String name() { } /** - * Get the id property: Azure resource Id. + * Get the id property: Fully qualified resource Id for the resource. * * @return the id value. */ @@ -280,7 +279,6 @@ public LogAnalyticsQueryPackQueryInner withProperties(Object properties) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -303,6 +301,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of LogAnalyticsQueryPackQueryInner if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the LogAnalyticsQueryPackQueryInner. */ public static LogAnalyticsQueryPackQueryInner fromJson(JsonReader jsonReader) throws IOException { @@ -319,11 +318,11 @@ public static LogAnalyticsQueryPackQueryInner fromJson(JsonReader jsonReader) th deserializedLogAnalyticsQueryPackQueryInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedLogAnalyticsQueryPackQueryInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedLogAnalyticsQueryPackQueryInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedLogAnalyticsQueryPackQueryInner.innerProperties = LogAnalyticsQueryPackQueryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogAnalyticsQueryPackQueryInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java index ef7f75297643..81de1a33625d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java @@ -270,7 +270,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("related", this.related); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - jsonWriter.writeUntypedField("properties", this.properties); + if (this.properties != null) { + jsonWriter.writeUntypedField("properties", this.properties); + } return jsonWriter.writeEndObject(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/NetworkSecurityPerimeterConfigurationInner.java new file mode 100644 index 000000000000..737dec497890 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/NetworkSecurityPerimeterConfigurationInner.java @@ -0,0 +1,169 @@ +// 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import java.io.IOException; + +/** + * Network security perimeter (NSP) configuration resource. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResource { + /* + * Network security configuration properties. + */ + private NetworkSecurityPerimeterConfigurationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationInner class. + */ + public NetworkSecurityPerimeterConfigurationInner() { + } + + /** + * Get the properties property: Network security configuration properties. + * + * @return the properties value. + */ + public NetworkSecurityPerimeterConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Network security configuration properties. + * + * @param properties the properties value to set. + * @return the NetworkSecurityPerimeterConfigurationInner object itself. + */ + public NetworkSecurityPerimeterConfigurationInner + withProperties(NetworkSecurityPerimeterConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeterConfigurationInner. + */ + public static NetworkSecurityPerimeterConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationInner deserializedNetworkSecurityPerimeterConfigurationInner + = new NetworkSecurityPerimeterConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.properties + = NetworkSecurityPerimeterConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationInner; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsInner.java new file mode 100644 index 000000000000..dac9c5b8294c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsInner.java @@ -0,0 +1,279 @@ +// 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import com.azure.resourcemanager.loganalytics.models.StatusCodeEnum; +import java.io.IOException; + +/** + * Workspace data summary rules definition. + */ +@Fluent +public final class SummaryLogsInner extends ProxyResource { + /* + * Summary rule properties. + */ + private SummaryLogsProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SummaryLogsInner class. + */ + public SummaryLogsInner() { + } + + /** + * Get the innerProperties property: Summary rule properties. + * + * @return the innerProperties value. + */ + private SummaryLogsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the ruleType property: SummaryRules rule type: User. + * + * @return the ruleType value. + */ + public RuleTypeEnum ruleType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleType(); + } + + /** + * Set the ruleType property: SummaryRules rule type: User. + * + * @param ruleType the ruleType value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withRuleType(RuleTypeEnum ruleType) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withRuleType(ruleType); + return this; + } + + /** + * Get the displayName property: The display name of the Summary rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the Summary rule. + * + * @param displayName the displayName value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: The description of the Summary rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the Summary rule. + * + * @param description the description value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the isActive property: Indicates if Summary rule is active. If not, Summary rule execution stops. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.innerProperties() == null ? null : this.innerProperties().isActive(); + } + + /** + * Get the statusCode property: Indicates the reason for rule deactivation. + * + * @return the statusCode value. + */ + public StatusCodeEnum statusCode() { + return this.innerProperties() == null ? null : this.innerProperties().statusCode(); + } + + /** + * Get the provisioningState property: Summary rule is in provisioning state. If set to 'updating' or 'deleting', + * indicates a resource lock due to an ongoing operation, preventing any update to the Summary rule until the + * operation is complete. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ruleDefinition property: Rule definition parameters. + * + * @return the ruleDefinition value. + */ + public RuleDefinition ruleDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().ruleDefinition(); + } + + /** + * Set the ruleDefinition property: Rule definition parameters. + * + * @param ruleDefinition the ruleDefinition value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withRuleDefinition(RuleDefinition ruleDefinition) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withRuleDefinition(ruleDefinition); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SummaryLogsInner. + */ + public static SummaryLogsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsInner deserializedSummaryLogsInner = new SummaryLogsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSummaryLogsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSummaryLogsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSummaryLogsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSummaryLogsInner.innerProperties = SummaryLogsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSummaryLogsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsInner; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsProperties.java new file mode 100644 index 000000000000..0f151e746cdb --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsProperties.java @@ -0,0 +1,236 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import com.azure.resourcemanager.loganalytics.models.StatusCodeEnum; +import java.io.IOException; + +/** + * Summary rule properties. + */ +@Fluent +public final class SummaryLogsProperties implements JsonSerializable { + /* + * SummaryRules rule type: User. + */ + private RuleTypeEnum ruleType; + + /* + * The display name of the Summary rule. + */ + private String displayName; + + /* + * The description of the Summary rule. + */ + private String description; + + /* + * Indicates if Summary rule is active. If not, Summary rule execution stops. + */ + private Boolean isActive; + + /* + * Indicates the reason for rule deactivation. + */ + private StatusCodeEnum statusCode; + + /* + * Summary rule is in provisioning state. If set to 'updating' or 'deleting', indicates a resource lock due to an + * ongoing operation, preventing any update to the Summary rule until the operation is complete. + */ + private ProvisioningStateEnum provisioningState; + + /* + * Rule definition parameters. + */ + private RuleDefinition ruleDefinition; + + /** + * Creates an instance of SummaryLogsProperties class. + */ + public SummaryLogsProperties() { + } + + /** + * Get the ruleType property: SummaryRules rule type: User. + * + * @return the ruleType value. + */ + public RuleTypeEnum ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: SummaryRules rule type: User. + * + * @param ruleType the ruleType value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withRuleType(RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the displayName property: The display name of the Summary rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the Summary rule. + * + * @param displayName the displayName value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description of the Summary rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the Summary rule. + * + * @param description the description value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the isActive property: Indicates if Summary rule is active. If not, Summary rule execution stops. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Get the statusCode property: Indicates the reason for rule deactivation. + * + * @return the statusCode value. + */ + public StatusCodeEnum statusCode() { + return this.statusCode; + } + + /** + * Get the provisioningState property: Summary rule is in provisioning state. If set to 'updating' or 'deleting', + * indicates a resource lock due to an ongoing operation, preventing any update to the Summary rule until the + * operation is complete. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the ruleDefinition property: Rule definition parameters. + * + * @return the ruleDefinition value. + */ + public RuleDefinition ruleDefinition() { + return this.ruleDefinition; + } + + /** + * Set the ruleDefinition property: Rule definition parameters. + * + * @param ruleDefinition the ruleDefinition value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withRuleDefinition(RuleDefinition ruleDefinition) { + this.ruleDefinition = ruleDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleDefinition() != null) { + ruleDefinition().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("ruleDefinition", this.ruleDefinition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SummaryLogsProperties. + */ + public static SummaryLogsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsProperties deserializedSummaryLogsProperties = new SummaryLogsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleType".equals(fieldName)) { + deserializedSummaryLogsProperties.ruleType = RuleTypeEnum.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedSummaryLogsProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedSummaryLogsProperties.description = reader.getString(); + } else if ("isActive".equals(fieldName)) { + deserializedSummaryLogsProperties.isActive = reader.getNullable(JsonReader::getBoolean); + } else if ("statusCode".equals(fieldName)) { + deserializedSummaryLogsProperties.statusCode = StatusCodeEnum.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedSummaryLogsProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("ruleDefinition".equals(fieldName)) { + deserializedSummaryLogsProperties.ruleDefinition = RuleDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java index 4923dec7fdff..f9163289ea32 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -14,7 +15,6 @@ import com.azure.resourcemanager.loganalytics.models.ResultStatistics; import com.azure.resourcemanager.loganalytics.models.Schema; import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; import java.io.IOException; @@ -31,7 +31,7 @@ public final class TableInner extends ProxyResource { /* * Metadata pertaining to creation and last modification of the resource. */ - private SystemDataAutoGenerated systemData; + private SystemData systemData; /* * The type of the resource. @@ -68,7 +68,7 @@ private TableProperties innerProperties() { * * @return the systemData value. */ - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.systemData; } @@ -103,8 +103,9 @@ public String id() { } /** - * Get the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Get the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @return the retentionInDays value. */ @@ -113,8 +114,9 @@ public Integer retentionInDays() { } /** - * Set the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Set the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @param retentionInDays the retentionInDays value to set. * @return the TableInner object itself. @@ -129,7 +131,7 @@ public TableInner withRetentionInDays(Integer retentionInDays) { /** * Get the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @return the totalRetentionInDays value. */ @@ -139,7 +141,7 @@ public Integer totalRetentionInDays() { /** * Set the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @param totalRetentionInDays the totalRetentionInDays value to set. * @return the TableInner object itself. @@ -153,7 +155,7 @@ public TableInner withTotalRetentionInDays(Integer totalRetentionInDays) { } /** - * Get the archiveRetentionInDays property: The table data archive retention in days. Calculated as + * Get the archiveRetentionInDays property: The tables long-term retention in days. Calculated as * (totalRetentionInDays-retentionInDays). * * @return the archiveRetentionInDays value. @@ -312,9 +314,6 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } - if (systemData() != null) { - systemData().validate(); - } } /** @@ -352,7 +351,7 @@ public static TableInner fromJson(JsonReader jsonReader) throws IOException { } else if ("properties".equals(fieldName)) { deserializedTableInner.innerProperties = TableProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedTableInner.systemData = SystemDataAutoGenerated.fromJson(reader); + deserializedTableInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java index 224a110120ed..f3c825511b70 100644 --- 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 @@ -23,19 +23,19 @@ @Fluent public final class TableProperties implements JsonSerializable { /* - * The table retention in days, between 4 and 730. Setting this property to -1 will default to the workspace - * retention. + * In Analytics table: the tables analytics retention in days, between 4 and 730. Setting this property to -1 will + * default to the workspace retention. In Basic and Auxiliary table: read only property. */ private Integer retentionInDays; /* - * The table total retention in days, between 4 and 4383. Setting this property to -1 will default to table - * retention. + * The table total retention in days, between 4 and 4383. Setting this property to -1 will default to + * retentionInDays. */ private Integer totalRetentionInDays; /* - * The table data archive retention in days. Calculated as (totalRetentionInDays-retentionInDays) + * The tables long-term retention in days. Calculated as (totalRetentionInDays-retentionInDays). */ private Integer archiveRetentionInDays; @@ -92,8 +92,9 @@ public TableProperties() { } /** - * Get the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Get the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @return the retentionInDays value. */ @@ -102,8 +103,9 @@ public Integer retentionInDays() { } /** - * Set the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Set the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @param retentionInDays the retentionInDays value to set. * @return the TableProperties object itself. @@ -115,7 +117,7 @@ public TableProperties withRetentionInDays(Integer retentionInDays) { /** * Get the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @return the totalRetentionInDays value. */ @@ -125,7 +127,7 @@ public Integer totalRetentionInDays() { /** * Set the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @param totalRetentionInDays the totalRetentionInDays value to set. * @return the TableProperties object itself. @@ -136,7 +138,7 @@ public TableProperties withTotalRetentionInDays(Integer totalRetentionInDays) { } /** - * Get the archiveRetentionInDays property: The table data archive retention in days. Calculated as + * Get the archiveRetentionInDays property: The tables long-term retention in days. Calculated as * (totalRetentionInDays-retentionInDays). * * @return the archiveRetentionInDays value. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java index 629b221fc494..65c697daf679 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java @@ -6,18 +6,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -39,7 +42,7 @@ public final class WorkspaceInner extends Resource { /* * Metadata pertaining to creation and last modification of the resource. */ - private SystemDataAutoGenerated systemData; + private SystemData systemData; /* * The etag of the workspace. @@ -101,7 +104,7 @@ public WorkspaceInner withIdentity(Identity identity) { * * @return the systemData value. */ - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.systemData; } @@ -267,7 +270,7 @@ public WorkspaceInner withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -276,7 +279,7 @@ public String createdDate() { * * @return the modifiedDate value. */ - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } @@ -408,6 +411,52 @@ public WorkspaceInner withDefaultDataCollectionRuleResourceId(String defaultData return this; } + /** + * Get the replication property: workspace replication properties. + * + * @return the replication value. + */ + public WorkspaceReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: workspace replication properties. + * + * @param replication the replication value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withReplication(WorkspaceReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + + /** + * Get the failover property: workspace failover properties. + * + * @return the failover value. + */ + public WorkspaceFailoverProperties failover() { + return this.innerProperties() == null ? null : this.innerProperties().failover(); + } + + /** + * Set the failover property: workspace failover properties. + * + * @param failover the failover value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withFailover(WorkspaceFailoverProperties failover) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFailover(failover); + return this; + } + /** * Validates the instance. * @@ -420,9 +469,6 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (systemData() != null) { - systemData().validate(); - } } /** @@ -471,7 +517,7 @@ public static WorkspaceInner fromJson(JsonReader jsonReader) throws IOException } else if ("identity".equals(fieldName)) { deserializedWorkspaceInner.identity = Identity.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedWorkspaceInner.systemData = SystemDataAutoGenerated.fromJson(reader); + deserializedWorkspaceInner.systemData = SystemData.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedWorkspaceInner.etag = reader.getString(); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java index 53c89225a8c1..a951ec0ccf06 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,9 +14,12 @@ import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -52,12 +56,12 @@ public final class WorkspaceProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("modifiedDate".equals(fieldName)) { - deserializedWorkspaceProperties.modifiedDate = reader.getString(); + deserializedWorkspaceProperties.modifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("publicNetworkAccessForIngestion".equals(fieldName)) { deserializedWorkspaceProperties.publicNetworkAccessForIngestion = PublicNetworkAccessType.fromString(reader.getString()); @@ -394,6 +458,10 @@ public static WorkspaceProperties fromJson(JsonReader jsonReader) throws IOExcep deserializedWorkspaceProperties.features = WorkspaceFeatures.fromJson(reader); } else if ("defaultDataCollectionRuleResourceId".equals(fieldName)) { deserializedWorkspaceProperties.defaultDataCollectionRuleResourceId = reader.getString(); + } else if ("replication".equals(fieldName)) { + deserializedWorkspaceProperties.replication = WorkspaceReplicationProperties.fromJson(reader); + } else if ("failover".equals(fieldName)) { + deserializedWorkspaceProperties.failover = WorkspaceFailoverProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java index bf7d14fc433d..79cc76334190 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 @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.AvailableServiceTiersClient; import com.azure.resourcemanager.loganalytics.fluent.models.AvailableServiceTierInner; import java.util.List; @@ -56,7 +57,7 @@ public final class AvailableServiceTiersClientImpl implements AvailableServiceTi * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientAvailableServiceTiers") public interface AvailableServiceTiersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers") @@ -66,6 +67,15 @@ Mono>> listByWorkspace(@HostParam("$hos @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response> listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** @@ -97,51 +107,13 @@ private Mono>> listByWorkspaceWithRespo if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the available service tiers for the workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available service tiers for the workspace along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listByWorkspaceWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context); - } - /** * Gets the available service tiers for the workspace. * @@ -172,7 +144,27 @@ private Mono> listByWorkspaceAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) public Response> listByWorkspaceWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context); } /** @@ -189,4 +181,6 @@ public Response> listByWorkspaceWithResponse(Str public List listByWorkspace(String resourceGroupName, String workspaceName) { return listByWorkspaceWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(AvailableServiceTiersClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java index d8419d40e0e5..39cc9a799e6f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java @@ -13,9 +13,11 @@ import com.azure.resourcemanager.loganalytics.models.Cluster; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; import com.azure.resourcemanager.loganalytics.models.ClusterPatch; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -82,11 +84,11 @@ public KeyVaultProperties keyVaultProperties() { return this.innerModel().keyVaultProperties(); } - public String lastModifiedDate() { + public OffsetDateTime lastModifiedDate() { return this.innerModel().lastModifiedDate(); } - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerModel().createdDate(); } @@ -103,6 +105,10 @@ public CapacityReservationProperties capacityReservationProperties() { return this.innerModel().capacityReservationProperties(); } + public ClusterReplicationProperties replication() { + return this.innerModel().replication(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -276,7 +282,12 @@ public ClusterImpl withCapacityReservationProperties(CapacityReservationProperti return this; } + public ClusterImpl withReplication(ClusterReplicationProperties replication) { + this.innerModel().withReplication(replication); + return this; + } + private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || 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 019b3c86f818..bd4e395d2728 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 @@ -28,8 +28,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.ClustersClient; @@ -69,7 +71,7 @@ public final class ClustersClientImpl implements ClustersClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientClusters") public interface ClustersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters") @@ -79,6 +81,14 @@ Mono> listByResourceGroup(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters") @ExpectedResponses({ 200 }) @@ -87,9 +97,17 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") - @ExpectedResponses({ 200, 201, 202 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -97,6 +115,16 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") ClusterInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") @ExpectedResponses({ 200, 202, 204 }) @@ -106,6 +134,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") @ExpectedResponses({ 200 }) @@ -116,15 +153,34 @@ Mono> getByResourceGroup(@HostParam("$host") String endpo @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ClusterPatch parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ClusterPatch parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -133,12 +189,27 @@ Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -165,11 +236,10 @@ private Mono> listByResourceGroupSinglePageAsync(Str return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -179,36 +249,15 @@ private Mono> listByResourceGroupSinglePageAsync(Str * Gets Log Analytics clusters in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return log Analytics clusters in a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return log Analytics clusters in a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -218,12 +267,29 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @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 log Analytics clusters in a resource group as paginated response with {@link PagedFlux}. + * @return log Analytics clusters in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -234,12 +300,29 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @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 log Analytics clusters in a resource group as paginated response with {@link PagedFlux}. + * @return log Analytics clusters in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -253,7 +336,8 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -268,7 +352,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName) */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -289,11 +374,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -302,29 +386,13 @@ private Mono> listSinglePageAsync() { /** * Gets the Log Analytics clusters in a subscription. * - * @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 Log Analytics clusters in a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Log Analytics clusters in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -332,11 +400,25 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Analytics clusters in a subscription as paginated response with {@link PagedFlux}. + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -346,12 +428,25 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Log Analytics clusters in a subscription as paginated response with {@link PagedFlux}. + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -363,7 +458,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -377,7 +472,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -415,11 +510,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), clusterName, parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), clusterName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -429,41 +523,41 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Log Analytics cluster. * @param parameters The parameters required to create or update 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 along with {@link Response} on successful - * completion of {@link Mono}. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, ClusterInner parameters, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + ClusterInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), clusterName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), clusterName, parameters, accept, Context.NONE); } /** @@ -472,18 +566,42 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Log Analytics cluster. * @param parameters The parameters required to create or update 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 {@link PollerFlux} for polling of the top level Log Analytics cluster resource container. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String clusterName, ClusterInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + ClusterInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), clusterName, parameters, accept, context); } /** @@ -492,7 +610,6 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Log Analytics cluster. * @param parameters The parameters required to create or update 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. @@ -500,12 +617,11 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String clusterName, ClusterInner parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, ClusterInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -522,7 +638,9 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -540,7 +658,9 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -561,25 +681,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, String .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create or update a Log Analytics cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Log Analytics cluster. - * @param parameters The parameters required to create or update 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, - ClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create or update a Log Analytics cluster. * @@ -593,7 +694,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -611,7 +712,7 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -641,11 +742,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -654,35 +754,34 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the 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 {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { + private Response deleteWithResponse(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); } /** @@ -690,16 +789,35 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the 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 {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @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, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -707,19 +825,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the 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 {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + 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); + this.client.getContext()); } /** @@ -734,7 +849,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -751,7 +867,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -769,23 +886,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a cluster instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Name of the 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a cluster instance. * @@ -797,7 +897,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + beginDelete(resourceGroupName, clusterName).getFinalResult(); } /** @@ -812,7 +912,7 @@ public void delete(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, context).block(); + beginDelete(resourceGroupName, clusterName, context).getFinalResult(); } /** @@ -843,50 +943,14 @@ private Mono> getByResourceGroupWithResponseAsync(String if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, apiVersion, clusterName, accept, context)) + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a Log Analytics cluster instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Name of the 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 a Log Analytics cluster instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName, 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - apiVersion, clusterName, accept, context); - } - /** * Gets a Log Analytics cluster instance. * @@ -917,7 +981,27 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterName, accept, context); } /** @@ -970,11 +1054,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, clusterName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -984,41 +1067,41 @@ private Mono>> updateWithResponseAsync(String resource * @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 along with {@link Response} on successful - * completion of {@link Mono}. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterPatch parameters, Context context) { + private Response updateWithResponse(String resourceGroupName, String clusterName, + ClusterPatch parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, clusterName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); } /** @@ -1027,17 +1110,42 @@ private Mono>> updateWithResponseAsync(String resource * @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 {@link PollerFlux} for polling of the top level Log Analytics cluster resource container. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ - @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()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + ClusterPatch parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -1046,7 +1154,6 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri * @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. @@ -1054,12 +1161,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri */ @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); + String clusterName, ClusterPatch parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -1076,7 +1181,9 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String clusterName, ClusterPatch parameters) { - return this.beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -1094,7 +1201,9 @@ public SyncPoller, ClusterInner> beginUpdate(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -1114,25 +1223,6 @@ private Mono updateAsync(String resourceGroupName, String clusterN .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 on successful completion of {@link Mono}. - */ - @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); - } - /** * Updates a Log Analytics cluster. * @@ -1146,7 +1236,7 @@ private Mono updateAsync(String resourceGroupName, String clusterN */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch parameters) { - return updateAsync(resourceGroupName, clusterName, parameters).block(); + return beginUpdate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -1163,7 +1253,7 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { - return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + return beginUpdate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -1173,7 +1263,7 @@ public ClusterInner update(String resourceGroupName, String clusterName, 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 list clusters operation response along with {@link PagedResponse} on successful completion of + * @return log Analytics clusters in a resource group along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1194,6 +1284,33 @@ private Mono> listByResourceGroupNextSinglePageAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 log Analytics clusters in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1202,23 +1319,24 @@ private Mono> listByResourceGroupNextSinglePageAsync * @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 list clusters operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return log Analytics clusters in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1228,7 +1346,7 @@ private Mono> listByResourceGroupNextSinglePageAsync * @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 list clusters operation response along with {@link PagedResponse} on successful completion of + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1247,6 +1365,33 @@ private Mono> listNextSinglePageAsync(String nextLin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Log Analytics clusters in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1255,22 +1400,24 @@ private Mono> listNextSinglePageAsync(String nextLin * @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 list clusters operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ClustersClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java index cc3f35ee6341..30251c939268 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 @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.DataExportsClient; import com.azure.resourcemanager.loganalytics.fluent.models.DataExportInner; import com.azure.resourcemanager.loganalytics.models.DataExportListResult; @@ -63,7 +64,7 @@ public final class DataExportsClientImpl implements DataExportsClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientDataExports") public interface DataExportsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports") @@ -74,6 +75,15 @@ Mono> listByWorkspace(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") @ExpectedResponses({ 200, 201 }) @@ -85,6 +95,17 @@ Mono> createOrUpdate(@HostParam("$host") String endpoi @BodyParam("application/json") DataExportInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataExportInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") @ExpectedResponses({ 200 }) @@ -95,6 +116,16 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") @ExpectedResponses({ 200, 404 }) @@ -104,6 +135,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + @ExpectedResponses({ 200, 404 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } /** @@ -135,11 +176,10 @@ private Mono> listByWorkspaceSinglePageAsync(Stri if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -150,39 +190,14 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list data exports along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return result of the request to list data exports as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -193,11 +208,34 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list data exports as paginated response with {@link PagedFlux}. + * @return result of the request to list data exports along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -209,12 +247,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list data exports as paginated response with {@link PagedFlux}. + * @return result of the request to list data exports along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -229,7 +290,7 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -246,7 +307,7 @@ public PagedIterable listByWorkspace(String resourceGroupName, @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } /** @@ -288,61 +349,14 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, parameters, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or update a data export. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataExportName The data export rule name. - * @param parameters The parameters required to create or update a data export. - * @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 data export resource container along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String dataExportName, DataExportInner 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 (dataExportName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataExportName 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 = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, dataExportName, apiVersion, parameters, accept, context); - } - /** * Create or update a data export. * @@ -378,8 +392,37 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String dataExportName, DataExportInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataExportName, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataExportName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataExportName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -433,54 +476,13 @@ private Mono> getWithResponseAsync(String resourceGrou if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a data export instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataExportName The data export rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data export instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String dataExportName, 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 (dataExportName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - dataExportName, apiVersion, accept, context); - } - /** * Gets a data export instance. * @@ -513,7 +515,31 @@ private Mono getAsync(String resourceGroupName, String workspac @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String dataExportName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataExportName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataExportName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataExportName, this.client.getApiVersion(), accept, context); } /** @@ -564,54 +590,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes the specified data export in a given workspace.. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataExportName The data export rule name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String dataExportName, 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 (dataExportName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, dataExportName, apiVersion, accept, context); - } - /** * Deletes the specified data export in a given workspace.. * @@ -644,7 +629,31 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataExportName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataExportName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataExportName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataExportName, this.client.getApiVersion(), accept, context); } /** @@ -661,4 +670,6 @@ public Response deleteWithResponse(String resourceGroupName, String worksp public void delete(String resourceGroupName, String workspaceName, String dataExportName) { deleteWithResponse(resourceGroupName, workspaceName, dataExportName, Context.NONE); } + + private static final ClientLogger LOGGER = new ClientLogger(DataExportsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java index 79fcd6463169..f1f8487cacb5 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 @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.DataSourcesClient; import com.azure.resourcemanager.loganalytics.fluent.models.DataSourceInner; import com.azure.resourcemanager.loganalytics.models.DataSourceListResult; @@ -63,7 +64,7 @@ public final class DataSourcesClientImpl implements DataSourcesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientDataSources") public interface DataSourcesService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") @@ -76,6 +77,17 @@ Mono> createOrUpdate(@HostParam("$host") String endpoi @BodyParam("application/json") DataSourceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DataSourceInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") @ExpectedResponses({ 200, 204 }) @@ -85,6 +97,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") @ExpectedResponses({ 200 }) @@ -94,6 +115,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources") @ExpectedResponses({ 200 }) @@ -104,6 +134,16 @@ Mono> listByWorkspace(@HostParam("$host") String @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$skiptoken") String skiptoken, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -111,6 +151,14 @@ Mono> listByWorkspace(@HostParam("$host") String Mono> listByWorkspaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -151,60 +199,14 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or update a data source. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceName The name of the datasource resource. - * @param parameters The parameters required to create or update a datasource. - * @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 datasources under OMS Workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String dataSourceName, DataSourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context); - } - /** * Create or update a data source. * @@ -240,8 +242,37 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String dataSourceName, DataSourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataSourceName, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -295,52 +326,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a data source instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceName Name of the datasource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String dataSourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, apiVersion, - this.client.getSubscriptionId(), context); - } - /** * Deletes a data source instance. * @@ -373,7 +364,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataSourceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataSourceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -423,54 +437,13 @@ private Mono> getWithResponseAsync(String resourceGrou return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a datasource instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceName Name of the datasource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a datasource instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String dataSourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a datasource instance. * @@ -503,7 +476,31 @@ private Mono getAsync(String resourceGroupName, String workspac @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String dataSourceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataSourceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -556,11 +553,10 @@ private Mono> listByWorkspaceSinglePageAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - filter, skiptoken, apiVersion, this.client.getSubscriptionId(), accept, context)) + filter, skiptoken, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -573,42 +569,18 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * @param workspaceName The name of the workspace. * @param filter The filter to apply on the operation. * @param skiptoken Starting point of the collection of data source instances. - * @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 first page of data source instances in a workspace with the link to the next page along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the first page of data source instances in a workspace with the link to the next page as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, String filter, String skiptoken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, skiptoken, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + String filter, String skiptoken) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** @@ -617,7 +589,6 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter The filter to apply on the operation. - * @param skiptoken Starting point of the collection of data source instances. * @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. @@ -626,7 +597,8 @@ private Mono> listByWorkspaceSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, - String filter, String skiptoken) { + String filter) { + final String skiptoken = null; return new PagedFlux<>( () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); @@ -638,19 +610,44 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter The filter to apply on the operation. + * @param skiptoken Starting point of the collection of data source instances. * @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 first page of data source instances in a workspace with the link to the next page as paginated - * response with {@link PagedFlux}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, - String filter) { - final String skiptoken = null; - return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, + String filter, String skiptoken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (filter == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, + skiptoken, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -664,15 +661,40 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName * @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 first page of data source instances in a workspace with the link to the next page as paginated - * response with {@link PagedFlux}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, String filter, String skiptoken, Context context) { - return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken, context), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (filter == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, + skiptoken, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -691,7 +713,8 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, String filter) { final String skiptoken = null; - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, filter, skiptoken)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, filter, skiptoken), + nextLink -> listByWorkspaceNextSinglePage(nextLink)); } /** @@ -711,7 +734,9 @@ public PagedIterable listByWorkspace(String resourceGroupName, @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, String filter, String skiptoken, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, filter, skiptoken, context)); + return new PagedIterable<>( + () -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, filter, skiptoken, context), + nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); } /** @@ -721,8 +746,8 @@ public PagedIterable listByWorkspace(String resourceGroupName, * @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 list data source by workspace operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { @@ -741,6 +766,34 @@ private Mono> listByWorkspaceNextSinglePageAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -749,22 +802,26 @@ private Mono> listByWorkspaceNextSinglePageAsync( * @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 list data source by workspace operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(DataSourcesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java index 69fc3b58644c..41aa645c5021 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 @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.DeletedWorkspacesClient; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; import com.azure.resourcemanager.loganalytics.models.WorkspaceListResult; @@ -60,7 +61,7 @@ public final class DeletedWorkspacesClientImpl implements DeletedWorkspacesClien * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientDeletedWorkspaces") public interface DeletedWorkspacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces") @@ -70,6 +71,14 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces") @ExpectedResponses({ 200 }) @@ -77,6 +86,14 @@ Mono> list(@HostParam("$host") String endpoint, Mono> listByResourceGroup(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); } /** @@ -97,11 +114,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -110,29 +126,14 @@ private Mono> listSinglePageAsync() { /** * Gets recently deleted workspaces in a subscription, available for recovery. * - * @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 recently deleted workspaces in a subscription, available for recovery along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return recently deleted workspaces in a subscription, available for recovery as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); } /** @@ -140,12 +141,25 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return recently deleted workspaces in a subscription, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a subscription, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -155,12 +169,25 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return recently deleted workspaces in a subscription, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a subscription, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -173,7 +200,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage()); } /** @@ -188,7 +215,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context)); } /** @@ -215,11 +242,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -229,36 +255,15 @@ private Mono> listByResourceGroupSinglePageAsync(S * Gets recently deleted workspaces in a resource group, available for recovery. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return recently deleted workspaces in a resource group, available for recovery along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return recently deleted workspaces in a resource group, available for recovery as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); } /** @@ -268,12 +273,29 @@ private Mono> listByResourceGroupSinglePageAsync(S * @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 recently deleted workspaces in a resource group, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a resource group, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -284,12 +306,29 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * @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 recently deleted workspaces in a resource group, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a resource group, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -304,7 +343,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName)); } /** @@ -320,6 +359,8 @@ public PagedIterable listByResourceGroup(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(DeletedWorkspacesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java index cc9b1d782cc7..def0f096476d 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 @@ -20,6 +20,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.GatewaysClient; import reactor.core.publisher.Mono; @@ -52,7 +53,7 @@ public final class GatewaysClientImpl implements GatewaysClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientGateways") public interface GatewaysService { @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}") @@ -62,6 +63,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("gatewayId") String gatewayId, @QueryParam("api-version") String apiVersion, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("gatewayId") String gatewayId, @QueryParam("api-version") String apiVersion, Context context); } /** @@ -96,52 +106,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (gatewayId == null) { return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, gatewayId, apiVersion, context)) + resourceGroupName, workspaceName, gatewayId, this.client.getApiVersion(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Delete a Log Analytics gateway. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param gatewayId The Log Analytics gateway Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String gatewayId, 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 (gatewayId == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, gatewayId, apiVersion, context); - } - /** * Delete a Log Analytics gateway. * @@ -173,7 +143,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String gatewayId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, gatewayId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (gatewayId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, gatewayId, this.client.getApiVersion(), context); } /** @@ -190,4 +183,6 @@ public Response deleteWithResponse(String resourceGroupName, String worksp public void delete(String resourceGroupName, String workspaceName, String gatewayId) { deleteWithResponse(resourceGroupName, workspaceName, gatewayId, Context.NONE); } + + private static final ClientLogger LOGGER = new ClientLogger(GatewaysClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java index adf553c5c7b2..34dd79cae562 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 @@ -22,6 +22,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.IntelligencePacksClient; import com.azure.resourcemanager.loganalytics.fluent.models.IntelligencePackInner; import java.util.List; @@ -57,7 +58,7 @@ public final class IntelligencePacksClientImpl implements IntelligencePacksClien * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientIntelligencePacks") public interface IntelligencePacksService { @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable") @@ -69,6 +70,16 @@ Mono> disable(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("intelligencePackName") String intelligencePackName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable") @ExpectedResponses({ 200 }) @@ -79,6 +90,16 @@ Mono> enable(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("intelligencePackName") String intelligencePackName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks") @ExpectedResponses({ 200 }) @@ -87,6 +108,15 @@ Mono>> list(@HostParam("$host") String endp @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response> listSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -122,53 +152,12 @@ private Mono> disableWithResponseAsync(String resourceGroupName, return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.disable(this.client.getEndpoint(), resourceGroupName, workspaceName, - intelligencePackName, apiVersion, this.client.getSubscriptionId(), context)) + intelligencePackName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Disables an intelligence pack for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param intelligencePackName The name of the intelligence pack to be disabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disableWithResponseAsync(String resourceGroupName, String workspaceName, - String intelligencePackName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (intelligencePackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter intelligencePackName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.disable(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, - apiVersion, this.client.getSubscriptionId(), context); - } - /** * Disables an intelligence pack for a given workspace. * @@ -201,7 +190,30 @@ private Mono disableAsync(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public Response disableWithResponse(String resourceGroupName, String workspaceName, String intelligencePackName, Context context) { - return disableWithResponseAsync(resourceGroupName, workspaceName, intelligencePackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (intelligencePackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter intelligencePackName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.disableSync(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -252,53 +264,12 @@ private Mono> enableWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.enable(this.client.getEndpoint(), resourceGroupName, workspaceName, - intelligencePackName, apiVersion, this.client.getSubscriptionId(), context)) + intelligencePackName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Enables an intelligence pack for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param intelligencePackName The name of the intelligence pack to be enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> enableWithResponseAsync(String resourceGroupName, String workspaceName, - String intelligencePackName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (intelligencePackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter intelligencePackName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.enable(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, - apiVersion, this.client.getSubscriptionId(), context); - } - /** * Enables an intelligence pack for a given workspace. * @@ -331,7 +302,30 @@ private Mono enableAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response enableWithResponse(String resourceGroupName, String workspaceName, String intelligencePackName, Context context) { - return enableWithResponseAsync(resourceGroupName, workspaceName, intelligencePackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (intelligencePackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter intelligencePackName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.enableSync(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -377,50 +371,13 @@ private Mono>> listWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of IntelligencePack along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. * @@ -450,7 +407,27 @@ private Mono> listAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -467,4 +444,6 @@ public Response> listWithResponse(String resourceGro public List list(String resourceGroupName, String workspaceName) { return listWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(IntelligencePacksClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java index fd4b651ecddc..bf10d55b3740 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 @@ -27,8 +27,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.LinkedServicesClient; @@ -68,7 +70,7 @@ public final class LinkedServicesClientImpl implements LinkedServicesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientLinkedServices") public interface LinkedServicesService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") @@ -81,6 +83,17 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") LinkedServiceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("linkedServiceName") String linkedServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkedServiceInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") @ExpectedResponses({ 200, 202, 204 }) @@ -90,6 +103,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") @ExpectedResponses({ 200 }) @@ -99,6 +121,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices") @ExpectedResponses({ 200 }) @@ -107,6 +138,15 @@ Mono> listByWorkspace(@HostParam("$host") Stri @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -149,11 +189,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + linkedServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -164,45 +204,46 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linkedServices resource. * @param parameters The parameters required to create or update a linked service. - * @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 Linked service resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Linked service resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String linkedServiceName, LinkedServiceInner parameters, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName, LinkedServiceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (linkedServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + linkedServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + Context.NONE); } /** @@ -212,18 +253,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linkedServices resource. * @param parameters The parameters required to create or update a linked service. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the top level Linked service resource container. + * @return the top level Linked service resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkedServiceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName, LinkedServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (linkedServiceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + linkedServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context); } /** @@ -233,7 +303,6 @@ private PollerFlux, LinkedServiceInner> beginCrea * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linkedServices resource. * @param parameters The parameters required to create or update a linked service. - * @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. @@ -241,13 +310,11 @@ private PollerFlux, LinkedServiceInner> beginCrea */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, context); + LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); } /** @@ -265,8 +332,10 @@ private PollerFlux, LinkedServiceInner> beginCrea @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, linkedServiceName, parameters); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, Context.NONE); } /** @@ -285,8 +354,10 @@ public SyncPoller, LinkedServiceInner> beginCreat @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, linkedServiceName, parameters, context); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, context); } /** @@ -308,26 +379,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, S .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create or update a linked service. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param linkedServiceName Name of the linkedServices resource. - * @param parameters The parameters required to create or update a linked service. - * @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 Linked service resource container on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, LinkedServiceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create or update a linked service. * @@ -343,7 +394,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner createOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { - return createOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, linkedServiceName, parameters).getFinalResult(); } /** @@ -362,7 +413,8 @@ public LinkedServiceInner createOrUpdate(String resourceGroupName, String worksp @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner createOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, linkedServiceName, parameters, context) + .getFinalResult(); } /** @@ -399,11 +451,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + linkedServiceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -413,40 +464,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linked service. - * @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 Linked service resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Linked service resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (linkedServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, - apiVersion, this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); } /** @@ -455,18 +505,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linked service. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the top level Linked service resource container. + * @return the top level Linked service resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkedServiceInner> beginDeleteAsync(String resourceGroupName, - String workspaceName, String linkedServiceName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (linkedServiceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -475,7 +547,6 @@ private PollerFlux, LinkedServiceInner> beginDele * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linked service. - * @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. @@ -483,12 +554,11 @@ private PollerFlux, LinkedServiceInner> beginDele */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginDeleteAsync(String resourceGroupName, - String workspaceName, String linkedServiceName, Context context) { - context = this.client.mergeContext(context); + String workspaceName, String linkedServiceName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, context); + = deleteWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, context); + LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); } /** @@ -505,7 +575,9 @@ private PollerFlux, LinkedServiceInner> beginDele @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginDelete(String resourceGroupName, String workspaceName, String linkedServiceName) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, linkedServiceName); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, Context.NONE); } /** @@ -523,7 +595,10 @@ public SyncPoller, LinkedServiceInner> beginDelet @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginDelete(String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName, context).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, workspaceName, linkedServiceName, context); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, context); } /** @@ -544,25 +619,6 @@ private Mono deleteAsync(String resourceGroupName, String wo .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a linked service instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param linkedServiceName Name of the linked service. - * @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 Linked service resource container on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a linked service instance. * @@ -576,7 +632,7 @@ private Mono deleteAsync(String resourceGroupName, String wo */ @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner delete(String resourceGroupName, String workspaceName, String linkedServiceName) { - return deleteAsync(resourceGroupName, workspaceName, linkedServiceName).block(); + return beginDelete(resourceGroupName, workspaceName, linkedServiceName).getFinalResult(); } /** @@ -594,7 +650,7 @@ public LinkedServiceInner delete(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner delete(String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { - return deleteAsync(resourceGroupName, workspaceName, linkedServiceName, context).block(); + return beginDelete(resourceGroupName, workspaceName, linkedServiceName, context).getFinalResult(); } /** @@ -630,55 +686,13 @@ private Mono> getWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + linkedServiceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a linked service instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param linkedServiceName Name of the linked service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a linked service instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (linkedServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServiceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a linked service instance. * @@ -712,7 +726,31 @@ private Mono getAsync(String resourceGroupName, String works @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (linkedServiceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -760,11 +798,10 @@ private Mono> listByWorkspaceSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -775,39 +812,14 @@ private Mono> listByWorkspaceSinglePageAsync(S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the linked services instances in a workspace along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the linked services instances in a workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -818,11 +830,35 @@ private Mono> listByWorkspaceSinglePageAsync(S * @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 linked services instances in a workspace as paginated response with {@link PagedFlux}. + * @return the linked services instances in a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -834,12 +870,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupN * @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 linked services instances in a workspace as paginated response with {@link PagedFlux}. + * @return the linked services instances in a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -854,7 +913,7 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -871,6 +930,8 @@ public PagedIterable listByWorkspace(String resourceGroupNam @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(LinkedServicesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java index 14c65e99b288..4fc3b5dbc3fe 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 @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.LinkedStorageAccountsClient; import com.azure.resourcemanager.loganalytics.fluent.models.LinkedStorageAccountsResourceInner; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -64,7 +65,7 @@ public final class LinkedStorageAccountsClientImpl implements LinkedStorageAccou * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientLinkedStorageAccounts") public interface LinkedStorageAccountsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") @@ -77,6 +78,17 @@ Mono> createOrUpdate(@HostParam("$h @BodyParam("application/json") LinkedStorageAccountsResourceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceType") DataSourceType dataSourceType, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkedStorageAccountsResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") @ExpectedResponses({ 200 }) @@ -86,6 +98,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") @ExpectedResponses({ 200 }) @@ -95,6 +116,15 @@ Mono> get(@HostParam("$host") Strin @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts") @ExpectedResponses({ 200 }) @@ -103,6 +133,15 @@ Mono> listByWorkspace(@HostParam("$hos @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); } /** @@ -145,63 +184,14 @@ private Mono> createOrUpdateWithRes } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + dataSourceType, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or Update a link relation between current workspace and a group of storage accounts of a specific data - * source type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceType Linked storage accounts type. - * @param parameters The parameters required to create or update linked storage accounts. - * @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 linked storage accounts top level resource container along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, DataSourceType dataSourceType, LinkedStorageAccountsResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceType 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); - } - /** * Create or Update a link relation between current workspace and a group of storage accounts of a specific data * source type. @@ -240,8 +230,37 @@ private Mono createOrUpdateAsync(String reso public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, LinkedStorageAccountsResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataSourceType, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); } /** @@ -296,52 +315,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, apiVersion, this.client.getSubscriptionId(), context)) + dataSourceType, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceType Linked storage accounts type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - DataSourceType dataSourceType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceType 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, apiVersion, - this.client.getSubscriptionId(), context); - } - /** * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. * @@ -374,7 +353,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, D @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataSourceType, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -425,55 +427,13 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, apiVersion, this.client.getSubscriptionId(), accept, context)) + dataSourceType, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets all linked storage account of a specific data source type associated with the specified workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceType Linked storage accounts type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all linked storage account of a specific data source type associated with the specified workspace along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String workspaceName, DataSourceType dataSourceType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceType 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets all linked storage account of a specific data source type associated with the specified workspace. * @@ -509,7 +469,31 @@ private Mono getAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataSourceType, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -559,11 +543,10 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, apiVersion, workspaceName, accept, context)) + resourceGroupName, this.client.getApiVersion(), workspaceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -575,39 +558,16 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all linked storage accounts associated with the specified workspace, storage accounts will be sorted by - * their data source type along with {@link PagedResponse} on successful completion of {@link Mono}. + * their data source type as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, - workspaceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -620,12 +580,35 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all linked storage accounts associated with the specified workspace, storage accounts will be sorted by - * their data source type as paginated response with {@link PagedFlux}. + * their data source type along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -639,12 +622,35 @@ private PagedFlux listByWorkspaceAsync(Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all linked storage accounts associated with the specified workspace, storage accounts will be sorted by - * their data source type as paginated response with {@link PagedFlux}. + * their data source type along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -662,7 +668,7 @@ private PagedFlux listByWorkspaceAsync(Strin @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -681,6 +687,8 @@ public PagedIterable listByWorkspace(String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(LinkedStorageAccountsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java index 96d8b006e861..f2dfcbe42f25 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -44,6 +45,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String queryPackId() { return this.innerModel().queryPackId(); } @@ -179,6 +184,6 @@ public LogAnalyticsQueryPackImpl withTags(Map tags) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java index 411b94fc8e02..e7b959814944 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 @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.ManagementGroupsClient; import com.azure.resourcemanager.loganalytics.fluent.models.ManagementGroupInner; import com.azure.resourcemanager.loganalytics.models.WorkspaceListManagementGroupsResult; @@ -60,7 +61,7 @@ public final class ManagementGroupsClientImpl implements ManagementGroupsClient * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientManagementGroups") public interface ManagementGroupsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups") @@ -70,6 +71,15 @@ Mono> list(@HostParam("$host") Str @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -101,11 +111,10 @@ private Mono> listSinglePageAsync(String res return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -116,39 +125,14 @@ private Mono> listSinglePageAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of management groups connected to a workspace along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of management groups connected to a workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -159,11 +143,34 @@ private Mono> listSinglePageAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of management groups connected to a workspace as paginated response with {@link PagedFlux}. + * @return a list of management groups connected to a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -175,11 +182,35 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of management groups connected to a workspace as paginated response with {@link PagedFlux}. + * @return a list of management groups connected to a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -194,7 +225,7 @@ private PagedFlux listAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName)); } /** @@ -210,6 +241,8 @@ public PagedIterable list(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementGroupsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/NetworkSecurityPerimeterConfigurationImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/NetworkSecurityPerimeterConfigurationImpl.java new file mode 100644 index 000000000000..ae651a8b7628 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/NetworkSecurityPerimeterConfigurationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; + +public final class NetworkSecurityPerimeterConfigurationImpl implements NetworkSecurityPerimeterConfiguration { + private NetworkSecurityPerimeterConfigurationInner innerObject; + + private final com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager; + + NetworkSecurityPerimeterConfigurationImpl(NetworkSecurityPerimeterConfigurationInner innerObject, + com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public NetworkSecurityPerimeterConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NetworkSecurityPerimeterConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java index f0da81820b4d..9f3f7c2ae27c 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 @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.OperationStatusesClient; import com.azure.resourcemanager.loganalytics.fluent.models.OperationStatusInner; import reactor.core.publisher.Mono; @@ -55,7 +56,7 @@ public final class OperationStatusesClientImpl implements OperationStatusesClien * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientOperationStatuses") public interface OperationStatusesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}") @@ -65,6 +66,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("asyncOperationId") String asyncOperationId, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("location") String location, @PathParam("asyncOperationId") String asyncOperationId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -95,51 +105,13 @@ private Mono> getWithResponseAsync(String locatio return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), location, asyncOperationId, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), location, asyncOperationId, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The region name of operation. - * @param asyncOperationId The operation Id. - * @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 status of a long running azure asynchronous operation along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String asyncOperationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (asyncOperationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter asyncOperationId 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), location, asyncOperationId, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Get the status of a long running azure asynchronous operation. * @@ -168,7 +140,27 @@ private Mono getAsync(String location, String asyncOperati */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String location, String asyncOperationId, Context context) { - return getWithResponseAsync(location, asyncOperationId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (asyncOperationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter asyncOperationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), location, asyncOperationId, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** @@ -185,4 +177,6 @@ public Response getWithResponse(String location, String as public OperationStatusInner get(String location, String asyncOperationId) { return getWithResponse(location, asyncOperationId, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java index d0f29df2b257..558e2b218eee 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 @@ -15,12 +15,15 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.AvailableServiceTiersClient; @@ -42,6 +45,7 @@ import com.azure.resourcemanager.loganalytics.fluent.SchemasClient; import com.azure.resourcemanager.loganalytics.fluent.SharedKeysOperationsClient; import com.azure.resourcemanager.loganalytics.fluent.StorageInsightConfigsClient; +import com.azure.resourcemanager.loganalytics.fluent.SummaryLogsOperationsClient; import com.azure.resourcemanager.loganalytics.fluent.TablesClient; import com.azure.resourcemanager.loganalytics.fluent.UsagesClient; import com.azure.resourcemanager.loganalytics.fluent.WorkspacePurgesClient; @@ -88,6 +92,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -131,31 +149,31 @@ public Duration getDefaultPollInterval() { } /** - * The QueryPacksClient object to access its operations. + * The AvailableServiceTiersClient object to access its operations. */ - private final QueryPacksClient queryPacks; + private final AvailableServiceTiersClient availableServiceTiers; /** - * Gets the QueryPacksClient object to access its operations. + * Gets the AvailableServiceTiersClient object to access its operations. * - * @return the QueryPacksClient object. + * @return the AvailableServiceTiersClient object. */ - public QueryPacksClient getQueryPacks() { - return this.queryPacks; + public AvailableServiceTiersClient getAvailableServiceTiers() { + return this.availableServiceTiers; } /** - * The QueriesClient object to access its operations. + * The ClustersClient object to access its operations. */ - private final QueriesClient queries; + private final ClustersClient clusters; /** - * Gets the QueriesClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the QueriesClient object. + * @return the ClustersClient object. */ - public QueriesClient getQueries() { - return this.queries; + public ClustersClient getClusters() { + return this.clusters; } /** @@ -186,6 +204,20 @@ public DataSourcesClient getDataSources() { return this.dataSources; } + /** + * The GatewaysClient object to access its operations. + */ + private final GatewaysClient gateways; + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + public GatewaysClient getGateways() { + return this.gateways; + } + /** * The IntelligencePacksClient object to access its operations. */ @@ -243,59 +275,59 @@ public ManagementGroupsClient getManagementGroups() { } /** - * The OperationStatusesClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final OperationStatusesClient operationStatuses; + private final OperationsClient operations; /** - * Gets the OperationStatusesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the OperationStatusesClient object. + * @return the OperationsClient object. */ - public OperationStatusesClient getOperationStatuses() { - return this.operationStatuses; + public OperationsClient getOperations() { + return this.operations; } /** - * The SharedKeysOperationsClient object to access its operations. + * The OperationStatusesClient object to access its operations. */ - private final SharedKeysOperationsClient sharedKeysOperations; + private final OperationStatusesClient operationStatuses; /** - * Gets the SharedKeysOperationsClient object to access its operations. + * Gets the OperationStatusesClient object to access its operations. * - * @return the SharedKeysOperationsClient object. + * @return the OperationStatusesClient object. */ - public SharedKeysOperationsClient getSharedKeysOperations() { - return this.sharedKeysOperations; + public OperationStatusesClient getOperationStatuses() { + return this.operationStatuses; } /** - * The UsagesClient object to access its operations. + * The QueriesClient object to access its operations. */ - private final UsagesClient usages; + private final QueriesClient queries; /** - * Gets the UsagesClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the UsagesClient object. + * @return the QueriesClient object. */ - public UsagesClient getUsages() { - return this.usages; + public QueriesClient getQueries() { + return this.queries; } /** - * The StorageInsightConfigsClient object to access its operations. + * The QueryPacksClient object to access its operations. */ - private final StorageInsightConfigsClient storageInsightConfigs; + private final QueryPacksClient queryPacks; /** - * Gets the StorageInsightConfigsClient object to access its operations. + * Gets the QueryPacksClient object to access its operations. * - * @return the StorageInsightConfigsClient object. + * @return the QueryPacksClient object. */ - public StorageInsightConfigsClient getStorageInsightConfigs() { - return this.storageInsightConfigs; + public QueryPacksClient getQueryPacks() { + return this.queryPacks; } /** @@ -313,87 +345,87 @@ public SavedSearchesClient getSavedSearches() { } /** - * The AvailableServiceTiersClient object to access its operations. + * The SchemasClient object to access its operations. */ - private final AvailableServiceTiersClient availableServiceTiers; + private final SchemasClient schemas; /** - * Gets the AvailableServiceTiersClient object to access its operations. + * Gets the SchemasClient object to access its operations. * - * @return the AvailableServiceTiersClient object. + * @return the SchemasClient object. */ - public AvailableServiceTiersClient getAvailableServiceTiers() { - return this.availableServiceTiers; + public SchemasClient getSchemas() { + return this.schemas; } /** - * The GatewaysClient object to access its operations. + * The SharedKeysOperationsClient object to access its operations. */ - private final GatewaysClient gateways; + private final SharedKeysOperationsClient sharedKeysOperations; /** - * Gets the GatewaysClient object to access its operations. + * Gets the SharedKeysOperationsClient object to access its operations. * - * @return the GatewaysClient object. + * @return the SharedKeysOperationsClient object. */ - public GatewaysClient getGateways() { - return this.gateways; + public SharedKeysOperationsClient getSharedKeysOperations() { + return this.sharedKeysOperations; } /** - * The SchemasClient object to access its operations. + * The StorageInsightConfigsClient object to access its operations. */ - private final SchemasClient schemas; + private final StorageInsightConfigsClient storageInsightConfigs; /** - * Gets the SchemasClient object to access its operations. + * Gets the StorageInsightConfigsClient object to access its operations. * - * @return the SchemasClient object. + * @return the StorageInsightConfigsClient object. */ - public SchemasClient getSchemas() { - return this.schemas; + public StorageInsightConfigsClient getStorageInsightConfigs() { + return this.storageInsightConfigs; } /** - * The WorkspacePurgesClient object to access its operations. + * The TablesClient object to access its operations. */ - private final WorkspacePurgesClient workspacePurges; + private final TablesClient tables; /** - * Gets the WorkspacePurgesClient object to access its operations. + * Gets the TablesClient object to access its operations. * - * @return the WorkspacePurgesClient object. + * @return the TablesClient object. */ - public WorkspacePurgesClient getWorkspacePurges() { - return this.workspacePurges; + public TablesClient getTables() { + return this.tables; } /** - * The ClustersClient object to access its operations. + * The UsagesClient object to access its operations. */ - private final ClustersClient clusters; + private final UsagesClient usages; /** - * Gets the ClustersClient object to access its operations. + * Gets the UsagesClient object to access its operations. * - * @return the ClustersClient object. + * @return the UsagesClient object. */ - public ClustersClient getClusters() { - return this.clusters; + public UsagesClient getUsages() { + return this.usages; } /** - * The OperationsClient object to access its operations. + * The WorkspacePurgesClient object to access its operations. */ - private final OperationsClient operations; + private final WorkspacePurgesClient workspacePurges; /** - * Gets the OperationsClient object to access its operations. + * Gets the WorkspacePurgesClient object to access its operations. * - * @return the OperationsClient object. + * @return the WorkspacePurgesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public WorkspacePurgesClient getWorkspacePurges() { + return this.workspacePurges; } /** @@ -425,17 +457,17 @@ public DeletedWorkspacesClient getDeletedWorkspaces() { } /** - * The TablesClient object to access its operations. + * The SummaryLogsOperationsClient object to access its operations. */ - private final TablesClient tables; + private final SummaryLogsOperationsClient summaryLogsOperations; /** - * Gets the TablesClient object to access its operations. + * Gets the SummaryLogsOperationsClient object to access its operations. * - * @return the TablesClient object. + * @return the SummaryLogsOperationsClient object. */ - public TablesClient getTables() { - return this.tables; + public SummaryLogsOperationsClient getSummaryLogsOperations() { + return this.summaryLogsOperations; } /** @@ -455,28 +487,30 @@ public TablesClient getTables() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.queryPacks = new QueryPacksClientImpl(this); - this.queries = new QueriesClientImpl(this); + this.apiVersion = "2025-07-01"; + this.availableServiceTiers = new AvailableServiceTiersClientImpl(this); + this.clusters = new ClustersClientImpl(this); this.dataExports = new DataExportsClientImpl(this); this.dataSources = new DataSourcesClientImpl(this); + this.gateways = new GatewaysClientImpl(this); this.intelligencePacks = new IntelligencePacksClientImpl(this); this.linkedServices = new LinkedServicesClientImpl(this); this.linkedStorageAccounts = new LinkedStorageAccountsClientImpl(this); this.managementGroups = new ManagementGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); this.operationStatuses = new OperationStatusesClientImpl(this); - this.sharedKeysOperations = new SharedKeysOperationsClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.storageInsightConfigs = new StorageInsightConfigsClientImpl(this); + this.queries = new QueriesClientImpl(this); + this.queryPacks = new QueryPacksClientImpl(this); this.savedSearches = new SavedSearchesClientImpl(this); - this.availableServiceTiers = new AvailableServiceTiersClientImpl(this); - this.gateways = new GatewaysClientImpl(this); this.schemas = new SchemasClientImpl(this); + this.sharedKeysOperations = new SharedKeysOperationsClientImpl(this); + this.storageInsightConfigs = new StorageInsightConfigsClientImpl(this); + this.tables = new TablesClientImpl(this); + this.usages = new UsagesClientImpl(this); this.workspacePurges = new WorkspacePurgesClientImpl(this); - this.clusters = new ClustersClientImpl(this); - this.operations = new OperationsClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); this.deletedWorkspaces = new DeletedWorkspacesClientImpl(this); - this.tables = new TablesClientImpl(this); + this.summaryLogsOperations = new SummaryLogsOperationsClientImpl(this); } /** @@ -516,6 +550,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java index 77996dac2fc7..555a84184171 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 @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.OperationsClient; import com.azure.resourcemanager.loganalytics.fluent.models.OperationInner; import com.azure.resourcemanager.loganalytics.models.OperationListResult; @@ -60,7 +61,7 @@ public final class OperationsClientImpl implements OperationsClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.OperationalInsights/operations") @@ -69,12 +70,26 @@ public interface OperationsService { Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.OperationalInsights/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -91,9 +106,10 @@ private Mono> listSinglePageAsync() { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -102,25 +118,13 @@ private Mono> listSinglePageAsync() { /** * Lists all of the available OperationalInsights Rest API operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list solution operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list solution operations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,11 +132,20 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list solution operations as paginated response with {@link PagedFlux}. + * @return result of the request to list solution operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -142,12 +155,20 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list solution operations as paginated response with {@link PagedFlux}. + * @return result of the request to list solution operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -159,7 +180,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -173,7 +194,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -202,6 +223,33 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list solution operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -210,22 +258,24 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list solution operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list solution operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java index 8925e741cf34..bb2500b9b4d2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.QueriesClient; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackQueryInner; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryListResult; @@ -65,7 +66,7 @@ public final class QueriesClientImpl implements QueriesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientQueries") public interface QueriesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries") @@ -78,6 +79,17 @@ Mono> list(@HostParam("$host") St @QueryParam("includeBody") Boolean includeBody, @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Long top, + @QueryParam("includeBody") Boolean includeBody, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search") @ExpectedResponses({ 200 }) @@ -90,6 +102,18 @@ Mono> search(@HostParam("$host") @BodyParam("application/json") LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response searchSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Long top, + @QueryParam("includeBody") Boolean includeBody, @QueryParam("$skipToken") String skipToken, + @BodyParam("application/json") LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200 }) @@ -100,6 +124,16 @@ Mono> get(@HostParam("$host") String e @PathParam("id") String id, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200 }) @@ -111,6 +145,17 @@ Mono> put(@HostParam("$host") String e @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response putSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200 }) @@ -122,6 +167,17 @@ Mono> update(@HostParam("$host") Strin @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200, 204 }) @@ -132,6 +188,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("id") String id, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -140,6 +206,14 @@ Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -147,6 +221,14 @@ Mono> listNext( Mono> searchNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response searchNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -182,11 +264,11 @@ private Mono> listSinglePageAsync if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, apiVersion, top, includeBody, skipToken, accept, context)) + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -201,39 +283,16 @@ private Mono> listSinglePageAsync * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only * return the query information. * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String queryPackName, Long top, Boolean includeBody, String skipToken, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - apiVersion, top, includeBody, skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String queryPackName, + Long top, Boolean includeBody, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -241,18 +300,16 @@ private Mono> listSinglePageAsync * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param top Maximum items returned in page. - * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only - * return the query information. - * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String queryPackName, - Long top, Boolean includeBody, String skipToken) { + private PagedFlux listAsync(String resourceGroupName, String queryPackName) { + final Long top = null; + final Boolean includeBody = null; + final String skipToken = null; return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -262,18 +319,42 @@ private PagedFlux listAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param queryPackName The name of the Log Analytics QueryPack resource. + * @param top Maximum items returned in page. + * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only + * return the query information. + * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String queryPackName) { - final Long top = null; - final Boolean includeBody = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String queryPackName, Long top, Boolean includeBody, String skipToken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -289,14 +370,35 @@ private PagedFlux listAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String queryPackName, - Long top, Boolean includeBody, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String queryPackName, Long top, Boolean includeBody, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -315,7 +417,8 @@ public PagedIterable list(String resourceGroupN final Long top = null; final Boolean includeBody = null; final String skipToken = null; - return new PagedIterable<>(listAsync(resourceGroupName, queryPackName, top, includeBody, skipToken)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, queryPackName, top, includeBody, skipToken), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -337,7 +440,9 @@ public PagedIterable list(String resourceGroupN @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String queryPackName, Long top, Boolean includeBody, String skipToken, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, queryPackName, top, includeBody, skipToken, context)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, queryPackName, top, includeBody, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -381,69 +486,16 @@ private Mono> searchSinglePageAsy } else { querySearchProperties.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.search(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, apiVersion, top, includeBody, skipToken, querySearchProperties, accept, context)) + .withContext(context -> service.search(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, + querySearchProperties, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param querySearchProperties Properties by which to search queries in the given Log Analytics QueryPack. - * @param top Maximum items returned in page. - * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only - * return the query information. - * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. - * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchSinglePageAsync(String resourceGroupName, - String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, - Boolean includeBody, String skipToken, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (querySearchProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter querySearchProperties is required and cannot be null.")); - } else { - querySearchProperties.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .search(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - apiVersion, top, includeBody, skipToken, querySearchProperties, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. * @@ -490,6 +542,57 @@ private PagedFlux searchAsync(String resourceGr includeBody, skipToken), nextLink -> searchNextSinglePageAsync(nextLink)); } + /** + * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param queryPackName The name of the Log Analytics QueryPack resource. + * @param querySearchProperties Properties by which to search queries in the given Log Analytics QueryPack. + * @param top Maximum items returned in page. + * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only + * return the query information. + * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. + * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse searchSinglePage(String resourceGroupName, + String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, + Boolean includeBody, String skipToken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (querySearchProperties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter querySearchProperties is required and cannot be null.")); + } else { + querySearchProperties.validate(); + } + final String accept = "application/json"; + Response res = service.searchSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, queryPackName, this.client.getApiVersion(), top, + includeBody, skipToken, querySearchProperties, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. * @@ -504,15 +607,42 @@ private PagedFlux searchAsync(String resourceGr * @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 describes the list of Log Analytics QueryPack-Query resources as paginated response with - * {@link PagedFlux}. + * @return describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux searchAsync(String resourceGroupName, String queryPackName, - LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, Boolean includeBody, - String skipToken, Context context) { - return new PagedFlux<>(() -> searchSinglePageAsync(resourceGroupName, queryPackName, querySearchProperties, top, - includeBody, skipToken, context), nextLink -> searchNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse searchSinglePage(String resourceGroupName, + String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, + Boolean includeBody, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (querySearchProperties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter querySearchProperties is required and cannot be null.")); + } else { + querySearchProperties.validate(); + } + final String accept = "application/json"; + Response res = service.searchSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, queryPackName, this.client.getApiVersion(), top, + includeBody, skipToken, querySearchProperties, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -533,8 +663,8 @@ public PagedIterable search(String resourceGrou final Long top = null; final Boolean includeBody = null; final String skipToken = null; - return new PagedIterable<>( - searchAsync(resourceGroupName, queryPackName, querySearchProperties, top, includeBody, skipToken)); + return new PagedIterable<>(() -> searchSinglePage(resourceGroupName, queryPackName, querySearchProperties, top, + includeBody, skipToken), nextLink -> searchNextSinglePage(nextLink)); } /** @@ -558,8 +688,8 @@ public PagedIterable search(String resourceGrou public PagedIterable search(String resourceGroupName, String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, Boolean includeBody, String skipToken, Context context) { - return new PagedIterable<>( - searchAsync(resourceGroupName, queryPackName, querySearchProperties, top, includeBody, skipToken, context)); + return new PagedIterable<>(() -> searchSinglePage(resourceGroupName, queryPackName, querySearchProperties, top, + includeBody, skipToken, context), nextLink -> searchNextSinglePage(nextLink, context)); } /** @@ -595,55 +725,13 @@ private Mono> getWithResponseAsync(Str if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Log Analytics Query defined within a Log Analytics QueryPack along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String queryPackName, String id, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - id, apiVersion, accept, context); - } - /** * Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. * @@ -677,7 +765,30 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String queryPackName, String id, Context context) { - return getWithResponseAsync(resourceGroupName, queryPackName, id, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), accept, context); } /** @@ -736,62 +847,13 @@ private Mono> putWithResponseAsync(Str } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, queryPayload, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Adds or Updates a specific Query within a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @param queryPayload Properties that need to be specified to create a new query and add it to a Log Analytics - * QueryPack. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Log Analytics QueryPack-Query definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(String resourceGroupName, - String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (queryPayload == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); - } else { - queryPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - id, apiVersion, queryPayload, accept, context); - } - /** * Adds or Updates a specific Query within a Log Analytics QueryPack. * @@ -829,7 +891,36 @@ private Mono putAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(String resourceGroupName, String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, Context context) { - return putWithResponseAsync(resourceGroupName, queryPackName, id, queryPayload, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (queryPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); + } else { + queryPayload.validate(); + } + final String accept = "application/json"; + return service.putSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context); } /** @@ -891,62 +982,13 @@ private Mono> updateWithResponseAsync( } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, queryPayload, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Adds or Updates a specific Query within a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @param queryPayload Properties that need to be specified to create a new query and add it to a Log Analytics - * QueryPack. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Log Analytics QueryPack-Query definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (queryPayload == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); - } else { - queryPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, id, apiVersion, queryPayload, accept, context); - } - /** * Adds or Updates a specific Query within a Log Analytics QueryPack. * @@ -984,7 +1026,36 @@ private Mono updateAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, Context context) { - return updateWithResponseAsync(resourceGroupName, queryPackName, id, queryPayload, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (queryPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); + } else { + queryPayload.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context); } /** @@ -1037,54 +1108,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a specific Query defined within an Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String queryPackName, String id, - 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, id, apiVersion, accept, context); - } - /** * Deletes a specific Query defined within an Log Analytics QueryPack. * @@ -1116,7 +1146,30 @@ private Mono deleteAsync(String resourceGroupName, String queryPackName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String queryPackName, String id, Context context) { - return deleteWithResponseAsync(resourceGroupName, queryPackName, id, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), accept, context); } /** @@ -1141,8 +1194,8 @@ public void delete(String resourceGroupName, String queryPackName, String id) { * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1160,6 +1213,33 @@ private Mono> listNextSinglePageA .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1168,24 +1248,24 @@ private Mono> listNextSinglePageA * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1214,6 +1294,33 @@ private Mono> searchNextSinglePag .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse searchNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.searchNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1222,23 +1329,25 @@ private Mono> searchNextSinglePag * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse searchNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.searchNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.searchNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(QueriesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java index eb13f9fc4f9b..3819c5d7c940 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java @@ -29,6 +29,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.QueryPacksClient; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackListResult; @@ -65,7 +66,7 @@ public final class QueryPacksClientImpl implements QueryPacksClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientQueryPacks") public interface QueryPacksService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/queryPacks") @@ -75,6 +76,14 @@ Mono> list(@HostParam("$host") String @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/queryPacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") @ExpectedResponses({ 200 }) @@ -83,6 +92,14 @@ Mono> listByResourceGroup(@HostParam(" @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") @ExpectedResponses({ 201 }) @@ -93,6 +110,16 @@ Mono> createOrUpdateWithoutName(@HostParam( @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateWithoutNameSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200, 204 }) @@ -102,6 +129,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200 }) @@ -111,6 +147,15 @@ Mono> getByResourceGroup(@HostParam("$host" @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200 }) @@ -121,6 +166,16 @@ Mono> createOrUpdate(@HostParam("$host") St @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200 }) @@ -131,6 +186,16 @@ Mono> updateTags(@HostParam("$host") String @BodyParam("application/json") TagsResource queryPackTags, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateTagsSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @BodyParam("application/json") TagsResource queryPackTags, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -139,6 +204,14 @@ Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -146,6 +219,14 @@ Mono> listNext( Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -166,11 +247,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -179,29 +259,14 @@ private Mono> listSinglePageAsync() { /** * Gets a list of all Log Analytics QueryPacks within a subscription. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of all Log Analytics QueryPacks within a subscription as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -209,12 +274,25 @@ private Mono> listSinglePageAsync(Cont * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Log Analytics QueryPacks within a subscription as paginated response with - * {@link PagedFlux}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -224,13 +302,25 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Log Analytics QueryPacks within a subscription as paginated response with - * {@link PagedFlux}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -243,7 +333,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -258,7 +348,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -286,11 +376,10 @@ public PagedIterable list(Context context) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -300,36 +389,15 @@ public PagedIterable list(Context context) { * Gets a list of Log Analytics QueryPacks within a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of Log Analytics QueryPacks within a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -339,12 +407,29 @@ private Mono> listByResourceGroupSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Log Analytics QueryPacks within a resource group as paginated response with {@link PagedFlux}. + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -355,12 +440,30 @@ private PagedFlux listByResourceGroupAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Log Analytics QueryPacks within a resource group as paginated response with {@link PagedFlux}. + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -375,7 +478,8 @@ private PagedFlux listByResourceGroupAsync(String re */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -391,7 +495,8 @@ public PagedIterable listByResourceGroup(String reso */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -428,56 +533,14 @@ private Mono> createOrUpdateWithoutNameWith } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdateWithoutName(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Creates a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey nor AppId in - * the Put operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param logAnalyticsQueryPackPayload Properties that need to be specified to create or update a Log Analytics - * QueryPack. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithoutNameWithResponseAsync( - String resourceGroupName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (logAnalyticsQueryPackPayload == null) { - return Mono.error( - new IllegalArgumentException("Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); - } else { - logAnalyticsQueryPackPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateWithoutName(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, context); - } - /** * Creates a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey nor AppId in * the Put operation. @@ -513,8 +576,31 @@ private Mono createOrUpdateWithoutNameAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithoutNameWithResponse(String resourceGroupName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - return createOrUpdateWithoutNameWithResponseAsync(resourceGroupName, logAnalyticsQueryPackPayload, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (logAnalyticsQueryPackPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); + } else { + logAnalyticsQueryPackPayload.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateWithoutNameSync(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, + context); } /** @@ -563,50 +649,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String queryPackName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), - queryPackName, accept, context); - } - /** * Deletes a Log Analytics QueryPack. * @@ -635,7 +684,27 @@ private Mono deleteAsync(String resourceGroupName, String queryPackName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String queryPackName, Context context) { - return deleteWithResponseAsync(resourceGroupName, queryPackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, accept, context); } /** @@ -681,51 +750,13 @@ private Mono> getByResourceGroupWithRespons if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Returns a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String queryPackName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context); - } - /** * Returns a Log Analytics QueryPack. * @@ -756,7 +787,27 @@ private Mono getByResourceGroupAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String queryPackName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, queryPackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, accept, context); } /** @@ -812,60 +863,14 @@ private Mono> createOrUpdateWithResponseAsy } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, + logAnalyticsQueryPackPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Creates (or updates) a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey - * nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param logAnalyticsQueryPackPayload Properties that need to be specified to create or update a Log Analytics - * QueryPack. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String queryPackName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (logAnalyticsQueryPackPayload == null) { - return Mono.error( - new IllegalArgumentException("Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); - } else { - logAnalyticsQueryPackPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context); - } - /** * Creates (or updates) a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey * nor AppId in the Put operation. @@ -903,8 +908,34 @@ private Mono createOrUpdateAsync(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String queryPackName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, queryPackName, logAnalyticsQueryPackPayload, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (logAnalyticsQueryPackPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); + } else { + logAnalyticsQueryPackPayload.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context); } /** @@ -962,57 +993,14 @@ private Mono> updateTagsWithResponseAsync(S } else { queryPackTags.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context)) + .withContext( + context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Updates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param queryPackTags Updated tag information to set into the QueryPack instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync(String resourceGroupName, - String queryPackName, TagsResource queryPackTags, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (queryPackTags == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackTags is required and cannot be null.")); - } else { - queryPackTags.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateTags(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context); - } - /** * Updates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method. * @@ -1046,7 +1034,33 @@ private Mono updateTagsAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) public Response updateTagsWithResponse(String resourceGroupName, String queryPackName, TagsResource queryPackTags, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, queryPackName, queryPackTags, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (queryPackTags == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackTags is required and cannot be null.")); + } else { + queryPackTags.validate(); + } + final String accept = "application/json"; + return service.updateTagsSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context); } /** @@ -1073,8 +1087,8 @@ public LogAnalyticsQueryPackInner updateTags(String resourceGroupName, String qu * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1092,6 +1106,33 @@ private Mono> listNextSinglePageAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1100,23 +1141,24 @@ private Mono> listNextSinglePageAsync( * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1126,7 +1168,7 @@ private Mono> listNextSinglePageAsync( * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1147,6 +1189,33 @@ private Mono> listByResourceGroupNextS .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1155,23 +1224,26 @@ private Mono> listByResourceGroupNextS * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(QueryPacksClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java index 1a5a158e3364..61ddbc7ed65d 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 @@ -24,6 +24,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.SavedSearchesClient; import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchInner; import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchesListResultInner; @@ -59,7 +60,7 @@ public final class SavedSearchesClientImpl implements SavedSearchesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientSavedSearches") public interface SavedSearchesService { @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") @@ -71,6 +72,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, + Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") @ExpectedResponses({ 200 }) @@ -82,6 +93,17 @@ Mono> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") SavedSearchInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SavedSearchInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") @ExpectedResponses({ 200 }) @@ -92,6 +114,16 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches") @ExpectedResponses({ 200 }) @@ -100,6 +132,15 @@ Mono> listByWorkspace(@HostParam("$host") @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -134,52 +175,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes the specified saved search in a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param savedSearchId The id of the saved search. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String savedSearchId, 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 (savedSearchId == null) { - return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, savedSearchId, apiVersion, context); - } - /** * Deletes the specified saved search in a given workspace. * @@ -212,7 +213,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String savedSearchId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, savedSearchId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (savedSearchId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, savedSearchId, this.client.getApiVersion(), context); } /** @@ -269,61 +293,14 @@ private Mono> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, parameters, accept, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Creates or updates a saved search for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param savedSearchId The id of the saved search. - * @param parameters The parameters required to save a search. - * @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 value object for saved search results along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String savedSearchId, SavedSearchInner 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 (savedSearchId == null) { - return Mono.error(new IllegalArgumentException("Parameter savedSearchId 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 = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, savedSearchId, apiVersion, parameters, accept, context); - } - /** * Creates or updates a saved search for a given workspace. * @@ -359,8 +336,37 @@ private Mono createOrUpdateAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (savedSearchId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, savedSearchId, this.client.getApiVersion(), parameters, accept, context); } /** @@ -415,55 +421,13 @@ private Mono> getWithResponseAsync(String resourceGro if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, accept, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the specified saved search for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param savedSearchId The id of the saved search. - * @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 specified saved search for a given workspace along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String savedSearchId, 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 (savedSearchId == null) { - return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - savedSearchId, apiVersion, accept, context); - } - /** * Gets the specified saved search for a given workspace. * @@ -496,7 +460,31 @@ private Mono getAsync(String resourceGroupName, String workspa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String savedSearchId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, savedSearchId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (savedSearchId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, savedSearchId, this.client.getApiVersion(), accept, context); } /** @@ -544,51 +532,13 @@ private Mono> listByWorkspaceWithResponse return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the saved searches for a given Log Analytics Workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the saved searches for a given Log Analytics Workspace along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets the saved searches for a given Log Analytics Workspace. * @@ -619,7 +569,27 @@ private Mono listByWorkspaceAsync(String resourceG @ServiceMethod(returns = ReturnType.SINGLE) public Response listByWorkspaceWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -636,4 +606,6 @@ public Response listByWorkspaceWithResponse(String public SavedSearchesListResultInner listByWorkspace(String resourceGroupName, String workspaceName) { return listByWorkspaceWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(SavedSearchesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java index e6aa53b15388..9c87a78a57f9 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 @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.SchemasClient; import com.azure.resourcemanager.loganalytics.fluent.models.SearchGetSchemaResponseInner; import reactor.core.publisher.Mono; @@ -54,7 +55,7 @@ public final class SchemasClientImpl implements SchemasClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientSchemas") public interface SchemasService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema") @@ -64,6 +65,15 @@ Mono> get(@HostParam("$host") String endp @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -94,50 +104,13 @@ private Mono> getWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the schema for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the schema for a given workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets the schema for a given workspace. * @@ -167,7 +140,27 @@ private Mono getAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** @@ -184,4 +177,6 @@ public Response getWithResponse(String resourceGro public SearchGetSchemaResponseInner get(String resourceGroupName, String workspaceName) { return getWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(SchemasClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java index 2eb885fccb49..8604d2311407 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 @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.SharedKeysOperationsClient; import com.azure.resourcemanager.loganalytics.fluent.models.SharedKeysInner; import reactor.core.publisher.Mono; @@ -55,7 +56,7 @@ public final class SharedKeysOperationsClientImpl implements SharedKeysOperation * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientSharedKeysOperations") public interface SharedKeysOperationsService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys") @@ -66,6 +67,15 @@ Mono> getSharedKeys(@HostParam("$host") String endpoin @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSharedKeysSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey") @ExpectedResponses({ 200 }) @@ -74,6 +84,15 @@ Mono> regenerate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response regenerateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** @@ -104,50 +123,13 @@ private Mono> getSharedKeysWithResponseAsync(String re return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getSharedKeys(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the shared keys for a workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the shared keys for a workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSharedKeysWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getSharedKeys(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets the shared keys for a workspace. * @@ -178,7 +160,27 @@ private Mono getSharedKeysAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response getSharedKeysWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getSharedKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSharedKeysSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -225,51 +227,13 @@ private Mono> regenerateWithResponseAsync(String resou if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.regenerate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational - * Insights agents to the workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the shared keys for a workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateWithResponseAsync(String resourceGroupName, String workspaceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context); - } - /** * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational * Insights agents to the workspace. @@ -302,7 +266,27 @@ private Mono regenerateAsync(String resourceGroupName, String w @ServiceMethod(returns = ReturnType.SINGLE) public Response regenerateWithResponse(String resourceGroupName, String workspaceName, Context context) { - return regenerateWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.regenerateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); } /** @@ -320,4 +304,6 @@ public Response regenerateWithResponse(String resourceGroupName public SharedKeysInner regenerate(String resourceGroupName, String workspaceName) { return regenerateWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(SharedKeysOperationsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java index 4eb222cb9623..a4c86472e15f 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 @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.StorageInsightConfigsClient; import com.azure.resourcemanager.loganalytics.fluent.models.StorageInsightInner; import com.azure.resourcemanager.loganalytics.models.StorageInsightListResult; @@ -63,7 +64,7 @@ public final class StorageInsightConfigsClientImpl implements StorageInsightConf * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientStorageInsightConfigs") public interface StorageInsightConfigsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") @@ -76,6 +77,17 @@ Mono> createOrUpdate(@HostParam("$host") String en @BodyParam("application/json") StorageInsightInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageInsightInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") @ExpectedResponses({ 200 }) @@ -85,6 +97,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") @ExpectedResponses({ 200, 204 }) @@ -94,6 +115,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs") @ExpectedResponses({ 200 }) @@ -103,6 +133,15 @@ Mono> listByWorkspace(@HostParam("$host") Str @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -110,6 +149,14 @@ Mono> listByWorkspace(@HostParam("$host") Str Mono> listByWorkspaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -152,62 +199,14 @@ private Mono> createOrUpdateWithResponseAsync(Stri } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or update a storage insight. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param storageInsightName Name of the storageInsightsConfigs resource. - * @param parameters The parameters required to create or update a storage insight. - * @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 storage insight resource container along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String storageInsightName, StorageInsightInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (storageInsightName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageInsightName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context); - } - /** * Create or update a storage insight. * @@ -243,8 +242,38 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters, - context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (storageInsightName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageInsightName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context); } /** @@ -299,55 +328,13 @@ private Mono> getWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), accept, context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a storage insight instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param storageInsightName Name of the storageInsightsConfigs resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a storage insight instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String storageInsightName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (storageInsightName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageInsightName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a storage insight instance. * @@ -381,7 +368,31 @@ private Mono getAsync(String resourceGroupName, String work @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String storageInsightName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, storageInsightName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (storageInsightName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageInsightName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -433,53 +444,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a storageInsightsConfigs resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param storageInsightName Name of the storageInsightsConfigs resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String storageInsightName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (storageInsightName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageInsightName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, - apiVersion, this.client.getSubscriptionId(), context); - } - /** * Deletes a storageInsightsConfigs resource. * @@ -512,7 +482,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String storageInsightName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, storageInsightName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (storageInsightName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageInsightName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -559,11 +552,10 @@ private Mono> listByWorkspaceSinglePageAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().odataNextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -574,39 +566,15 @@ private Mono> listByWorkspaceSinglePageAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list storage insights operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list storage insights operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().odataNextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** @@ -617,12 +585,35 @@ private Mono> listByWorkspaceSinglePageAsync( * @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 list storage insights operation response as paginated response with {@link PagedFlux}. + * @return the list storage insights operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); } /** @@ -634,13 +625,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroup * @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 list storage insights operation response as paginated response with {@link PagedFlux}. + * @return the list storage insights operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); } /** @@ -655,7 +668,8 @@ private PagedFlux listByWorkspaceAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePage(nextLink)); } /** @@ -672,7 +686,8 @@ public PagedIterable listByWorkspace(String resourceGroupNa @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); } /** @@ -702,6 +717,33 @@ private Mono> listByWorkspaceNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list storage insights operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); + } + /** * Get the next page of items. * @@ -710,23 +752,25 @@ private Mono> listByWorkspaceNextSinglePageAs * @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 list storage insights operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list storage insights operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().odataNextLink(), null)); + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(StorageInsightConfigsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsImpl.java new file mode 100644 index 000000000000..90ba126a1301 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsImpl.java @@ -0,0 +1,199 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import com.azure.resourcemanager.loganalytics.models.StatusCodeEnum; +import com.azure.resourcemanager.loganalytics.models.SummaryLogs; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; + +public final class SummaryLogsImpl implements SummaryLogs, SummaryLogs.Definition, SummaryLogs.Update { + private SummaryLogsInner innerObject; + + private final com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RuleTypeEnum ruleType() { + return this.innerModel().ruleType(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean isActive() { + return this.innerModel().isActive(); + } + + public StatusCodeEnum statusCode() { + return this.innerModel().statusCode(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public RuleDefinition ruleDefinition() { + return this.innerModel().ruleDefinition(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SummaryLogsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String summaryLogsName; + + public SummaryLogsImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public SummaryLogs create() { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), Context.NONE); + return this; + } + + public SummaryLogs create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), context); + return this; + } + + SummaryLogsImpl(String name, com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerObject = new SummaryLogsInner(); + this.serviceManager = serviceManager; + this.summaryLogsName = name; + } + + public SummaryLogsImpl update() { + return this; + } + + public SummaryLogs apply() { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), Context.NONE); + return this; + } + + public SummaryLogs apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), context); + return this; + } + + SummaryLogsImpl(SummaryLogsInner innerObject, + com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.summaryLogsName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "summaryLogs"); + } + + public SummaryLogs refresh() { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .getWithResponse(resourceGroupName, workspaceName, summaryLogsName, Context.NONE) + .getValue(); + return this; + } + + public SummaryLogs refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .getWithResponse(resourceGroupName, workspaceName, summaryLogsName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.summaryLogsOperations().start(resourceGroupName, workspaceName, summaryLogsName); + } + + public void start(Context context) { + serviceManager.summaryLogsOperations().start(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public Response stopWithResponse(Context context) { + return serviceManager.summaryLogsOperations() + .stopWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void stop() { + serviceManager.summaryLogsOperations().stop(resourceGroupName, workspaceName, summaryLogsName); + } + + public void retryBin(SummaryLogsRetryBin parameters) { + serviceManager.summaryLogsOperations().retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters); + } + + public void retryBin(SummaryLogsRetryBin parameters, Context context) { + serviceManager.summaryLogsOperations() + .retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + } + + public SummaryLogsImpl withRuleType(RuleTypeEnum ruleType) { + this.innerModel().withRuleType(ruleType); + return this; + } + + public SummaryLogsImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public SummaryLogsImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SummaryLogsImpl withRuleDefinition(RuleDefinition ruleDefinition) { + this.innerModel().withRuleDefinition(ruleDefinition); + return this; + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsClientImpl.java new file mode 100644 index 000000000000..b6c151f4e68e --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsClientImpl.java @@ -0,0 +1,1698 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.loganalytics.fluent.SummaryLogsOperationsClient; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsListResult; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SummaryLogsOperationsClient. + */ +public final class SummaryLogsOperationsClientImpl implements SummaryLogsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SummaryLogsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of SummaryLogsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SummaryLogsOperationsClientImpl(OperationalInsightsManagementClientImpl client) { + this.service = RestProxy.create(SummaryLogsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for OperationalInsightsManagementClientSummaryLogsOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "OperationalInsightsManagementClientSummaryLogsOperations") + public interface SummaryLogsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/start") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/start") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/stop") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/stop") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response stopSync(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/retrybin") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> retryBin(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsRetryBin parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/retrybin") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response retryBinSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsRetryBin parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePage(nextLink)); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + Context context) { + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner 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 (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsInner parameters) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, Context.NONE); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, context); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 the {@link PollerFlux} for polling of workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SummaryLogsInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String summaryLogsName, SummaryLogsInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SummaryLogsInner.class, SummaryLogsInner.class, this.client.getContext()); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 the {@link SyncPoller} for polling of workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters) { + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(response, SummaryLogsInner.class, + SummaryLogsInner.class, Context.NONE); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 the {@link SyncPoller} for polling of workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + return this.client.getLroResult(response, SummaryLogsInner.class, + SummaryLogsInner.class, context); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, summaryLogsName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, summaryLogsName, parameters).getFinalResult(); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules 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 summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, summaryLogsName, parameters, context) + .getFinalResult(); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String summaryLogsName) { + return getWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SummaryLogsInner get(String resourceGroupName, String workspaceName, String summaryLogsName) { + return getWithResponse(resourceGroupName, workspaceName, summaryLogsName, Context.NONE).getValue(); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, Context.NONE); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String summaryLogsName) { + return beginDeleteAsync(resourceGroupName, workspaceName, summaryLogsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String summaryLogsName) { + beginDelete(resourceGroupName, workspaceName, summaryLogsName).getFinalResult(); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + beginDelete(resourceGroupName, workspaceName, summaryLogsName, context).getFinalResult(); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, Context.NONE); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Mono>> mono + = startWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Response response = startWithResponse(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + Response response = startWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String workspaceName, String summaryLogsName) { + return beginStartAsync(resourceGroupName, workspaceName, summaryLogsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String workspaceName, String summaryLogsName) { + beginStart(resourceGroupName, workspaceName, summaryLogsName).getFinalResult(); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + beginStart(resourceGroupName, workspaceName, summaryLogsName, context).getFinalResult(); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String workspaceName, String summaryLogsName) { + return stopWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.stopSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String workspaceName, String summaryLogsName) { + stopWithResponse(resourceGroupName, workspaceName, summaryLogsName, Context.NONE); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> retryBinWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin 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 (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.retryBin(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response retryBinWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.retryBinSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, Context.NONE); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response retryBinWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.retryBinSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, context); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRetryBinAsync(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters) { + Mono>> mono + = retryBinWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters) { + Response response + = retryBinWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters, Context context) { + Response response + = retryBinWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retryBinAsync(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters) { + return beginRetryBinAsync(resourceGroupName, workspaceName, summaryLogsName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters) { + beginRetryBin(resourceGroupName, workspaceName, summaryLogsName, parameters).getFinalResult(); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context) { + beginRetryBin(resourceGroupName, workspaceName, summaryLogsName, parameters, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(SummaryLogsOperationsClientImpl.class); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsImpl.java new file mode 100644 index 000000000000..e3bc565e8dab --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.loganalytics.fluent.SummaryLogsOperationsClient; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.SummaryLogs; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsOperations; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; + +public final class SummaryLogsOperationsImpl implements SummaryLogsOperations { + private static final ClientLogger LOGGER = new ClientLogger(SummaryLogsOperationsImpl.class); + + private final SummaryLogsOperationsClient innerClient; + + private final com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager; + + public SummaryLogsOperationsImpl(SummaryLogsOperationsClient innerClient, + com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SummaryLogsImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SummaryLogsImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SummaryLogsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SummaryLogs get(String resourceGroupName, String workspaceName, String summaryLogsName) { + SummaryLogsInner inner = this.serviceClient().get(resourceGroupName, workspaceName, summaryLogsName); + if (inner != null) { + return new SummaryLogsImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String summaryLogsName) { + this.serviceClient().delete(resourceGroupName, workspaceName, summaryLogsName); + } + + public void delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void start(String resourceGroupName, String workspaceName, String summaryLogsName) { + this.serviceClient().start(resourceGroupName, workspaceName, summaryLogsName); + } + + public void start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + this.serviceClient().start(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public Response stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context) { + return this.serviceClient().stopWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void stop(String resourceGroupName, String workspaceName, String summaryLogsName) { + this.serviceClient().stop(resourceGroupName, workspaceName, summaryLogsName); + } + + public void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters) { + this.serviceClient().retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters); + } + + public void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context) { + this.serviceClient().retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + } + + public SummaryLogs getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, summaryLogsName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + this.delete(resourceGroupName, workspaceName, summaryLogsName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + this.delete(resourceGroupName, workspaceName, summaryLogsName, context); + } + + private SummaryLogsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { + return this.serviceManager; + } + + public SummaryLogsImpl define(String name) { + return new SummaryLogsImpl(name, this.manager()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java index 7f0a3bcb785a..743c54e03a5c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; import com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; @@ -12,7 +13,6 @@ import com.azure.resourcemanager.loganalytics.models.ResultStatistics; import com.azure.resourcemanager.loganalytics.models.Schema; import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.Table; import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; @@ -33,7 +33,7 @@ public String type() { return this.innerModel().type(); } - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java index 1762c5ef174c..9206cb6e51a1 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 @@ -29,8 +29,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.TablesClient; @@ -69,7 +71,7 @@ public final class TablesClientImpl implements TablesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientTables") public interface TablesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables") @@ -80,6 +82,15 @@ Mono> listByWorkspace(@HostParam("$host") String endp @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200, 202 }) @@ -91,6 +102,17 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") TableInner parameters, @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, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@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" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200, 202 }) @@ -102,6 +124,17 @@ Mono>> update(@HostParam("$host") String endpoint, @BodyParam("application/json") TableInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@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/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200 }) @@ -112,6 +145,16 @@ Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@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, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200, 202, 204 }) @@ -122,6 +165,16 @@ Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@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, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate") @ExpectedResponses({ 200 }) @@ -132,6 +185,16 @@ Mono> migrate(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response migrateSync(@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, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/cancelSearch") @ExpectedResponses({ 200 }) @@ -141,6 +204,16 @@ Mono> cancelSearch(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/cancelSearch") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cancelSearchSync(@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, + @HeaderParam("Accept") String accept, Context context); } /** @@ -172,11 +245,10 @@ private Mono> listByWorkspaceSinglePageAsync(String re if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -187,39 +259,14 @@ private Mono> listByWorkspaceSinglePageAsync(String re * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the tables for the specified Log Analytics workspace along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all the tables for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -230,11 +277,34 @@ private Mono> listByWorkspaceSinglePageAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the tables for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. + * @return all the tables for the specified Log Analytics workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -246,12 +316,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the tables for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. + * @return all the tables for the specified Log Analytics workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -267,7 +360,7 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -284,7 +377,7 @@ public PagedIterable listByWorkspace(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } /** @@ -325,11 +418,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, parameters, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -340,43 +432,45 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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 along with {@link Response} on successful completion of {@link Mono}. + * @return workspace data table definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters, Context context) { + private Response createOrUpdateWithResponse(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, Context.NONE); } /** @@ -386,18 +480,46 @@ private Mono>> createOrUpdateWithResponseAsync(String * @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 the {@link PollerFlux} for polling of workspace data table definition. + * @return workspace data table definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TableInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String tableName, TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context); } /** @@ -407,7 +529,6 @@ private PollerFlux, TableInner> beginCreateOrUpdateAsync( * @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. @@ -415,12 +536,11 @@ private PollerFlux, TableInner> beginCreateOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TableInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters, Context context) { - context = this.client.mergeContext(context); + String workspaceName, String tableName, TableInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, context); + TableInner.class, this.client.getContext()); } /** @@ -438,7 +558,10 @@ private PollerFlux, TableInner> beginCreateOrUpdateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, tableName, parameters); + return this.client.getLroResult(response, TableInner.class, TableInner.class, + Context.NONE); } /** @@ -457,8 +580,9 @@ public SyncPoller, TableInner> beginCreateOrUpdate(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, tableName, parameters, context); + return this.client.getLroResult(response, TableInner.class, TableInner.class, context); } /** @@ -480,26 +604,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, String wo .flatMap(this.client::getLroFinalResultOrError); } - /** - * Update or Create 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 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String tableName, - TableInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Update or Create a Log Analytics workspace table. * @@ -515,7 +619,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String wo @ServiceMethod(returns = ReturnType.SINGLE) public TableInner createOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return createOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, tableName, parameters).getFinalResult(); } /** @@ -534,7 +638,7 @@ public TableInner createOrUpdate(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public TableInner createOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, tableName, parameters, context).getFinalResult(); } /** @@ -575,11 +679,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, parameters, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -590,43 +693,45 @@ private Mono>> updateWithResponseAsync(String resource * @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 along with {@link Response} on successful completion of {@link Mono}. + * @return workspace data table definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, TableInner parameters, Context context) { + private Response updateWithResponse(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, Context.NONE); } /** @@ -636,18 +741,46 @@ private Mono>> updateWithResponseAsync(String resource * @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 the {@link PollerFlux} for polling of workspace data table definition. + * @return workspace data table definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TableInner> beginUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String workspaceName, String tableName, + TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context); } /** @@ -657,7 +790,6 @@ private PollerFlux, TableInner> beginUpdateAsync(String r * @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. @@ -665,12 +797,11 @@ private PollerFlux, TableInner> beginUpdateAsync(String r */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TableInner> beginUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters, Context context) { - context = this.client.mergeContext(context); + String workspaceName, String tableName, TableInner parameters) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters, context); + = updateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, context); + TableInner.class, this.client.getContext()); } /** @@ -688,7 +819,9 @@ private PollerFlux, TableInner> beginUpdateAsync(String r @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return this.beginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, workspaceName, tableName, parameters); + return this.client.getLroResult(response, TableInner.class, TableInner.class, + Context.NONE); } /** @@ -707,7 +840,9 @@ public SyncPoller, TableInner> beginUpdate(String resourc @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, workspaceName, tableName, parameters, context); + return this.client.getLroResult(response, TableInner.class, TableInner.class, context); } /** @@ -729,26 +864,6 @@ private Mono updateAsync(String resourceGroupName, String workspaceN .flatMap(this.client::getLroFinalResultOrError); } - /** - * Update 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 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String workspaceName, String tableName, - TableInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Update a Log Analytics workspace table. * @@ -763,7 +878,7 @@ private Mono updateAsync(String resourceGroupName, String workspaceN */ @ServiceMethod(returns = ReturnType.SINGLE) public TableInner update(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return updateAsync(resourceGroupName, workspaceName, tableName, parameters).block(); + return beginUpdate(resourceGroupName, workspaceName, tableName, parameters).getFinalResult(); } /** @@ -782,7 +897,7 @@ public TableInner update(String resourceGroupName, String workspaceName, String @ServiceMethod(returns = ReturnType.SINGLE) public TableInner update(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return updateAsync(resourceGroupName, workspaceName, tableName, parameters, context).block(); + return beginUpdate(resourceGroupName, workspaceName, tableName, parameters, context).getFinalResult(); } /** @@ -817,54 +932,13 @@ private Mono> getWithResponseAsync(String resourceGroupName if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Log Analytics workspace table along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, 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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - apiVersion, tableName, accept, context); - } - /** * Gets a Log Analytics workspace table. * @@ -897,7 +971,31 @@ private Mono getAsync(String resourceGroupName, String workspaceName @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, tableName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -948,11 +1046,10 @@ private Mono>> deleteWithResponseAsync(String resource if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -962,38 +1059,38 @@ private Mono>> deleteWithResponseAsync(String resource * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, String tableName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, Context.NONE); } /** @@ -1002,17 +1099,40 @@ private Mono>> deleteWithResponseAsync(String resource * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, - String tableName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, tableName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, String tableName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1021,7 +1141,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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 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. @@ -1029,12 +1148,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, - String tableName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, tableName, context); + String tableName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, tableName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1051,7 +1168,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String tableName) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, tableName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, tableName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1069,7 +1187,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String tableName, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, tableName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, tableName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1089,24 +1208,6 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String tableName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, tableName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a Log Analytics workspace table. * @@ -1119,7 +1220,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, String tableName) { - deleteAsync(resourceGroupName, workspaceName, tableName).block(); + beginDelete(resourceGroupName, workspaceName, tableName).getFinalResult(); } /** @@ -1135,7 +1236,7 @@ public void delete(String resourceGroupName, String workspaceName, String tableN */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, String tableName, Context context) { - deleteAsync(resourceGroupName, workspaceName, tableName, context).block(); + beginDelete(resourceGroupName, workspaceName, tableName, context).getFinalResult(); } /** @@ -1171,55 +1272,13 @@ private Mono> migrateWithResponseAsync(String resourceGroupName, if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.migrate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of - * Data Collection Rule-based Custom Logs. - * - * @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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> migrateWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, 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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.migrate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); - } - /** * Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of * Data Collection Rule-based Custom Logs. @@ -1253,7 +1312,31 @@ private Mono migrateAsync(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public Response migrateWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context) { - return migrateWithResponseAsync(resourceGroupName, workspaceName, tableName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.migrateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1304,54 +1387,13 @@ private Mono> cancelSearchWithResponseAsync(String resourceGroupN if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.cancelSearch(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Cancel a log analytics workspace search results table query run. - * - * @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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelSearchWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, 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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancelSearch(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); - } - /** * Cancel a log analytics workspace search results table query run. * @@ -1384,7 +1426,31 @@ private Mono cancelSearchAsync(String resourceGroupName, String workspaceN @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelSearchWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context) { - return cancelSearchWithResponseAsync(resourceGroupName, workspaceName, tableName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.cancelSearchSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1401,4 +1467,6 @@ public Response cancelSearchWithResponse(String resourceGroupName, String public void cancelSearch(String resourceGroupName, String workspaceName, String tableName) { cancelSearchWithResponse(resourceGroupName, workspaceName, tableName, Context.NONE); } + + private static final ClientLogger LOGGER = new ClientLogger(TablesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java index 82068fd4360d..73b583fbb460 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 @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.UsagesClient; import com.azure.resourcemanager.loganalytics.fluent.models.UsageMetricInner; import com.azure.resourcemanager.loganalytics.models.WorkspaceListUsagesResult; @@ -59,7 +60,7 @@ public final class UsagesClientImpl implements UsagesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientUsages") public interface UsagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages") @@ -69,6 +70,15 @@ Mono> list(@HostParam("$host") String endpoi @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -99,11 +109,10 @@ private Mono> listSinglePageAsync(String resourc return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -114,39 +123,14 @@ private Mono> listSinglePageAsync(String resourc * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of usage metrics for a workspace along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of usage metrics for a workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -157,11 +141,33 @@ private Mono> listSinglePageAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of usage metrics for a workspace as paginated response with {@link PagedFlux}. + * @return a list of usage metrics for a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, + workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -173,11 +179,34 @@ private PagedFlux listAsync(String resourceGroupName, String w * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of usage metrics for a workspace as paginated response with {@link PagedFlux}. + * @return a list of usage metrics for a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, + workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -192,7 +221,7 @@ private PagedFlux listAsync(String resourceGroupName, String w */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName)); } /** @@ -208,6 +237,8 @@ public PagedIterable list(String resourceGroupName, String wor */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(UsagesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java index b2ea3cb7253e..e140e047d854 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.Workspace; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -55,7 +58,7 @@ public Identity identity() { return this.innerModel().identity(); } - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.innerModel().systemData(); } @@ -83,11 +86,11 @@ public WorkspaceCapping workspaceCapping() { return this.innerModel().workspaceCapping(); } - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerModel().createdDate(); } - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerModel().modifiedDate(); } @@ -120,6 +123,14 @@ public String defaultDataCollectionRuleResourceId() { return this.innerModel().defaultDataCollectionRuleResourceId(); } + public WorkspaceReplicationProperties replication() { + return this.innerModel().replication(); + } + + public WorkspaceFailoverProperties failover() { + return this.innerModel().failover(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -331,7 +342,27 @@ public WorkspaceImpl withDefaultDataCollectionRuleResourceId(String defaultDataC } } + public WorkspaceImpl withReplication(WorkspaceReplicationProperties replication) { + if (isInCreateMode()) { + this.innerModel().withReplication(replication); + return this; + } else { + this.updateParameters.withReplication(replication); + return this; + } + } + + public WorkspaceImpl withFailover(WorkspaceFailoverProperties failover) { + if (isInCreateMode()) { + this.innerModel().withFailover(failover); + return this; + } else { + this.updateParameters.withFailover(failover); + return this; + } + } + private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java index 9f03aae1ad81..5fc531cba2ee 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 @@ -23,6 +23,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.WorkspacePurgesClient; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspacePurgeResponseInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspacePurgeStatusResponseInner; @@ -60,7 +61,7 @@ public final class WorkspacePurgesClientImpl implements WorkspacePurgesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientWorkspacePurges") public interface WorkspacePurgesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge") @@ -72,6 +73,16 @@ Mono purge(@HostParam("$host") String endpoint, @BodyParam("application/json") WorkspacePurgeBody body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + WorkspacePurgesPurgeResponse purgeSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspacePurgeBody body, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}") @ExpectedResponses({ 200 }) @@ -80,6 +91,15 @@ Mono> getPurgeStatus(@HostParam("$ho @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, @PathParam("purgeId") String purgeId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getPurgeStatusSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, + @PathParam("purgeId") String purgeId, @HeaderParam("Accept") String accept, Context context); } /** @@ -124,64 +144,13 @@ private Mono purgeWithResponseAsync(String resourc } else { body.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.purge(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, body, accept, context)) + .withContext(context -> service.purge(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Purges data in an Log Analytics workspace by a set of user-defined filters. - * - * In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the - * execution of purge requests by sending a single command whose predicate includes all user identities that require - * purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge - * request to verify that the results are expected. - * Log Analytics only supports purge operations required for compliance with GDPR. The Log Analytics product team - * reserves the right to reject requests for purge operations that are not for the purpose of GDPR compliance. In - * the event of a dispute, please create a support ticket. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response containing operationId for a specific purge action on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono purgeWithResponseAsync(String resourceGroupName, String workspaceName, - WorkspacePurgeBody body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.purge(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), - workspaceName, body, accept, context); - } - /** * Purges data in an Log Analytics workspace by a set of user-defined filters. * @@ -231,7 +200,32 @@ private Mono purgeAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public WorkspacePurgesPurgeResponse purgeWithResponse(String resourceGroupName, String workspaceName, WorkspacePurgeBody body, Context context) { - return purgeWithResponseAsync(resourceGroupName, workspaceName, body, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.purgeSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), workspaceName, body, accept, context); } /** @@ -291,55 +285,13 @@ private Mono> getPurgeStatusWithResp if (purgeId == null) { return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, purgeId, accept, context)) + .withContext(context -> service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, purgeId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets status of an ongoing purge operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. - * @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 status of an ongoing purge operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPurgeStatusWithResponseAsync(String resourceGroupName, - String workspaceName, String purgeId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (purgeId == null) { - return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, purgeId, accept, context); - } - /** * Gets status of an ongoing purge operation. * @@ -373,7 +325,31 @@ private Mono getPurgeStatusAsync(String resou @ServiceMethod(returns = ReturnType.SINGLE) public Response getPurgeStatusWithResponse(String resourceGroupName, String workspaceName, String purgeId, Context context) { - return getPurgeStatusWithResponseAsync(resourceGroupName, workspaceName, purgeId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (purgeId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getPurgeStatusSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), workspaceName, purgeId, accept, context); } /** @@ -392,4 +368,6 @@ public WorkspacePurgeStatusResponseInner getPurgeStatus(String resourceGroupName String purgeId) { return getPurgeStatusWithResponse(resourceGroupName, workspaceName, purgeId, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspacePurgesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java index 271666c99ac4..81ff2fb97155 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -28,12 +29,16 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.WorkspacesClient; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationListResult; import com.azure.resourcemanager.loganalytics.models.WorkspaceListResult; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; import java.nio.ByteBuffer; @@ -70,7 +75,7 @@ public final class WorkspacesClientImpl implements WorkspacesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientWorkspaces") public interface WorkspacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces") @@ -80,6 +85,14 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces") @ExpectedResponses({ 200 }) @@ -88,6 +101,14 @@ Mono> listByResourceGroup(@HostParam("$host") Stri @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200, 201, 202 }) @@ -98,6 +119,16 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") WorkspaceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") WorkspaceInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200, 202, 204 }) @@ -107,6 +138,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @@ -116,6 +156,15 @@ Mono> getByResourceGroup(@HostParam("$host") String end @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @@ -125,6 +174,128 @@ Mono> update(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") WorkspacePatch parameters, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") WorkspacePatch parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/locations/{location}/workspaces/{workspaceName}/failover") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failover(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/locations/{location}/workspaces/{workspaceName}/failover") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failoverSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/failback") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failback(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/failback") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failbackSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNsp(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNspSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNsp(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getNspSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reconcileNsp(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response reconcileNspSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNspNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNspNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -145,11 +316,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -158,29 +328,13 @@ private Mono> listSinglePageAsync() { /** * Gets the workspaces in a subscription. * - * @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 workspaces in a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the workspaces in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); } /** @@ -188,11 +342,25 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workspaces in a subscription as paginated response with {@link PagedFlux}. + * @return the workspaces in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -202,11 +370,25 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workspaces in a subscription as paginated response with {@link PagedFlux}. + * @return the workspaces in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -218,7 +400,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage()); } /** @@ -232,7 +414,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context)); } /** @@ -258,11 +440,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -272,35 +453,14 @@ private Mono> listByResourceGroupSinglePageAsync(S * Gets workspaces in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaces in a resource group along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return workspaces in a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); } /** @@ -310,11 +470,29 @@ private Mono> listByResourceGroupSinglePageAsync(S * @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 workspaces in a resource group as paginated response with {@link PagedFlux}. + * @return workspaces in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -325,11 +503,29 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * @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 workspaces in a resource group as paginated response with {@link PagedFlux}. + * @return workspaces in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -343,7 +539,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName)); } /** @@ -358,7 +554,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context)); } /** @@ -396,11 +592,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -410,41 +605,41 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the top level Workspace resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Workspace resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, WorkspaceInner parameters, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); } /** @@ -453,18 +648,42 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the top level Workspace resource container. + * @return the top level Workspace resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, WorkspaceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WorkspaceInner.class, WorkspaceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -473,7 +692,6 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -481,12 +699,11 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, WorkspaceInner parameters, Context context) { - context = this.client.mergeContext(context); + String workspaceName, WorkspaceInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WorkspaceInner.class, WorkspaceInner.class, context); + WorkspaceInner.class, WorkspaceInner.class, this.client.getContext()); } /** @@ -503,7 +720,9 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, workspaceName, parameters); + return this.client.getLroResult(response, WorkspaceInner.class, + WorkspaceInner.class, Context.NONE); } /** @@ -521,7 +740,10 @@ public SyncPoller, WorkspaceInner> beginCreateOrUpdat @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, parameters, context); + return this.client.getLroResult(response, WorkspaceInner.class, + WorkspaceInner.class, context); } /** @@ -548,17 +770,14 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the top level Workspace resource container on successful completion of {@link Mono}. + * @return the top level Workspace resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - WorkspaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, parameters).getFinalResult(); } /** @@ -567,32 +786,55 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the top level Workspace resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return createOrUpdateAsync(resourceGroupName, workspaceName, parameters).block(); + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, + Context context) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, parameters, context).getFinalResult(); } /** - * Create or update a workspace. + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same + * subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. + * To remove the workspace completely and release the name, use the force flag. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param parameters The parameters required to create or update a workspace. - * @param context The context to associate with this operation. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag + * cannot be recovered. * @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 Workspace resource container. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -607,32 +849,31 @@ public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - Boolean force) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), force, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, Context.NONE); } /** @@ -648,31 +889,32 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - Boolean force, Context context) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, Boolean force, + Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), force, accept, context); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, context); } /** @@ -726,20 +968,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param workspaceName The name of the workspace. * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag * cannot be recovered. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, - Boolean force, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, force, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + Boolean force) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, force); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -757,7 +995,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { final Boolean force = null; - return this.beginDeleteAsync(resourceGroupName, workspaceName, force).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, force); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -778,7 +1017,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Boolean force, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, force, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, force, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -820,27 +1060,6 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName) { .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same - * subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. - * To remove the workspace completely and release the name, use the force flag. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag - * cannot be recovered. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, force, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same * subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. @@ -855,7 +1074,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, B @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName) { final Boolean force = null; - deleteAsync(resourceGroupName, workspaceName, force).block(); + beginDelete(resourceGroupName, workspaceName, force).getFinalResult(); } /** @@ -874,7 +1093,7 @@ public void delete(String resourceGroupName, String workspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, Boolean force, Context context) { - deleteAsync(resourceGroupName, workspaceName, force, context).block(); + beginDelete(resourceGroupName, workspaceName, force, context).getFinalResult(); } /** @@ -905,50 +1124,13 @@ private Mono> getByResourceGroupWithResponseAsync(Strin return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - workspaceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a workspace instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a workspace instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a workspace instance. * @@ -979,7 +1161,27 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -1032,14 +1234,31 @@ private Mono> updateWithResponseAsync(String resourceGr } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the top level Workspace resource container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String workspaceName, + WorkspacePatch parameters) { + return updateWithResponseAsync(resourceGroupName, workspaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + /** * Updates a workspace. * @@ -1050,37 +1269,38 @@ private Mono> updateWithResponseAsync(String resourceGr * @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 Workspace resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Workspace resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + public Response updateWithResponse(String resourceGroupName, String workspaceName, WorkspacePatch parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -1092,46 +1312,1118 @@ private Mono> updateWithResponseAsync(String resourceGr * @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 Workspace resource container on successful completion of {@link Mono}. + * @return the top level Workspace resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String workspaceName, - WorkspacePatch parameters) { - return updateWithResponseAsync(resourceGroupName, workspaceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { + return updateWithResponse(resourceGroupName, workspaceName, parameters, Context.NONE).getValue(); } /** - * Updates a workspace. + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. * @param workspaceName The name of the workspace. - * @param parameters The parameters required to patch a workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the top level Workspace resource container along with {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String workspaceName, - WorkspacePatch parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, workspaceName, parameters, context).block(); + private Mono>> failoverWithResponseAsync(String resourceGroupName, String location, + String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, workspaceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a workspace. + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. * @param workspaceName The name of the workspace. - * @param parameters The parameters required to patch a workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the top level Workspace resource container. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { - return updateWithResponse(resourceGroupName, workspaceName, parameters, Context.NONE).getValue(); + private Response failoverWithResponse(String resourceGroupName, String location, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + location, workspaceName, this.client.getApiVersion(), accept, Context.NONE); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverWithResponse(String resourceGroupName, String location, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + location, workspaceName, this.client.getApiVersion(), accept, context); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String location, + String workspaceName) { + Mono>> mono = failoverWithResponseAsync(resourceGroupName, location, workspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover(String resourceGroupName, String location, + String workspaceName) { + Response response = failoverWithResponse(resourceGroupName, location, workspaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover(String resourceGroupName, String location, + String workspaceName, Context context) { + Response response = failoverWithResponse(resourceGroupName, location, workspaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String location, String workspaceName) { + return beginFailoverAsync(resourceGroupName, location, workspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failover(String resourceGroupName, String location, String workspaceName) { + beginFailover(resourceGroupName, location, workspaceName).getFinalResult(); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failover(String resourceGroupName, String location, String workspaceName, Context context) { + beginFailover(resourceGroupName, location, workspaceName, context).getFinalResult(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failbackWithResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failback(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failbackWithResponse(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failbackSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failbackWithResponse(String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failbackSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailbackAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = failbackWithResponseAsync(resourceGroupName, workspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName) { + Response response = failbackWithResponse(resourceGroupName, workspaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailback(String resourceGroupName, String workspaceName, + Context context) { + Response response = failbackWithResponse(resourceGroupName, workspaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failbackAsync(String resourceGroupName, String workspaceName) { + return beginFailbackAsync(resourceGroupName, workspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failback(String resourceGroupName, String workspaceName) { + beginFailback(resourceGroupName, workspaceName).getFinalResult(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failback(String resourceGroupName, String workspaceName, Context context) { + beginFailback(resourceGroupName, workspaceName, context).getFinalResult(); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNspSinglePageAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNsp(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listNspAsync(String resourceGroupName, + String workspaceName) { + return new PagedFlux<>(() -> listNspSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNspNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspSinglePage(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspSinglePage(String resourceGroupName, + String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNsp(String resourceGroupName, + String workspaceName) { + return new PagedIterable<>(() -> listNspSinglePage(resourceGroupName, workspaceName), + nextLink -> listNspNextSinglePage(nextLink)); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNsp(String resourceGroupName, + String workspaceName, Context context) { + return new PagedIterable<>(() -> listNspSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNspNextSinglePage(nextLink, context)); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network security perimeter configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNspWithResponseAsync(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getNsp(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network security perimeter configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNspAsync(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + return getNspWithResponseAsync(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network security perimeter configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNspWithResponse(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network security perimeter configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityPerimeterConfigurationInner getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + return getNspWithResponse(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, + Context.NONE).getValue(); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reconcileNspWithResponseAsync(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reconcileNsp(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response reconcileNspWithResponse(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.reconcileNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, Context.NONE); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response reconcileNspWithResponse(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.reconcileNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReconcileNspAsync(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + Mono>> mono = reconcileNspWithResponseAsync(resourceGroupName, workspaceName, + networkSecurityPerimeterConfigurationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + Response response + = reconcileNspWithResponse(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + Response response = reconcileNspWithResponse(resourceGroupName, workspaceName, + networkSecurityPerimeterConfigurationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reconcileNspAsync(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + return beginReconcileNspAsync(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + beginReconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName).getFinalResult(); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + beginReconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, context) + .getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNspNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNspNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspNextSinglePage(String nextLink, + Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspacesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java index 4a7afc2cce12..7bc2e96fe454 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java @@ -10,7 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.WorkspacesClient; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; import com.azure.resourcemanager.loganalytics.models.Workspace; import com.azure.resourcemanager.loganalytics.models.Workspaces; @@ -76,6 +78,72 @@ public Workspace getByResourceGroup(String resourceGroupName, String workspaceNa } } + public void failover(String resourceGroupName, String location, String workspaceName) { + this.serviceClient().failover(resourceGroupName, location, workspaceName); + } + + public void failover(String resourceGroupName, String location, String workspaceName, Context context) { + this.serviceClient().failover(resourceGroupName, location, workspaceName, context); + } + + public void failback(String resourceGroupName, String workspaceName) { + this.serviceClient().failback(resourceGroupName, workspaceName); + } + + public void failback(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().failback(resourceGroupName, workspaceName, context); + } + + public PagedIterable listNsp(String resourceGroupName, + String workspaceName) { + PagedIterable inner + = this.serviceClient().listNsp(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listNsp(String resourceGroupName, String workspaceName, + Context context) { + PagedIterable inner + = this.serviceClient().listNsp(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + + public Response getNspWithResponse(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName, Context context) { + Response inner = this.serviceClient() + .getNspWithResponse(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkSecurityPerimeterConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkSecurityPerimeterConfiguration getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + NetworkSecurityPerimeterConfigurationInner inner + = this.serviceClient().getNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName); + if (inner != null) { + return new NetworkSecurityPerimeterConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + this.serviceClient().reconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName); + } + + public void reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + this.serviceClient() + .reconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, context); + } + public Workspace getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRule.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRule.java new file mode 100644 index 000000000000..0df999e62be1 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRule.java @@ -0,0 +1,124 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Access rule in a network security perimeter configuration profile. + */ +@Fluent +public final class AccessRule implements JsonSerializable { + /* + * Name of the access rule + */ + private String name; + + /* + * Properties of Access Rule + */ + private AccessRuleProperties properties; + + /** + * Creates an instance of AccessRule class. + */ + public AccessRule() { + } + + /** + * Get the name property: Name of the access rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the access rule. + * + * @param name the name value to set. + * @return the AccessRule object itself. + */ + public AccessRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of Access Rule. + * + * @return the properties value. + */ + public AccessRuleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Access Rule. + * + * @param properties the properties value to set. + * @return the AccessRule object itself. + */ + public AccessRule withProperties(AccessRuleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AccessRule. + */ + public static AccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRule deserializedAccessRule = new AccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAccessRule.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAccessRule.properties = AccessRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRule; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleDirection.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleDirection.java new file mode 100644 index 000000000000..2989aa7e7b6c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Direction of Access Rule. + */ +public final class AccessRuleDirection extends ExpandableStringEnum { + /** + * Static value Inbound for AccessRuleDirection. + */ + public static final AccessRuleDirection INBOUND = fromString("Inbound"); + + /** + * Static value Outbound for AccessRuleDirection. + */ + public static final AccessRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates a new instance of AccessRuleDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessRuleDirection() { + } + + /** + * Creates or finds a AccessRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessRuleDirection. + */ + public static AccessRuleDirection fromString(String name) { + return fromString(name, AccessRuleDirection.class); + } + + /** + * Gets known AccessRuleDirection values. + * + * @return known AccessRuleDirection values. + */ + public static Collection values() { + return values(AccessRuleDirection.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleProperties.java new file mode 100644 index 000000000000..3b7fcbcb3551 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleProperties.java @@ -0,0 +1,281 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Access Rule. + */ +@Fluent +public final class AccessRuleProperties implements JsonSerializable { + /* + * Direction of Access Rule + */ + private AccessRuleDirection direction; + + /* + * Address prefixes in the CIDR format for inbound rules + */ + private List addressPrefixes; + + /* + * Subscriptions for inbound rules + */ + private List subscriptions; + + /* + * Network security perimeters for inbound rules + */ + private List networkSecurityPerimeters; + + /* + * Fully qualified domain names (FQDN) for outbound rules + */ + private List fullyQualifiedDomainNames; + + /* + * Email addresses for outbound rules + */ + private List emailAddresses; + + /* + * Phone numbers for outbound rules + */ + private List phoneNumbers; + + /** + * Creates an instance of AccessRuleProperties class. + */ + public AccessRuleProperties() { + } + + /** + * Get the direction property: Direction of Access Rule. + * + * @return the direction value. + */ + public AccessRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Direction of Access Rule. + * + * @param direction the direction value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withDirection(AccessRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the subscriptions property: Subscriptions for inbound rules. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: Subscriptions for inbound rules. + * + * @param subscriptions the subscriptions value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Get the networkSecurityPerimeters property: Network security perimeters for inbound rules. + * + * @return the networkSecurityPerimeters value. + */ + public List networkSecurityPerimeters() { + return this.networkSecurityPerimeters; + } + + /** + * Set the networkSecurityPerimeters property: Network security perimeters for inbound rules. + * + * @param networkSecurityPerimeters the networkSecurityPerimeters value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties + withNetworkSecurityPerimeters(List networkSecurityPerimeters) { + this.networkSecurityPerimeters = networkSecurityPerimeters; + return this; + } + + /** + * Get the fullyQualifiedDomainNames property: Fully qualified domain names (FQDN) for outbound rules. + * + * @return the fullyQualifiedDomainNames value. + */ + public List fullyQualifiedDomainNames() { + return this.fullyQualifiedDomainNames; + } + + /** + * Set the fullyQualifiedDomainNames property: Fully qualified domain names (FQDN) for outbound rules. + * + * @param fullyQualifiedDomainNames the fullyQualifiedDomainNames value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withFullyQualifiedDomainNames(List fullyQualifiedDomainNames) { + this.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + return this; + } + + /** + * Get the emailAddresses property: Email addresses for outbound rules. + * + * @return the emailAddresses value. + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Set the emailAddresses property: Email addresses for outbound rules. + * + * @param emailAddresses the emailAddresses value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withEmailAddresses(List emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + /** + * Get the phoneNumbers property: Phone numbers for outbound rules. + * + * @return the phoneNumbers value. + */ + public List phoneNumbers() { + return this.phoneNumbers; + } + + /** + * Set the phoneNumbers property: Phone numbers for outbound rules. + * + * @param phoneNumbers the phoneNumbers value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withPhoneNumbers(List phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptions() != null) { + subscriptions().forEach(e -> e.validate()); + } + if (networkSecurityPerimeters() != null) { + networkSecurityPerimeters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("networkSecurityPerimeters", this.networkSecurityPerimeters, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("fullyQualifiedDomainNames", this.fullyQualifiedDomainNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("emailAddresses", this.emailAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("phoneNumbers", this.phoneNumbers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRuleProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRuleProperties. + */ + public static AccessRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRuleProperties deserializedAccessRuleProperties = new AccessRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedAccessRuleProperties.direction = AccessRuleDirection.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.addressPrefixes = addressPrefixes; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> AccessRulePropertiesSubscriptionsItem.fromJson(reader1)); + deserializedAccessRuleProperties.subscriptions = subscriptions; + } else if ("networkSecurityPerimeters".equals(fieldName)) { + List networkSecurityPerimeters + = reader.readArray(reader1 -> NetworkSecurityPerimeter.fromJson(reader1)); + deserializedAccessRuleProperties.networkSecurityPerimeters = networkSecurityPerimeters; + } else if ("fullyQualifiedDomainNames".equals(fieldName)) { + List fullyQualifiedDomainNames = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + } else if ("emailAddresses".equals(fieldName)) { + List emailAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.emailAddresses = emailAddresses; + } else if ("phoneNumbers".equals(fieldName)) { + List phoneNumbers = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.phoneNumbers = phoneNumbers; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRuleProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRulePropertiesSubscriptionsItem.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRulePropertiesSubscriptionsItem.java new file mode 100644 index 000000000000..162f403f2da9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRulePropertiesSubscriptionsItem.java @@ -0,0 +1,98 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Subscription identifiers. + */ +@Fluent +public final class AccessRulePropertiesSubscriptionsItem + implements JsonSerializable { + /* + * The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000') + */ + private String id; + + /** + * Creates an instance of AccessRulePropertiesSubscriptionsItem class. + */ + public AccessRulePropertiesSubscriptionsItem() { + } + + /** + * Get the id property: The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000'). + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000'). + * + * @param id the id value to set. + * @return the AccessRulePropertiesSubscriptionsItem object itself. + */ + public AccessRulePropertiesSubscriptionsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRulePropertiesSubscriptionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRulePropertiesSubscriptionsItem if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRulePropertiesSubscriptionsItem. + */ + public static AccessRulePropertiesSubscriptionsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRulePropertiesSubscriptionsItem deserializedAccessRulePropertiesSubscriptionsItem + = new AccessRulePropertiesSubscriptionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccessRulePropertiesSubscriptionsItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRulePropertiesSubscriptionsItem; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java index 5c61dfa853b2..7d47aa8f7013 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.UUID; /** * The list of Log Analytics workspaces associated with the cluster. @@ -19,7 +22,7 @@ public final class AssociatedWorkspace implements JsonSerializable UUID.fromString(nonNullReader.getString())); } else if ("workspaceName".equals(fieldName)) { deserializedAssociatedWorkspace.workspaceName = reader.getString(); } else if ("resourceId".equals(fieldName)) { deserializedAssociatedWorkspace.resourceId = reader.getString(); } else if ("associateDate".equals(fieldName)) { - deserializedAssociatedWorkspace.associateDate = reader.getString(); + deserializedAssociatedWorkspace.associateDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java deleted file mode 100644 index bc42393369e7..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * An Azure resource QueryPack-Query object. - */ -@Immutable -public class AzureResourceProperties implements JsonSerializable { - /* - * Azure resource Id - */ - private String id; - - /* - * Azure resource name - */ - private String name; - - /* - * Azure resource type - */ - private String type; - - /* - * Read only system data - */ - private SystemData systemData; - - /** - * Creates an instance of AzureResourceProperties class. - */ - public AzureResourceProperties() { - } - - /** - * Get the id property: Azure resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Azure resource Id. - * - * @param id the id value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Azure resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Azure resource name. - * - * @param name the name value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Azure resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Azure resource type. - * - * @param type the type value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the systemData property: Read only system data. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Read only system data. - * - * @param systemData the systemData value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the AzureResourceProperties. - */ - public static AzureResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceProperties deserializedAzureResourceProperties = new AzureResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureResourceProperties.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureResourceProperties.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureResourceProperties.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureResourceProperties.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceProperties; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java deleted file mode 100644 index e163765d4c0a..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java +++ /dev/null @@ -1,99 +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; - -/** - * The capacity reservation level in Gigabytes for this cluster. - */ -public enum Capacity { - /** - * Enum value 100. - */ - ONE_ZERO_ZERO(100L), - - /** - * Enum value 200. - */ - TWO_ZERO_ZERO(200L), - - /** - * Enum value 300. - */ - THREE_ZERO_ZERO(300L), - - /** - * Enum value 400. - */ - FOUR_ZERO_ZERO(400L), - - /** - * 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), - - /** - * Enum value 10000. - */ - ONE_ZERO_ZERO_ZERO_ZERO(10000L), - - /** - * Enum value 25000. - */ - TWO_FIVE_ZERO_ZERO_ZERO(25000L), - - /** - * Enum value 50000. - */ - FIVE_ZERO_ZERO_ZERO_ZERO(50000L); - - /** - * 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. - */ - 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. - */ - 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 deleted file mode 100644 index ceb411fc31f0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -/** - * The capacity reservation level in GB for this workspace, when CapacityReservation sku is selected. - */ -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. - */ - 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. - */ - 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 index 6d8bff2edc0b..8d05f51f98c5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java @@ -5,11 +5,13 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; /** * The Capacity Reservation properties. @@ -19,7 +21,7 @@ public final class CapacityReservationProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("minCapacity".equals(fieldName)) { deserializedCapacityReservationProperties.minCapacity = reader.getNullable(JsonReader::getLong); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java index acc232dd92e1..d02109357d71 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java @@ -7,6 +7,7 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.ClusterInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -113,14 +114,14 @@ public interface Cluster { * * @return the lastModifiedDate value. */ - String lastModifiedDate(); + OffsetDateTime lastModifiedDate(); /** * Gets the createdDate property: The cluster creation time. * * @return the createdDate value. */ - String createdDate(); + OffsetDateTime createdDate(); /** * Gets the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. @@ -136,6 +137,13 @@ public interface Cluster { */ CapacityReservationProperties capacityReservationProperties(); + /** + * Gets the replication property: Cluster's replication properties. + * + * @return the replication value. + */ + ClusterReplicationProperties replication(); + /** * Gets the region of the resource. * @@ -222,7 +230,8 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithIsDoubleEncryptionEnabled, DefinitionStages.WithIsAvailabilityZonesEnabled, DefinitionStages.WithBillingType, DefinitionStages.WithKeyVaultProperties, - DefinitionStages.WithAssociatedWorkspaces, DefinitionStages.WithCapacityReservationProperties { + DefinitionStages.WithAssociatedWorkspaces, DefinitionStages.WithCapacityReservationProperties, + DefinitionStages.WithReplication { /** * Executes the create request. * @@ -363,6 +372,19 @@ interface WithCapacityReservationProperties { */ WithCreate withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties); } + + /** + * The stage of the Cluster definition allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: Cluster's replication properties.. + * + * @param replication Cluster's replication properties. + * @return the next definition stage. + */ + WithCreate withReplication(ClusterReplicationProperties replication); + } } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java new file mode 100644 index 000000000000..af1e66a31e6f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Cluster replication properties. + */ +@Fluent +public final class ClusterReplicationProperties implements JsonSerializable { + /* + * The secondary location of the replication. If replication is being enabled, enabled must be provided. + */ + private String location; + + /* + * Specifies whether the replication is enabled or not. When true the cluster is replicate to the specified + * location. + */ + private Boolean enabled; + + /* + * Should enable AvailabilityZones for the given replicated cluster + */ + private Boolean isAvailabilityZonesEnabled; + + /* + * The provisioning state of the cluster replication. + */ + private ClusterReplicationState provisioningState; + + /* + * The cluster's replication creation time + */ + private OffsetDateTime createdDate; + + /* + * The last time the cluster's replication was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of ClusterReplicationProperties class. + */ + public ClusterReplicationProperties() { + } + + /** + * Get the location property: The secondary location of the replication. If replication is being enabled, enabled + * must be provided. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The secondary location of the replication. If replication is being enabled, enabled + * must be provided. + * + * @param location the location value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the enabled property: Specifies whether the replication is enabled or not. When true the cluster is replicate + * to the specified location. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the replication is enabled or not. When true the cluster is replicate + * to the specified location. + * + * @param enabled the enabled value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the isAvailabilityZonesEnabled property: Should enable AvailabilityZones for the given replicated cluster. + * + * @return the isAvailabilityZonesEnabled value. + */ + public Boolean isAvailabilityZonesEnabled() { + return this.isAvailabilityZonesEnabled; + } + + /** + * Set the isAvailabilityZonesEnabled property: Should enable AvailabilityZones for the given replicated cluster. + * + * @param isAvailabilityZonesEnabled the isAvailabilityZonesEnabled value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + this.isAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster replication. + * + * @return the provisioningState value. + */ + public ClusterReplicationState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdDate property: The cluster's replication creation time. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the lastModifiedDate property: The last time the cluster's replication was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeBooleanField("isAvailabilityZonesEnabled", this.isAvailabilityZonesEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterReplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterReplicationProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterReplicationProperties. + */ + public static ClusterReplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterReplicationProperties deserializedClusterReplicationProperties = new ClusterReplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedClusterReplicationProperties.location = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedClusterReplicationProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("isAvailabilityZonesEnabled".equals(fieldName)) { + deserializedClusterReplicationProperties.isAvailabilityZonesEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterReplicationProperties.provisioningState + = ClusterReplicationState.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + deserializedClusterReplicationProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedClusterReplicationProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterReplicationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java new file mode 100644 index 000000000000..0e275a7398cc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the cluster replication. + */ +public final class ClusterReplicationState extends ExpandableStringEnum { + /** + * Static value Succeeded for ClusterReplicationState. + */ + public static final ClusterReplicationState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value EnableRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState ENABLE_REQUESTED = fromString("EnableRequested"); + + /** + * Static value Enabling for ClusterReplicationState. + */ + public static final ClusterReplicationState ENABLING = fromString("Enabling"); + + /** + * Static value DisableRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState DISABLE_REQUESTED = fromString("DisableRequested"); + + /** + * Static value Disabling for ClusterReplicationState. + */ + public static final ClusterReplicationState DISABLING = fromString("Disabling"); + + /** + * Static value RollbackRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState ROLLBACK_REQUESTED = fromString("RollbackRequested"); + + /** + * Static value RollingBack for ClusterReplicationState. + */ + public static final ClusterReplicationState ROLLING_BACK = fromString("RollingBack"); + + /** + * Static value Failed for ClusterReplicationState. + */ + public static final ClusterReplicationState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ClusterReplicationState. + */ + public static final ClusterReplicationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ClusterReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterReplicationState() { + } + + /** + * Creates or finds a ClusterReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterReplicationState. + */ + public static ClusterReplicationState fromString(String name) { + return fromString(name, ClusterReplicationState.class); + } + + /** + * Gets known ClusterReplicationState values. + * + * @return known ClusterReplicationState values. + */ + public static Collection values() { + return values(ClusterReplicationState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java index e9a032eba3f6..960dc8903e61 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 @@ -19,7 +19,7 @@ public final class ClusterSku implements JsonSerializable { /* * The capacity reservation level in Gigabytes for this cluster. */ - private Capacity capacity; + private Long capacity; /* * The SKU (tier) of a cluster. @@ -37,7 +37,7 @@ public ClusterSku() { * * @return the capacity value. */ - public Capacity capacity() { + public Long capacity() { return this.capacity; } @@ -47,7 +47,7 @@ public Capacity capacity() { * @param capacity the capacity value to set. * @return the ClusterSku object itself. */ - public ClusterSku withCapacity(Capacity capacity) { + public ClusterSku withCapacity(Long capacity) { this.capacity = capacity; return this; } @@ -86,7 +86,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("capacity", this.capacity == null ? null : this.capacity.toLong()); + jsonWriter.writeNumberField("capacity", this.capacity); jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); return jsonWriter.writeEndObject(); } @@ -107,7 +107,7 @@ public static ClusterSku fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("capacity".equals(fieldName)) { - deserializedClusterSku.capacity = Capacity.fromLong(reader.getLong()); + deserializedClusterSku.capacity = reader.getNullable(JsonReader::getLong); } else if ("name".equals(fieldName)) { deserializedClusterSku.name = ClusterSkuNameEnum.fromString(reader.getString()); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java deleted file mode 100644 index 3097d8e5c784..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of identity that created the resource. - */ -public final class CreatedByType extends ExpandableStringEnum { - /** - * Static value User for CreatedByType. - */ - public static final CreatedByType USER = fromString("User"); - - /** - * Static value Application for CreatedByType. - */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** - * Static value ManagedIdentity for CreatedByType. - */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** - * Static value Key for CreatedByType. - */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates a new instance of CreatedByType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CreatedByType() { - } - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** - * Gets known CreatedByType values. - * - * @return known CreatedByType values. - */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java index c9267e6a3315..b1e162d20f3d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java @@ -4,73 +4,58 @@ package com.azure.resourcemanager.loganalytics.models; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - /** - * The type of identity that creates/modifies resources. + * Type of managed service identity. */ -public final class IdentityType extends ExpandableStringEnum { - /** - * Static value user for IdentityType. - */ - public static final IdentityType USER = fromString("user"); - +public enum IdentityType { /** - * Static value application for IdentityType. + * Enum value SystemAssigned. */ - public static final IdentityType APPLICATION = fromString("application"); + SYSTEM_ASSIGNED("SystemAssigned"), /** - * Static value managedIdentity for IdentityType. + * Enum value UserAssigned. */ - public static final IdentityType MANAGED_IDENTITY = fromString("managedIdentity"); + USER_ASSIGNED("UserAssigned"), /** - * Static value key for IdentityType. + * Enum value None. */ - public static final IdentityType KEY = fromString("key"); + NONE("None"); /** - * Static value SystemAssigned for IdentityType. + * The actual serialized value for a IdentityType instance. */ - public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + private final String value; - /** - * Static value UserAssigned for IdentityType. - */ - public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); - - /** - * Static value None for IdentityType. - */ - public static final IdentityType NONE = fromString("None"); - - /** - * Creates a new instance of IdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IdentityType() { + IdentityType(String value) { + this.value = value; } /** - * Creates or finds a IdentityType from its string representation. + * Parses a serialized value to a IdentityType instance. * - * @param name a name to look for. - * @return the corresponding IdentityType. - */ - public static IdentityType fromString(String name) { - return fromString(name, IdentityType.class); + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + public static IdentityType fromString(String value) { + if (value == null) { + return null; + } + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } /** - * Gets known IdentityType values. - * - * @return known IdentityType values. + * {@inheritDoc} */ - public static Collection values() { - return values(IdentityType.class); + @Override + public String toString() { + return this.value; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IssueType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IssueType.java new file mode 100644 index 000000000000..581221777587 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IssueType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of issue. + */ +public final class IssueType extends ExpandableStringEnum { + /** + * Static value Unknown for IssueType. + */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** + * Static value ConfigurationPropagationFailure for IssueType. + */ + public static final IssueType CONFIGURATION_PROPAGATION_FAILURE = fromString("ConfigurationPropagationFailure"); + + /** + * Static value MissingPerimeterConfiguration for IssueType. + */ + public static final IssueType MISSING_PERIMETER_CONFIGURATION = fromString("MissingPerimeterConfiguration"); + + /** + * Static value MissingIdentityConfiguration for IssueType. + */ + public static final IssueType MISSING_IDENTITY_CONFIGURATION = fromString("MissingIdentityConfiguration"); + + /** + * Creates a new instance of IssueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IssueType() { + } + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * Gets known IssueType values. + * + * @return known IssueType values. + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java index 25d15670f112..03d115294b06 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import java.time.OffsetDateTime; @@ -49,6 +50,13 @@ public interface LogAnalyticsQueryPack { */ Map tags(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the queryPackId property: The unique ID of your application. This field cannot be changed. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java index 58d3966e6302..c04f014bf2e5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java @@ -16,28 +16,28 @@ */ public interface LogAnalyticsQueryPackQuery { /** - * Gets the id property: Azure resource Id. + * Gets the id property: Fully qualified resource Id for the resource. * * @return the id value. */ String id(); /** - * Gets the name property: Azure resource name. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** - * Gets the type property: Azure resource type. + * Gets the type property: The type of the resource. * * @return the type value. */ String type(); /** - * Gets the systemData property: Read only system data. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeter.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeter.java new file mode 100644 index 000000000000..1d02c7faddf9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeter.java @@ -0,0 +1,152 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; +import java.util.UUID; + +/** + * Information about a network security perimeter (NSP). + */ +@Fluent +public final class NetworkSecurityPerimeter implements JsonSerializable { + /* + * Fully qualified Azure resource ID of the NSP resource + */ + private String id; + + /* + * Universal unique ID (UUID) of the network security perimeter + */ + private UUID perimeterGuid; + + /* + * Location of the network security perimeter + */ + private String location; + + /** + * Creates an instance of NetworkSecurityPerimeter class. + */ + public NetworkSecurityPerimeter() { + } + + /** + * Get the id property: Fully qualified Azure resource ID of the NSP resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified Azure resource ID of the NSP resource. + * + * @param id the id value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withId(String id) { + this.id = id; + return this; + } + + /** + * Get the perimeterGuid property: Universal unique ID (UUID) of the network security perimeter. + * + * @return the perimeterGuid value. + */ + public UUID perimeterGuid() { + return this.perimeterGuid; + } + + /** + * Set the perimeterGuid property: Universal unique ID (UUID) of the network security perimeter. + * + * @param perimeterGuid the perimeterGuid value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withPerimeterGuid(UUID perimeterGuid) { + this.perimeterGuid = perimeterGuid; + return this; + } + + /** + * Get the location property: Location of the network security perimeter. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of the network security perimeter. + * + * @param location the location value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("perimeterGuid", Objects.toString(this.perimeterGuid, null)); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeter if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeter. + */ + public static NetworkSecurityPerimeter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeter deserializedNetworkSecurityPerimeter = new NetworkSecurityPerimeter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.id = reader.getString(); + } else if ("perimeterGuid".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.perimeterGuid + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("location".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeter; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfiguration.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfiguration.java new file mode 100644 index 000000000000..b3f25088937a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfiguration.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; + +/** + * An immutable client-side representation of NetworkSecurityPerimeterConfiguration. + */ +public interface NetworkSecurityPerimeterConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Network security configuration properties. + * + * @return the properties value. + */ + NetworkSecurityPerimeterConfigurationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkSecurityPerimeterConfigurationInner innerModel(); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationListResult.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationListResult.java new file mode 100644 index 000000000000..613196535fd8 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of a list NSP (network security perimeter) configurations request. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationListResult + implements JsonSerializable { + /* + * Array of network security perimeter results. + */ + private List value; + + /* + * The link used to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationListResult class. + */ + public NetworkSecurityPerimeterConfigurationListResult() { + } + + /** + * Get the value property: Array of network security perimeter results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of network security perimeter results. + * + * @param value the value value to set. + * @return the NetworkSecurityPerimeterConfigurationListResult object itself. + */ + public NetworkSecurityPerimeterConfigurationListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link used to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkSecurityPerimeterConfigurationListResult object itself. + */ + public NetworkSecurityPerimeterConfigurationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeterConfigurationListResult. + */ + public static NetworkSecurityPerimeterConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationListResult deserializedNetworkSecurityPerimeterConfigurationListResult + = new NetworkSecurityPerimeterConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkSecurityPerimeterConfigurationInner.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationListResult; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProperties.java new file mode 100644 index 000000000000..65a18f9d8487 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProperties.java @@ -0,0 +1,205 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network security configuration properties. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationProperties + implements JsonSerializable { + /* + * Provisioning state of a network security perimeter configuration that is being created or updated. + */ + private NetworkSecurityPerimeterConfigurationProvisioningState provisioningState; + + /* + * List of provisioning issues, if any + */ + private List provisioningIssues; + + /* + * Information about a network security perimeter (NSP) + */ + private NetworkSecurityPerimeter networkSecurityPerimeter; + + /* + * Information about resource association + */ + private ResourceAssociation resourceAssociation; + + /* + * Network security perimeter configuration profile + */ + private NetworkSecurityProfile profile; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationProperties class. + */ + public NetworkSecurityPerimeterConfigurationProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of a network security perimeter configuration that is + * being created or updated. + * + * @return the provisioningState value. + */ + public NetworkSecurityPerimeterConfigurationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningIssues property: List of provisioning issues, if any. + * + * @return the provisioningIssues value. + */ + public List provisioningIssues() { + return this.provisioningIssues; + } + + /** + * Get the networkSecurityPerimeter property: Information about a network security perimeter (NSP). + * + * @return the networkSecurityPerimeter value. + */ + public NetworkSecurityPerimeter networkSecurityPerimeter() { + return this.networkSecurityPerimeter; + } + + /** + * Set the networkSecurityPerimeter property: Information about a network security perimeter (NSP). + * + * @param networkSecurityPerimeter the networkSecurityPerimeter value to set. + * @return the NetworkSecurityPerimeterConfigurationProperties object itself. + */ + public NetworkSecurityPerimeterConfigurationProperties + withNetworkSecurityPerimeter(NetworkSecurityPerimeter networkSecurityPerimeter) { + this.networkSecurityPerimeter = networkSecurityPerimeter; + return this; + } + + /** + * Get the resourceAssociation property: Information about resource association. + * + * @return the resourceAssociation value. + */ + public ResourceAssociation resourceAssociation() { + return this.resourceAssociation; + } + + /** + * Set the resourceAssociation property: Information about resource association. + * + * @param resourceAssociation the resourceAssociation value to set. + * @return the NetworkSecurityPerimeterConfigurationProperties object itself. + */ + public NetworkSecurityPerimeterConfigurationProperties + withResourceAssociation(ResourceAssociation resourceAssociation) { + this.resourceAssociation = resourceAssociation; + return this; + } + + /** + * Get the profile property: Network security perimeter configuration profile. + * + * @return the profile value. + */ + public NetworkSecurityProfile profile() { + return this.profile; + } + + /** + * Set the profile property: Network security perimeter configuration profile. + * + * @param profile the profile value to set. + * @return the NetworkSecurityPerimeterConfigurationProperties object itself. + */ + public NetworkSecurityPerimeterConfigurationProperties withProfile(NetworkSecurityProfile profile) { + this.profile = profile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningIssues() != null) { + provisioningIssues().forEach(e -> e.validate()); + } + if (networkSecurityPerimeter() != null) { + networkSecurityPerimeter().validate(); + } + if (resourceAssociation() != null) { + resourceAssociation().validate(); + } + if (profile() != null) { + profile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkSecurityPerimeter", this.networkSecurityPerimeter); + jsonWriter.writeJsonField("resourceAssociation", this.resourceAssociation); + jsonWriter.writeJsonField("profile", this.profile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeterConfigurationProperties. + */ + public static NetworkSecurityPerimeterConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationProperties deserializedNetworkSecurityPerimeterConfigurationProperties + = new NetworkSecurityPerimeterConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningState + = NetworkSecurityPerimeterConfigurationProvisioningState.fromString(reader.getString()); + } else if ("provisioningIssues".equals(fieldName)) { + List provisioningIssues + = reader.readArray(reader1 -> ProvisioningIssue.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningIssues = provisioningIssues; + } else if ("networkSecurityPerimeter".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.networkSecurityPerimeter + = NetworkSecurityPerimeter.fromJson(reader); + } else if ("resourceAssociation".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.resourceAssociation + = ResourceAssociation.fromJson(reader); + } else if ("profile".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.profile + = NetworkSecurityProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProvisioningState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProvisioningState.java new file mode 100644 index 000000000000..14d7c837af16 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProvisioningState.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of a network security perimeter configuration that is being created or updated. + */ +public final class NetworkSecurityPerimeterConfigurationProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Accepted for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Failed for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of NetworkSecurityPerimeterConfigurationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkSecurityPerimeterConfigurationProvisioningState() { + } + + /** + * Creates or finds a NetworkSecurityPerimeterConfigurationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static NetworkSecurityPerimeterConfigurationProvisioningState fromString(String name) { + return fromString(name, NetworkSecurityPerimeterConfigurationProvisioningState.class); + } + + /** + * Gets known NetworkSecurityPerimeterConfigurationProvisioningState values. + * + * @return known NetworkSecurityPerimeterConfigurationProvisioningState values. + */ + public static Collection values() { + return values(NetworkSecurityPerimeterConfigurationProvisioningState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityProfile.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityProfile.java new file mode 100644 index 000000000000..1eb214465188 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityProfile.java @@ -0,0 +1,213 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network security perimeter configuration profile. + */ +@Fluent +public final class NetworkSecurityProfile implements JsonSerializable { + /* + * Name of the profile + */ + private String name; + + /* + * Current access rules version + */ + private Integer accessRulesVersion; + + /* + * List of Access Rules + */ + private List accessRules; + + /* + * Current diagnostic settings version + */ + private Integer diagnosticSettingsVersion; + + /* + * List of log categories that are enabled + */ + private List enabledLogCategories; + + /** + * Creates an instance of NetworkSecurityProfile class. + */ + public NetworkSecurityProfile() { + } + + /** + * Get the name property: Name of the profile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the profile. + * + * @param name the name value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessRulesVersion property: Current access rules version. + * + * @return the accessRulesVersion value. + */ + public Integer accessRulesVersion() { + return this.accessRulesVersion; + } + + /** + * Set the accessRulesVersion property: Current access rules version. + * + * @param accessRulesVersion the accessRulesVersion value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withAccessRulesVersion(Integer accessRulesVersion) { + this.accessRulesVersion = accessRulesVersion; + return this; + } + + /** + * Get the accessRules property: List of Access Rules. + * + * @return the accessRules value. + */ + public List accessRules() { + return this.accessRules; + } + + /** + * Set the accessRules property: List of Access Rules. + * + * @param accessRules the accessRules value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withAccessRules(List accessRules) { + this.accessRules = accessRules; + return this; + } + + /** + * Get the diagnosticSettingsVersion property: Current diagnostic settings version. + * + * @return the diagnosticSettingsVersion value. + */ + public Integer diagnosticSettingsVersion() { + return this.diagnosticSettingsVersion; + } + + /** + * Set the diagnosticSettingsVersion property: Current diagnostic settings version. + * + * @param diagnosticSettingsVersion the diagnosticSettingsVersion value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withDiagnosticSettingsVersion(Integer diagnosticSettingsVersion) { + this.diagnosticSettingsVersion = diagnosticSettingsVersion; + return this; + } + + /** + * Get the enabledLogCategories property: List of log categories that are enabled. + * + * @return the enabledLogCategories value. + */ + public List enabledLogCategories() { + return this.enabledLogCategories; + } + + /** + * Set the enabledLogCategories property: List of log categories that are enabled. + * + * @param enabledLogCategories the enabledLogCategories value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withEnabledLogCategories(List enabledLogCategories) { + this.enabledLogCategories = enabledLogCategories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessRules() != null) { + accessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("accessRulesVersion", this.accessRulesVersion); + jsonWriter.writeArrayField("accessRules", this.accessRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("diagnosticSettingsVersion", this.diagnosticSettingsVersion); + jsonWriter.writeArrayField("enabledLogCategories", this.enabledLogCategories, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityProfile. + */ + public static NetworkSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityProfile deserializedNetworkSecurityProfile = new NetworkSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityProfile.name = reader.getString(); + } else if ("accessRulesVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.accessRulesVersion = reader.getNullable(JsonReader::getInt); + } else if ("accessRules".equals(fieldName)) { + List accessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedNetworkSecurityProfile.accessRules = accessRules; + } else if ("diagnosticSettingsVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.diagnosticSettingsVersion + = reader.getNullable(JsonReader::getInt); + } else if ("enabledLogCategories".equals(fieldName)) { + List enabledLogCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkSecurityProfile.enabledLogCategories = enabledLogCategories; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityProfile; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssue.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssue.java new file mode 100644 index 000000000000..879dac647c66 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssue.java @@ -0,0 +1,105 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a provisioning issue for a network security perimeter configuration. + */ +@Immutable +public final class ProvisioningIssue implements JsonSerializable { + /* + * Name of the issue + */ + private String name; + + /* + * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should + * generate separate provisioning issue elements for each separate issue detected, and include a meaningful and + * distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules + */ + private ProvisioningIssueProperties properties; + + /** + * Creates an instance of ProvisioningIssue class. + */ + public ProvisioningIssue() { + } + + /** + * Get the name property: Name of the issue. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: Details of a provisioning issue for a network security perimeter (NSP) + * configuration. Resource providers should generate separate provisioning issue elements for each separate issue + * detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds + * and suggestedAccessRules. + * + * @return the properties value. + */ + public ProvisioningIssueProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProvisioningIssue. + */ + public static ProvisioningIssue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssue deserializedProvisioningIssue = new ProvisioningIssue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProvisioningIssue.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProvisioningIssue.properties = ProvisioningIssueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssue; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssueProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssueProperties.java new file mode 100644 index 000000000000..03b7d5581a79 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssueProperties.java @@ -0,0 +1,156 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should + * generate separate provisioning issue elements for each separate issue detected, and include a meaningful and + * distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. + */ +@Immutable +public final class ProvisioningIssueProperties implements JsonSerializable { + /* + * Type of issue + */ + private IssueType issueType; + + /* + * Severity of the issue. + */ + private Severity severity; + + /* + * Description of the issue + */ + private String description; + + /* + * Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter + * (NSP) to remediate the issue. + */ + private List suggestedResourceIds; + + /* + * Access rules that can be added to the network security profile (NSP) to remediate the issue. + */ + private List suggestedAccessRules; + + /** + * Creates an instance of ProvisioningIssueProperties class. + */ + public ProvisioningIssueProperties() { + } + + /** + * Get the issueType property: Type of issue. + * + * @return the issueType value. + */ + public IssueType issueType() { + return this.issueType; + } + + /** + * Get the severity property: Severity of the issue. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the description property: Description of the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the suggestedResourceIds property: Fully qualified resource IDs of suggested resources that can be associated + * to the network security perimeter (NSP) to remediate the issue. + * + * @return the suggestedResourceIds value. + */ + public List suggestedResourceIds() { + return this.suggestedResourceIds; + } + + /** + * Get the suggestedAccessRules property: Access rules that can be added to the network security profile (NSP) to + * remediate the issue. + * + * @return the suggestedAccessRules value. + */ + public List suggestedAccessRules() { + return this.suggestedAccessRules; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (suggestedAccessRules() != null) { + suggestedAccessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssueProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProvisioningIssueProperties. + */ + public static ProvisioningIssueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssueProperties deserializedProvisioningIssueProperties = new ProvisioningIssueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueType".equals(fieldName)) { + deserializedProvisioningIssueProperties.issueType = IssueType.fromString(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedProvisioningIssueProperties.severity = Severity.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedProvisioningIssueProperties.description = reader.getString(); + } else if ("suggestedResourceIds".equals(fieldName)) { + List suggestedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedProvisioningIssueProperties.suggestedResourceIds = suggestedResourceIds; + } else if ("suggestedAccessRules".equals(fieldName)) { + List suggestedAccessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedProvisioningIssueProperties.suggestedAccessRules = suggestedAccessRules; + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssueProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java index 443126c11d10..96b101885afc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java @@ -21,6 +21,11 @@ public final class PublicNetworkAccessType extends ExpandableStringEnum tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QueryPacksResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QueryPacksResource if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the QueryPacksResource. - */ - public static QueryPacksResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QueryPacksResource deserializedQueryPacksResource = new QueryPacksResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedQueryPacksResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQueryPacksResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQueryPacksResource.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedQueryPacksResource.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedQueryPacksResource.withTags(tags); - } else { - reader.skipChildren(); - } - } - - return deserializedQueryPacksResource; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociation.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociation.java new file mode 100644 index 000000000000..27f7152f88ae --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociation.java @@ -0,0 +1,122 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about resource association. + */ +@Fluent +public final class ResourceAssociation implements JsonSerializable { + /* + * Name of the resource association + */ + private String name; + + /* + * Access mode of the resource association + */ + private ResourceAssociationAccessMode accessMode; + + /** + * Creates an instance of ResourceAssociation class. + */ + public ResourceAssociation() { + } + + /** + * Get the name property: Name of the resource association. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource association. + * + * @param name the name value to set. + * @return the ResourceAssociation object itself. + */ + public ResourceAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessMode property: Access mode of the resource association. + * + * @return the accessMode value. + */ + public ResourceAssociationAccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access mode of the resource association. + * + * @param accessMode the accessMode value to set. + * @return the ResourceAssociation object itself. + */ + public ResourceAssociation withAccessMode(ResourceAssociationAccessMode accessMode) { + this.accessMode = accessMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceAssociation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceAssociation. + */ + public static ResourceAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceAssociation deserializedResourceAssociation = new ResourceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceAssociation.name = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedResourceAssociation.accessMode + = ResourceAssociationAccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceAssociation; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociationAccessMode.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociationAccessMode.java new file mode 100644 index 000000000000..503c299a0176 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociationAccessMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access mode of the resource association. + */ +public final class ResourceAssociationAccessMode extends ExpandableStringEnum { + /** + * Static value Enforced for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode ENFORCED = fromString("Enforced"); + + /** + * Static value Learning for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode LEARNING = fromString("Learning"); + + /** + * Static value Audit for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode AUDIT = fromString("Audit"); + + /** + * Creates a new instance of ResourceAssociationAccessMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceAssociationAccessMode() { + } + + /** + * Creates or finds a ResourceAssociationAccessMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceAssociationAccessMode. + */ + public static ResourceAssociationAccessMode fromString(String name) { + return fromString(name, ResourceAssociationAccessMode.class); + } + + /** + * Gets known ResourceAssociationAccessMode values. + * + * @return known ResourceAssociationAccessMode values. + */ + public static Collection values() { + return values(ResourceAssociationAccessMode.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleDefinition.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleDefinition.java new file mode 100644 index 000000000000..aa6a607c3036 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleDefinition.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Rule definition parameters. + */ +@Fluent +public final class RuleDefinition implements JsonSerializable { + /* + * Summary rule query. + */ + private String query; + + /* + * Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720, 1440. + */ + private Integer binSize; + + /* + * The minimum delay in seconds before bin processing. + */ + private Integer binDelay; + + /* + * The start time (UTC) when Summary rule execution starts. + */ + private OffsetDateTime binStartTime; + + /* + * The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + */ + private TimeSelectorEnum timeSelector; + + /* + * The destination table used for the Summary rule results. + */ + private String destinationTable; + + /** + * Creates an instance of RuleDefinition class. + */ + public RuleDefinition() { + } + + /** + * Get the query property: Summary rule query. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: Summary rule query. + * + * @param query the query value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the binSize property: Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720, 1440. + * + * @return the binSize value. + */ + public Integer binSize() { + return this.binSize; + } + + /** + * Set the binSize property: Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720, 1440. + * + * @param binSize the binSize value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withBinSize(Integer binSize) { + this.binSize = binSize; + return this; + } + + /** + * Get the binDelay property: The minimum delay in seconds before bin processing. + * + * @return the binDelay value. + */ + public Integer binDelay() { + return this.binDelay; + } + + /** + * Set the binDelay property: The minimum delay in seconds before bin processing. + * + * @param binDelay the binDelay value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withBinDelay(Integer binDelay) { + this.binDelay = binDelay; + return this; + } + + /** + * Get the binStartTime property: The start time (UTC) when Summary rule execution starts. + * + * @return the binStartTime value. + */ + public OffsetDateTime binStartTime() { + return this.binStartTime; + } + + /** + * Set the binStartTime property: The start time (UTC) when Summary rule execution starts. + * + * @param binStartTime the binStartTime value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withBinStartTime(OffsetDateTime binStartTime) { + this.binStartTime = binStartTime; + return this; + } + + /** + * Get the timeSelector property: The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + * + * @return the timeSelector value. + */ + public TimeSelectorEnum timeSelector() { + return this.timeSelector; + } + + /** + * Set the timeSelector property: The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + * + * @param timeSelector the timeSelector value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withTimeSelector(TimeSelectorEnum timeSelector) { + this.timeSelector = timeSelector; + return this; + } + + /** + * Get the destinationTable property: The destination table used for the Summary rule results. + * + * @return the destinationTable value. + */ + public String destinationTable() { + return this.destinationTable; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeNumberField("binSize", this.binSize); + jsonWriter.writeNumberField("binDelay", this.binDelay); + jsonWriter.writeStringField("binStartTime", + this.binStartTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.binStartTime)); + jsonWriter.writeStringField("timeSelector", this.timeSelector == null ? null : this.timeSelector.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleDefinition. + */ + public static RuleDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleDefinition deserializedRuleDefinition = new RuleDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("query".equals(fieldName)) { + deserializedRuleDefinition.query = reader.getString(); + } else if ("binSize".equals(fieldName)) { + deserializedRuleDefinition.binSize = reader.getNullable(JsonReader::getInt); + } else if ("binDelay".equals(fieldName)) { + deserializedRuleDefinition.binDelay = reader.getNullable(JsonReader::getInt); + } else if ("binStartTime".equals(fieldName)) { + deserializedRuleDefinition.binStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("timeSelector".equals(fieldName)) { + deserializedRuleDefinition.timeSelector = TimeSelectorEnum.fromString(reader.getString()); + } else if ("destinationTable".equals(fieldName)) { + deserializedRuleDefinition.destinationTable = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleDefinition; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleTypeEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleTypeEnum.java new file mode 100644 index 000000000000..2e757c9ed2d6 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleTypeEnum.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SummaryRules rule type: User. + */ +public final class RuleTypeEnum extends ExpandableStringEnum { + /** + * Static value User for RuleTypeEnum. + */ + public static final RuleTypeEnum USER = fromString("User"); + + /** + * Creates a new instance of RuleTypeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleTypeEnum() { + } + + /** + * Creates or finds a RuleTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleTypeEnum. + */ + public static RuleTypeEnum fromString(String name) { + return fromString(name, RuleTypeEnum.class); + } + + /** + * Gets known RuleTypeEnum values. + * + * @return known RuleTypeEnum values. + */ + public static Collection values() { + return values(RuleTypeEnum.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Severity.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Severity.java new file mode 100644 index 000000000000..b9ce652f7e05 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Severity.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Severity of the issue. + */ +public final class Severity extends ExpandableStringEnum { + /** + * Static value Warning for Severity. + */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Static value Error for Severity. + */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/StatusCodeEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/StatusCodeEnum.java new file mode 100644 index 000000000000..9aaf9f5b5e43 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/StatusCodeEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates the reason for rule deactivation. + */ +public final class StatusCodeEnum extends ExpandableStringEnum { + /** + * Static value UserAction for StatusCodeEnum. + */ + public static final StatusCodeEnum USER_ACTION = fromString("UserAction"); + + /** + * Static value DataPlaneError for StatusCodeEnum. + */ + public static final StatusCodeEnum DATA_PLANE_ERROR = fromString("DataPlaneError"); + + /** + * Creates a new instance of StatusCodeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusCodeEnum() { + } + + /** + * Creates or finds a StatusCodeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusCodeEnum. + */ + public static StatusCodeEnum fromString(String name) { + return fromString(name, StatusCodeEnum.class); + } + + /** + * Gets known StatusCodeEnum values. + * + * @return known StatusCodeEnum values. + */ + public static Collection values() { + return values(StatusCodeEnum.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogs.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogs.java new file mode 100644 index 000000000000..ea4a2602b17f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogs.java @@ -0,0 +1,372 @@ +// 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.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; + +/** + * An immutable client-side representation of SummaryLogs. + */ +public interface SummaryLogs { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the ruleType property: SummaryRules rule type: User. + * + * @return the ruleType value. + */ + RuleTypeEnum ruleType(); + + /** + * Gets the displayName property: The display name of the Summary rule. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The description of the Summary rule. + * + * @return the description value. + */ + String description(); + + /** + * Gets the isActive property: Indicates if Summary rule is active. If not, Summary rule execution stops. + * + * @return the isActive value. + */ + Boolean isActive(); + + /** + * Gets the statusCode property: Indicates the reason for rule deactivation. + * + * @return the statusCode value. + */ + StatusCodeEnum statusCode(); + + /** + * Gets the provisioningState property: Summary rule is in provisioning state. If set to 'updating' or 'deleting', + * indicates a resource lock due to an ongoing operation, preventing any update to the Summary rule until the + * operation is complete. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the ruleDefinition property: Rule definition parameters. + * + * @return the ruleDefinition value. + */ + RuleDefinition ruleDefinition(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner object. + * + * @return the inner object. + */ + SummaryLogsInner innerModel(); + + /** + * The entirety of the SummaryLogs definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SummaryLogs definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SummaryLogs definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SummaryLogs 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 SummaryLogs 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.WithRuleType, DefinitionStages.WithDisplayName, + DefinitionStages.WithDescription, DefinitionStages.WithRuleDefinition { + /** + * Executes the create request. + * + * @return the created resource. + */ + SummaryLogs create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SummaryLogs create(Context context); + } + + /** + * The stage of the SummaryLogs definition allowing to specify ruleType. + */ + interface WithRuleType { + /** + * Specifies the ruleType property: SummaryRules rule type: User.. + * + * @param ruleType SummaryRules rule type: User. + * @return the next definition stage. + */ + WithCreate withRuleType(RuleTypeEnum ruleType); + } + + /** + * The stage of the SummaryLogs definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the Summary rule.. + * + * @param displayName The display name of the Summary rule. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the SummaryLogs definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the Summary rule.. + * + * @param description The description of the Summary rule. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the SummaryLogs definition allowing to specify ruleDefinition. + */ + interface WithRuleDefinition { + /** + * Specifies the ruleDefinition property: Rule definition parameters.. + * + * @param ruleDefinition Rule definition parameters. + * @return the next definition stage. + */ + WithCreate withRuleDefinition(RuleDefinition ruleDefinition); + } + } + + /** + * Begins update for the SummaryLogs resource. + * + * @return the stage of resource update. + */ + SummaryLogs.Update update(); + + /** + * The template for SummaryLogs update. + */ + interface Update extends UpdateStages.WithRuleType, UpdateStages.WithDisplayName, UpdateStages.WithDescription, + UpdateStages.WithRuleDefinition { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SummaryLogs apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SummaryLogs apply(Context context); + } + + /** + * The SummaryLogs update stages. + */ + interface UpdateStages { + /** + * The stage of the SummaryLogs update allowing to specify ruleType. + */ + interface WithRuleType { + /** + * Specifies the ruleType property: SummaryRules rule type: User.. + * + * @param ruleType SummaryRules rule type: User. + * @return the next definition stage. + */ + Update withRuleType(RuleTypeEnum ruleType); + } + + /** + * The stage of the SummaryLogs update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the Summary rule.. + * + * @param displayName The display name of the Summary rule. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the SummaryLogs update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the Summary rule.. + * + * @param description The description of the Summary rule. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the SummaryLogs update allowing to specify ruleDefinition. + */ + interface WithRuleDefinition { + /** + * Specifies the ruleDefinition property: Rule definition parameters.. + * + * @param ruleDefinition Rule definition parameters. + * @return the next definition stage. + */ + Update withRuleDefinition(RuleDefinition ruleDefinition); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SummaryLogs refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SummaryLogs refresh(Context context); + + /** + * Starts an inactive Summary rule. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts an inactive Summary rule. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Stops an active Summary rule. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(Context context); + + /** + * Stops an active Summary rule. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Retries a failed Summary rule bin. + * + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void retryBin(SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param parameters The parameters required to retry a Summary rule bin. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void retryBin(SummaryLogsRetryBin parameters, Context context); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsListResult.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsListResult.java new file mode 100644 index 000000000000..ddae71e9904c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsListResult.java @@ -0,0 +1,115 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import java.io.IOException; +import java.util.List; + +/** + * The list Summary rule operation response. + */ +@Fluent +public final class SummaryLogsListResult implements JsonSerializable { + /* + * A list of Summary rules. + */ + private List value; + + /* + * URL to retrieve the next set of operation list results, if available. + */ + private String nextLink; + + /** + * Creates an instance of SummaryLogsListResult class. + */ + public SummaryLogsListResult() { + } + + /** + * Get the value property: A list of Summary rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Summary rules. + * + * @param value the value value to set. + * @return the SummaryLogsListResult object itself. + */ + public SummaryLogsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to retrieve the next set of operation list results, if available. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SummaryLogsListResult. + */ + public static SummaryLogsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsListResult deserializedSummaryLogsListResult = new SummaryLogsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SummaryLogsInner.fromJson(reader1)); + deserializedSummaryLogsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSummaryLogsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsListResult; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsOperations.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsOperations.java new file mode 100644 index 000000000000..08256a10029e --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsOperations.java @@ -0,0 +1,227 @@ +// 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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SummaryLogsOperations. + */ +public interface SummaryLogsOperations { + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules. + */ + SummaryLogs get(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + SummaryLogs getById(String id); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SummaryLogs resource. + * + * @param name resource name. + * @return the first stage of the new SummaryLogs definition. + */ + SummaryLogs.DefinitionStages.Blank define(String name); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBin.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBin.java new file mode 100644 index 000000000000..a766e7736945 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBin.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request to retry a summary logs bin. + */ +@Fluent +public final class SummaryLogsRetryBin implements JsonSerializable { + /* + * Retry bin properties. + */ + private SummaryLogsRetryBinProperties properties; + + /** + * Creates an instance of SummaryLogsRetryBin class. + */ + public SummaryLogsRetryBin() { + } + + /** + * Get the properties property: Retry bin properties. + * + * @return the properties value. + */ + public SummaryLogsRetryBinProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Retry bin properties. + * + * @param properties the properties value to set. + * @return the SummaryLogsRetryBin object itself. + */ + public SummaryLogsRetryBin withProperties(SummaryLogsRetryBinProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsRetryBin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsRetryBin if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SummaryLogsRetryBin. + */ + public static SummaryLogsRetryBin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsRetryBin deserializedSummaryLogsRetryBin = new SummaryLogsRetryBin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSummaryLogsRetryBin.properties = SummaryLogsRetryBinProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsRetryBin; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBinProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBinProperties.java new file mode 100644 index 000000000000..8b0ce563b9b2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBinProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Properties for retrying a Summary rule bin. + */ +@Fluent +public final class SummaryLogsRetryBinProperties implements JsonSerializable { + /* + * The time (UTC) of the bin to retry. + */ + private OffsetDateTime retryBinStartTime; + + /** + * Creates an instance of SummaryLogsRetryBinProperties class. + */ + public SummaryLogsRetryBinProperties() { + } + + /** + * Get the retryBinStartTime property: The time (UTC) of the bin to retry. + * + * @return the retryBinStartTime value. + */ + public OffsetDateTime retryBinStartTime() { + return this.retryBinStartTime; + } + + /** + * Set the retryBinStartTime property: The time (UTC) of the bin to retry. + * + * @param retryBinStartTime the retryBinStartTime value to set. + * @return the SummaryLogsRetryBinProperties object itself. + */ + public SummaryLogsRetryBinProperties withRetryBinStartTime(OffsetDateTime retryBinStartTime) { + this.retryBinStartTime = retryBinStartTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retryBinStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property retryBinStartTime in model SummaryLogsRetryBinProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SummaryLogsRetryBinProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("retryBinStartTime", + this.retryBinStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.retryBinStartTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsRetryBinProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsRetryBinProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SummaryLogsRetryBinProperties. + */ + public static SummaryLogsRetryBinProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsRetryBinProperties deserializedSummaryLogsRetryBinProperties + = new SummaryLogsRetryBinProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("retryBinStartTime".equals(fieldName)) { + deserializedSummaryLogsRetryBinProperties.retryBinStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsRetryBinProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java deleted file mode 100644 index 6e27ad4d2842..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Metadata pertaining to creation and last modification of the resource. - */ -@Fluent -public final class SystemDataAutoGenerated implements JsonSerializable { - /* - * The identity that created the resource. - */ - private String createdBy; - - /* - * The type of identity that created the resource. - */ - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). - */ - private OffsetDateTime createdAt; - - /* - * The identity that last modified the resource. - */ - private String lastModifiedBy; - - /* - * The type of identity that last modified the resource. - */ - private CreatedByType lastModifiedByType; - - /* - * The timestamp of resource last modification (UTC) - */ - private OffsetDateTime lastModifiedAt; - - /** - * Creates an instance of SystemDataAutoGenerated class. - */ - public SystemDataAutoGenerated() { - } - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Get the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - public CreatedByType createdByType() { - return this.createdByType; - } - - /** - * Set the createdByType property: The type of identity that created the resource. - * - * @param createdByType the createdByType value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; - return this; - } - - /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). - * - * @param createdAt the createdAt value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: The identity that last modified the resource. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - public CreatedByType lastModifiedByType() { - return this.lastModifiedByType; - } - - /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. - * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedByType(CreatedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; - } - - /** - * Get the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("createdBy", this.createdBy); - jsonWriter.writeStringField("createdByType", this.createdByType == null ? null : this.createdByType.toString()); - jsonWriter.writeStringField("createdAt", - this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); - jsonWriter.writeStringField("lastModifiedBy", this.lastModifiedBy); - jsonWriter.writeStringField("lastModifiedByType", - this.lastModifiedByType == null ? null : this.lastModifiedByType.toString()); - jsonWriter.writeStringField("lastModifiedAt", - this.lastModifiedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedAt)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SystemDataAutoGenerated from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SystemDataAutoGenerated if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the SystemDataAutoGenerated. - */ - public static SystemDataAutoGenerated fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SystemDataAutoGenerated deserializedSystemDataAutoGenerated = new SystemDataAutoGenerated(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("createdBy".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdBy = reader.getString(); - } else if ("createdByType".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdByType = CreatedByType.fromString(reader.getString()); - } else if ("createdAt".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastModifiedBy".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedBy = reader.getString(); - } else if ("lastModifiedByType".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedByType - = CreatedByType.fromString(reader.getString()); - } else if ("lastModifiedAt".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedSystemDataAutoGenerated; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java index a132b06efdf1..bb6b889337dc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; @@ -38,11 +39,12 @@ public interface Table { * * @return the systemData value. */ - SystemDataAutoGenerated systemData(); + SystemData systemData(); /** - * Gets the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Gets the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @return the retentionInDays value. */ @@ -50,14 +52,14 @@ public interface Table { /** * Gets the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @return the totalRetentionInDays value. */ Integer totalRetentionInDays(); /** - * Gets the archiveRetentionInDays property: The table data archive retention in days. Calculated as + * Gets the archiveRetentionInDays property: The tables long-term retention in days. Calculated as * (totalRetentionInDays-retentionInDays). * * @return the archiveRetentionInDays value. @@ -204,11 +206,13 @@ interface WithCreate extends DefinitionStages.WithRetentionInDays, DefinitionSta */ interface WithRetentionInDays { /** - * Specifies the retentionInDays property: The table retention in days, between 4 and 730. Setting this - * property to -1 will default to the workspace retention.. + * Specifies the retentionInDays property: In Analytics table: the tables analytics retention in days, + * between 4 and 730. Setting this property to -1 will default to the workspace retention. In Basic and + * Auxiliary table: read only property.. * - * @param retentionInDays The table retention in days, between 4 and 730. Setting this property to -1 will - * default to the workspace retention. + * @param retentionInDays In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read + * only property. * @return the next definition stage. */ WithCreate withRetentionInDays(Integer retentionInDays); @@ -220,10 +224,10 @@ interface WithRetentionInDays { interface WithTotalRetentionInDays { /** * Specifies the totalRetentionInDays property: The table total retention in days, between 4 and 4383. - * Setting this property to -1 will default to table retention.. + * Setting this property to -1 will default to retentionInDays.. * * @param totalRetentionInDays The table total retention in days, between 4 and 4383. Setting this property - * to -1 will default to table retention. + * to -1 will default to retentionInDays. * @return the next definition stage. */ WithCreate withTotalRetentionInDays(Integer totalRetentionInDays); @@ -320,11 +324,13 @@ interface UpdateStages { */ interface WithRetentionInDays { /** - * Specifies the retentionInDays property: The table retention in days, between 4 and 730. Setting this - * property to -1 will default to the workspace retention.. + * Specifies the retentionInDays property: In Analytics table: the tables analytics retention in days, + * between 4 and 730. Setting this property to -1 will default to the workspace retention. In Basic and + * Auxiliary table: read only property.. * - * @param retentionInDays The table retention in days, between 4 and 730. Setting this property to -1 will - * default to the workspace retention. + * @param retentionInDays In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read + * only property. * @return the next definition stage. */ Update withRetentionInDays(Integer retentionInDays); @@ -336,10 +342,10 @@ interface WithRetentionInDays { interface WithTotalRetentionInDays { /** * Specifies the totalRetentionInDays property: The table total retention in days, between 4 and 4383. - * Setting this property to -1 will default to table retention.. + * Setting this property to -1 will default to retentionInDays.. * * @param totalRetentionInDays The table total retention in days, between 4 and 4383. Setting this property - * to -1 will default to table retention. + * to -1 will default to retentionInDays. * @return the next definition stage. */ Update withTotalRetentionInDays(Integer totalRetentionInDays); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java index 6f506423c429..7eeece0a7632 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java @@ -21,6 +21,11 @@ public final class TablePlanEnum extends ExpandableStringEnum { */ public static final TablePlanEnum ANALYTICS = fromString("Analytics"); + /** + * Static value Auxiliary for TablePlanEnum. + */ + public static final TablePlanEnum AUXILIARY = fromString("Auxiliary"); + /** * Creates a new instance of TablePlanEnum value. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TimeSelectorEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TimeSelectorEnum.java new file mode 100644 index 000000000000..3f038ed82aa0 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TimeSelectorEnum.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + */ +public final class TimeSelectorEnum extends ExpandableStringEnum { + /** + * Static value TimeGenerated for TimeSelectorEnum. + */ + public static final TimeSelectorEnum TIME_GENERATED = fromString("TimeGenerated"); + + /** + * Creates a new instance of TimeSelectorEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TimeSelectorEnum() { + } + + /** + * Creates or finds a TimeSelectorEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeSelectorEnum. + */ + public static TimeSelectorEnum fromString(String name) { + return fromString(name, TimeSelectorEnum.class); + } + + /** + * Gets known TimeSelectorEnum values. + * + * @return known TimeSelectorEnum values. + */ + public static Collection values() { + return values(TimeSelectorEnum.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java index 1565231d5312..9d7cd91cc51a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java @@ -5,8 +5,10 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -61,7 +63,7 @@ public interface Workspace { * * @return the systemData value. */ - SystemDataAutoGenerated systemData(); + SystemData systemData(); /** * Gets the etag property: The etag of the workspace. @@ -111,14 +113,14 @@ public interface Workspace { * * @return the createdDate value. */ - String createdDate(); + OffsetDateTime createdDate(); /** * Gets the modifiedDate property: Workspace modification date. * * @return the modifiedDate value. */ - String modifiedDate(); + OffsetDateTime modifiedDate(); /** * Gets the publicNetworkAccessForIngestion property: The network access type for accessing Log Analytics ingestion. @@ -164,6 +166,20 @@ public interface Workspace { */ String defaultDataCollectionRuleResourceId(); + /** + * Gets the replication property: workspace replication properties. + * + * @return the replication value. + */ + WorkspaceReplicationProperties replication(); + + /** + * Gets the failover property: workspace failover properties. + * + * @return the failover value. + */ + WorkspaceFailoverProperties failover(); + /** * Gets the region of the resource. * @@ -251,7 +267,8 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde DefinitionStages.WithEtag, DefinitionStages.WithSku, DefinitionStages.WithRetentionInDays, DefinitionStages.WithWorkspaceCapping, DefinitionStages.WithPublicNetworkAccessForIngestion, DefinitionStages.WithPublicNetworkAccessForQuery, DefinitionStages.WithForceCmkForQuery, - DefinitionStages.WithFeatures, DefinitionStages.WithDefaultDataCollectionRuleResourceId { + DefinitionStages.WithFeatures, DefinitionStages.WithDefaultDataCollectionRuleResourceId, + DefinitionStages.WithReplication, DefinitionStages.WithFailover { /** * Executes the create request. * @@ -419,6 +436,32 @@ interface WithDefaultDataCollectionRuleResourceId { */ WithCreate withDefaultDataCollectionRuleResourceId(String defaultDataCollectionRuleResourceId); } + + /** + * The stage of the Workspace definition allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: workspace replication properties.. + * + * @param replication workspace replication properties. + * @return the next definition stage. + */ + WithCreate withReplication(WorkspaceReplicationProperties replication); + } + + /** + * The stage of the Workspace definition allowing to specify failover. + */ + interface WithFailover { + /** + * Specifies the failover property: workspace failover properties.. + * + * @param failover workspace failover properties. + * @return the next definition stage. + */ + WithCreate withFailover(WorkspaceFailoverProperties failover); + } } /** @@ -435,7 +478,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, Updat UpdateStages.WithRetentionInDays, UpdateStages.WithWorkspaceCapping, UpdateStages.WithPublicNetworkAccessForIngestion, UpdateStages.WithPublicNetworkAccessForQuery, UpdateStages.WithForceCmkForQuery, UpdateStages.WithFeatures, - UpdateStages.WithDefaultDataCollectionRuleResourceId { + UpdateStages.WithDefaultDataCollectionRuleResourceId, UpdateStages.WithReplication, UpdateStages.WithFailover { /** * Executes the update request. * @@ -594,6 +637,32 @@ interface WithDefaultDataCollectionRuleResourceId { */ Update withDefaultDataCollectionRuleResourceId(String defaultDataCollectionRuleResourceId); } + + /** + * The stage of the Workspace update allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: workspace replication properties.. + * + * @param replication workspace replication properties. + * @return the next definition stage. + */ + Update withReplication(WorkspaceReplicationProperties replication); + } + + /** + * The stage of the Workspace update allowing to specify failover. + */ + interface WithFailover { + /** + * Specifies the failover property: workspace failover properties.. + * + * @param failover workspace failover properties. + * @return the next definition stage. + */ + Update withFailover(WorkspaceFailoverProperties failover); + } } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java new file mode 100644 index 000000000000..2c21e573155e --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The failover state of the replication. + */ +@Immutable +public final class WorkspaceFailoverProperties implements JsonSerializable { + /* + * The failover state of the replication. + */ + private WorkspaceFailoverState state; + + /* + * The last time when the failover state was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of WorkspaceFailoverProperties class. + */ + public WorkspaceFailoverProperties() { + } + + /** + * Get the state property: The failover state of the replication. + * + * @return the state value. + */ + public WorkspaceFailoverState state() { + return this.state; + } + + /** + * Get the lastModifiedDate property: The last time when the failover state was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceFailoverProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceFailoverProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceFailoverProperties. + */ + public static WorkspaceFailoverProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceFailoverProperties deserializedWorkspaceFailoverProperties = new WorkspaceFailoverProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedWorkspaceFailoverProperties.state + = WorkspaceFailoverState.fromString(reader.getString()); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedWorkspaceFailoverProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceFailoverProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java new file mode 100644 index 000000000000..9e737290b651 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The failover state of the replication. + */ +public final class WorkspaceFailoverState extends ExpandableStringEnum { + /** + * Static value Inactive for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState INACTIVE = fromString("Inactive"); + + /** + * Static value Activating for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState ACTIVATING = fromString("Activating"); + + /** + * Static value Active for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState ACTIVE = fromString("Active"); + + /** + * Static value Deactivating for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState DEACTIVATING = fromString("Deactivating"); + + /** + * Static value Failed for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState FAILED = fromString("Failed"); + + /** + * Creates a new instance of WorkspaceFailoverState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceFailoverState() { + } + + /** + * Creates or finds a WorkspaceFailoverState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceFailoverState. + */ + public static WorkspaceFailoverState fromString(String name) { + return fromString(name, WorkspaceFailoverState.class); + } + + /** + * Gets known WorkspaceFailoverState values. + * + * @return known WorkspaceFailoverState values. + */ + public static Collection values() { + return values(WorkspaceFailoverState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java index a9df6beb1b9b..e99d2e623119 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; /** @@ -43,6 +44,17 @@ public final class WorkspaceFeatures implements JsonSerializable associations; + /* * Workspace features. */ @@ -157,6 +169,26 @@ public WorkspaceFeatures withDisableLocalAuth(Boolean disableLocalAuth) { return this; } + /** + * Get the unifiedSentinelBillingOnly property: An indication if the specify workspace is limited to sentinel's + * unified billing model only. + * + * @return the unifiedSentinelBillingOnly value. + */ + public Boolean unifiedSentinelBillingOnly() { + return this.unifiedSentinelBillingOnly; + } + + /** + * Get the associations property: List of associations for the workspace. Indicates if the workspace is associated + * with any of the following experiences: MDC, Sentinel, SentinelGraph, etc. + * + * @return the associations value. + */ + public List associations() { + return this.associations; + } + /** * Get the additionalProperties property: Workspace features. * @@ -233,6 +265,12 @@ public static WorkspaceFeatures fromJson(JsonReader jsonReader) throws IOExcepti deserializedWorkspaceFeatures.clusterResourceId = reader.getString(); } else if ("disableLocalAuth".equals(fieldName)) { deserializedWorkspaceFeatures.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); + } else if ("unifiedSentinelBillingOnly".equals(fieldName)) { + deserializedWorkspaceFeatures.unifiedSentinelBillingOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("associations".equals(fieldName)) { + List associations = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspaceFeatures.associations = associations; } else { if (additionalProperties == null) { additionalProperties = new LinkedHashMap<>(); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java index a535826fce8c..cc71120c2510 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java @@ -10,6 +10,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceProperties; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -242,7 +243,7 @@ public WorkspacePatch withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -251,7 +252,7 @@ public String createdDate() { * * @return the modifiedDate value. */ - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } @@ -383,6 +384,52 @@ public WorkspacePatch withDefaultDataCollectionRuleResourceId(String defaultData return this; } + /** + * Get the replication property: workspace replication properties. + * + * @return the replication value. + */ + public WorkspaceReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: workspace replication properties. + * + * @param replication the replication value to set. + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withReplication(WorkspaceReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + + /** + * Get the failover property: workspace failover properties. + * + * @return the failover value. + */ + public WorkspaceFailoverProperties failover() { + return this.innerProperties() == null ? null : this.innerProperties().failover(); + } + + /** + * Set the failover property: workspace failover properties. + * + * @param failover the failover value to set. + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withFailover(WorkspaceFailoverProperties failover) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFailover(failover); + return this; + } + /** * Validates the instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java index dc6ff302ce36..ea933e471b37 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java @@ -148,7 +148,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("column", this.column); jsonWriter.writeStringField("operator", this.operator); - jsonWriter.writeUntypedField("value", this.value); + if (this.value != null) { + jsonWriter.writeUntypedField("value", this.value); + } jsonWriter.writeStringField("key", this.key); return jsonWriter.writeEndObject(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java new file mode 100644 index 000000000000..3221198b5a6a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Workspace replication properties. + */ +@Fluent +public final class WorkspaceReplicationProperties implements JsonSerializable { + /* + * The location of the replication. + */ + private String location; + + /* + * Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated to + * the specified location. If replication is been enabled, location must be provided. + */ + private Boolean enabled; + + /* + * The provisioning state of the replication. + */ + private WorkspaceReplicationState provisioningState; + + /* + * The last time when the replication was enabled. + */ + private OffsetDateTime createdDate; + + /* + * The last time when the replication was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of WorkspaceReplicationProperties class. + */ + public WorkspaceReplicationProperties() { + } + + /** + * Get the location property: The location of the replication. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the replication. + * + * @param location the location value to set. + * @return the WorkspaceReplicationProperties object itself. + */ + public WorkspaceReplicationProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the enabled property: Specifies whether the replication is enabled or not. When true, workspace configuration + * and data is replicated to the specified location. If replication is been enabled, location must be provided. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the replication is enabled or not. When true, workspace configuration + * and data is replicated to the specified location. If replication is been enabled, location must be provided. + * + * @param enabled the enabled value to set. + * @return the WorkspaceReplicationProperties object itself. + */ + public WorkspaceReplicationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the replication. + * + * @return the provisioningState value. + */ + public WorkspaceReplicationState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdDate property: The last time when the replication was enabled. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the lastModifiedDate property: The last time when the replication was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceReplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceReplicationProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceReplicationProperties. + */ + public static WorkspaceReplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceReplicationProperties deserializedWorkspaceReplicationProperties + = new WorkspaceReplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.location = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.provisioningState + = WorkspaceReplicationState.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceReplicationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java new file mode 100644 index 000000000000..3012cd8a21ed --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the replication. + */ +public final class WorkspaceReplicationState extends ExpandableStringEnum { + /** + * Static value Succeeded for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value EnableRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ENABLE_REQUESTED = fromString("EnableRequested"); + + /** + * Static value Enabling for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ENABLING = fromString("Enabling"); + + /** + * Static value DisableRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState DISABLE_REQUESTED = fromString("DisableRequested"); + + /** + * Static value Disabling for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState DISABLING = fromString("Disabling"); + + /** + * Static value RollbackRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ROLLBACK_REQUESTED = fromString("RollbackRequested"); + + /** + * Static value RollingBack for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ROLLING_BACK = fromString("RollingBack"); + + /** + * Static value Failed for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState FAILED = fromString("Failed"); + + /** + * Static value Canceled for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of WorkspaceReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceReplicationState() { + } + + /** + * Creates or finds a WorkspaceReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceReplicationState. + */ + public static WorkspaceReplicationState fromString(String name) { + return fromString(name, WorkspaceReplicationState.class); + } + + /** + * Gets known WorkspaceReplicationState values. + * + * @return known WorkspaceReplicationState values. + */ + public static Collection values() { + return values(WorkspaceReplicationState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java index 2d7a1192b4f8..af77ce68904e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java @@ -5,12 +5,14 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; /** * The SKU (tier) of a workspace. @@ -25,12 +27,12 @@ public final class WorkspaceSku implements JsonSerializable { /* * The capacity reservation level in GB for this workspace, when CapacityReservation sku is selected. */ - private CapacityReservationLevel capacityReservationLevel; + private Integer capacityReservationLevel; /* * The last time when the sku was updated. */ - private String lastSkuUpdate; + private OffsetDateTime lastSkuUpdate; /** * Creates an instance of WorkspaceSku class. @@ -64,7 +66,7 @@ public WorkspaceSku withName(WorkspaceSkuNameEnum name) { * * @return the capacityReservationLevel value. */ - public CapacityReservationLevel capacityReservationLevel() { + public Integer capacityReservationLevel() { return this.capacityReservationLevel; } @@ -75,7 +77,7 @@ public CapacityReservationLevel capacityReservationLevel() { * @param capacityReservationLevel the capacityReservationLevel value to set. * @return the WorkspaceSku object itself. */ - public WorkspaceSku withCapacityReservationLevel(CapacityReservationLevel capacityReservationLevel) { + public WorkspaceSku withCapacityReservationLevel(Integer capacityReservationLevel) { this.capacityReservationLevel = capacityReservationLevel; return this; } @@ -85,7 +87,7 @@ public WorkspaceSku withCapacityReservationLevel(CapacityReservationLevel capaci * * @return the lastSkuUpdate value. */ - public String lastSkuUpdate() { + public OffsetDateTime lastSkuUpdate() { return this.lastSkuUpdate; } @@ -110,8 +112,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); - jsonWriter.writeNumberField("capacityReservationLevel", - this.capacityReservationLevel == null ? null : this.capacityReservationLevel.toInt()); + jsonWriter.writeNumberField("capacityReservationLevel", this.capacityReservationLevel); return jsonWriter.writeEndObject(); } @@ -134,10 +135,10 @@ public static WorkspaceSku fromJson(JsonReader jsonReader) throws IOException { if ("name".equals(fieldName)) { deserializedWorkspaceSku.name = WorkspaceSkuNameEnum.fromString(reader.getString()); } else if ("capacityReservationLevel".equals(fieldName)) { - deserializedWorkspaceSku.capacityReservationLevel - = CapacityReservationLevel.fromInt(reader.getInt()); + deserializedWorkspaceSku.capacityReservationLevel = reader.getNullable(JsonReader::getInt); } else if ("lastSkuUpdate".equals(fieldName)) { - deserializedWorkspaceSku.lastSkuUpdate = reader.getString(); + deserializedWorkspaceSku.lastSkuUpdate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java index aded531c69b2..c83b5b4f9374 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java @@ -109,6 +109,149 @@ public interface Workspaces { */ Workspace getByResourceGroup(String resourceGroupName, String workspaceName); + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failover(String resourceGroupName, String location, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failback(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable listNsp(String resourceGroupName, String workspaceName); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable listNsp(String resourceGroupName, String workspaceName, + Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration along with {@link Response}. + */ + Response getNspWithResponse(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration. + */ + NetworkSecurityPerimeterConfiguration getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName, + Context context); + /** * Gets a workspace instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json index 96beaa4260d6..207d3ba1bca3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.loganalytics.implementation.AvailableServiceTiersClientImpl$AvailableServiceTiersService"],["com.azure.resourcemanager.loganalytics.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.loganalytics.implementation.DataExportsClientImpl$DataExportsService"],["com.azure.resourcemanager.loganalytics.implementation.DataSourcesClientImpl$DataSourcesService"],["com.azure.resourcemanager.loganalytics.implementation.DeletedWorkspacesClientImpl$DeletedWorkspacesService"],["com.azure.resourcemanager.loganalytics.implementation.GatewaysClientImpl$GatewaysService"],["com.azure.resourcemanager.loganalytics.implementation.IntelligencePacksClientImpl$IntelligencePacksService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedServicesClientImpl$LinkedServicesService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedStorageAccountsClientImpl$LinkedStorageAccountsService"],["com.azure.resourcemanager.loganalytics.implementation.ManagementGroupsClientImpl$ManagementGroupsService"],["com.azure.resourcemanager.loganalytics.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.loganalytics.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.loganalytics.implementation.QueriesClientImpl$QueriesService"],["com.azure.resourcemanager.loganalytics.implementation.QueryPacksClientImpl$QueryPacksService"],["com.azure.resourcemanager.loganalytics.implementation.SavedSearchesClientImpl$SavedSearchesService"],["com.azure.resourcemanager.loganalytics.implementation.SchemasClientImpl$SchemasService"],["com.azure.resourcemanager.loganalytics.implementation.SharedKeysOperationsClientImpl$SharedKeysOperationsService"],["com.azure.resourcemanager.loganalytics.implementation.StorageInsightConfigsClientImpl$StorageInsightConfigsService"],["com.azure.resourcemanager.loganalytics.implementation.TablesClientImpl$TablesService"],["com.azure.resourcemanager.loganalytics.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacePurgesClientImpl$WorkspacePurgesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file +[["com.azure.resourcemanager.loganalytics.implementation.AvailableServiceTiersClientImpl$AvailableServiceTiersService"],["com.azure.resourcemanager.loganalytics.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.loganalytics.implementation.DataExportsClientImpl$DataExportsService"],["com.azure.resourcemanager.loganalytics.implementation.DataSourcesClientImpl$DataSourcesService"],["com.azure.resourcemanager.loganalytics.implementation.DeletedWorkspacesClientImpl$DeletedWorkspacesService"],["com.azure.resourcemanager.loganalytics.implementation.GatewaysClientImpl$GatewaysService"],["com.azure.resourcemanager.loganalytics.implementation.IntelligencePacksClientImpl$IntelligencePacksService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedServicesClientImpl$LinkedServicesService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedStorageAccountsClientImpl$LinkedStorageAccountsService"],["com.azure.resourcemanager.loganalytics.implementation.ManagementGroupsClientImpl$ManagementGroupsService"],["com.azure.resourcemanager.loganalytics.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.loganalytics.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.loganalytics.implementation.QueriesClientImpl$QueriesService"],["com.azure.resourcemanager.loganalytics.implementation.QueryPacksClientImpl$QueryPacksService"],["com.azure.resourcemanager.loganalytics.implementation.SavedSearchesClientImpl$SavedSearchesService"],["com.azure.resourcemanager.loganalytics.implementation.SchemasClientImpl$SchemasService"],["com.azure.resourcemanager.loganalytics.implementation.SharedKeysOperationsClientImpl$SharedKeysOperationsService"],["com.azure.resourcemanager.loganalytics.implementation.StorageInsightConfigsClientImpl$StorageInsightConfigsService"],["com.azure.resourcemanager.loganalytics.implementation.SummaryLogsOperationsClientImpl$SummaryLogsOperationsService"],["com.azure.resourcemanager.loganalytics.implementation.TablesClientImpl$TablesService"],["com.azure.resourcemanager.loganalytics.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacePurgesClientImpl$WorkspacePurgesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java index 6027c2a37478..911dda2f39eb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class AvailableServiceTiersListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesAvailableServiceTiers.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesAvailableServiceTiers.json */ /** * Sample code: AvailableServiceTiers. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java index cdf8a9d5ec19..baa8ce2485b5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java @@ -4,7 +4,6 @@ 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; @@ -16,8 +15,8 @@ public final class ClustersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersCreate.json */ /** * Sample code: ClustersCreate. @@ -27,11 +26,10 @@ public final class ClustersCreateOrUpdateSamples { public static void clustersCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { manager.clusters() .define("oiautorest6685") - .withRegion("australiasoutheast") + .withRegion("eastus") .withExistingResourceGroup("oiautorest6685") .withTags(mapOf("tag1", "val1")) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(100L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .create(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java index 7e221b1ec4d4..8fe3dc91ea5d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java @@ -10,8 +10,8 @@ public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersDelete.json */ /** * Sample code: ClustersDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java index b7bb8dade85b..235514d4ac46 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersGet.json */ /** * Sample code: ClustersGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java index 90e2eb2da761..159a51548e82 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersListByResourceGroup.json */ /** * Sample code: ClustersGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java index 4444ec1d187b..42ff400e6863 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java @@ -10,8 +10,8 @@ public final class ClustersListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersSubscriptionList.json */ /** * Sample code: ClustersSubscriptionList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java index 49cc21a3ef7b..75b135ad8a7e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.loganalytics.generated; -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; @@ -21,8 +20,8 @@ public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersUpdate.json */ /** * Sample code: ClustersPatch. @@ -39,8 +38,7 @@ public static void clustersPatch(com.azure.resourcemanager.loganalytics.LogAnaly .withUserAssignedIdentities(mapOf( "/subscriptions/53bc36c5-91e1-4d09-92c9-63b89e571926/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", new UserAssignedIdentity()))) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(1000L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .withKeyVaultProperties(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") .withKeyName("fakeTokenPlaceholder") .withKeyVersion("fakeTokenPlaceholder") diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java index f7c685d67ebd..1f0b3ff72ea1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java @@ -12,8 +12,8 @@ public final class DataExportsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportCreateOrUpdate.json */ /** * Sample code: DataExportCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java index 5abe36f0e084..eae061c19485 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java @@ -10,8 +10,8 @@ public final class DataExportsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportDelete.json */ /** * Sample code: DataExportDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java index 5a2a5d2d9db2..c371b5126462 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java @@ -10,8 +10,8 @@ public final class DataExportsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportGet.json */ /** * Sample code: DataExportGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java index 7ab637466708..a694e9c8e953 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class DataExportsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportListByWorkspace.json */ /** * Sample code: DataExportGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java index 25d3636d4c2d..5aeed8a77a3b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class DataSourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesCreate.json */ /** * Sample code: DataSourcesCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java index a57cb035de24..097b75afe896 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java @@ -10,8 +10,8 @@ public final class DataSourcesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesDelete.json */ /** * Sample code: DataSourcesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java index ee60fa9ca0f5..7ac3c72825d4 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java @@ -10,8 +10,8 @@ public final class DataSourcesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesGet.json */ /** * Sample code: DataSourcesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java index 64401d4f00c1..252e6c639b1e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class DataSourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesListByWorkspace.json */ /** * Sample code: DataSourcesListByWorkspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java index f6a8ed6871cf..621b15cca97c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class DeletedWorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java index ad2ba98f0b64..89a8ba8021c7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java @@ -10,8 +10,8 @@ public final class DeletedWorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java index 28cc492db409..0ab01ac2110c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java @@ -10,8 +10,8 @@ public final class GatewaysDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGatewaysDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGatewaysDelete.json */ /** * Sample code: DeleteGateways. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java index 9eebdb756452..cc5836d941b7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java @@ -10,8 +10,8 @@ public final class IntelligencePacksDisableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDisableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDisableIntelligencePack.json */ /** * Sample code: IntelligencePacksDisable. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java index 250a7dba63b5..ad921383e09c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java @@ -10,8 +10,8 @@ public final class IntelligencePacksEnableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesEnableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesEnableIntelligencePack.json */ /** * Sample code: IntelligencePacksEnable. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java index 9b2a6df40974..a5e77a1a6180 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java @@ -10,8 +10,8 @@ public final class IntelligencePacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListIntelligencePacks.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListIntelligencePacks.json */ /** * Sample code: IntelligencePacksList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java index 4073959caf7a..7f3f67f2240f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesCreate.json */ /** * Sample code: LinkedServicesCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java index 02d4c9ba5ae8..868474b2ac6f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesDelete.json */ /** * Sample code: LinkedServicesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java index f8d21b5a25d1..39852dc3b62f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesGet.json */ /** * Sample code: LinkedServicesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java index 468ce3a9a4ef..be21065fff0c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesListByWorkspace.json */ /** * Sample code: LinkedServicesListByWorkspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java index 5ec9c7aa0f5f..3cb1a6f23dfb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class LinkedStorageAccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsCreate.json */ /** * Sample code: LinkedStorageAccountsCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java index 1ce389516f57..c09d2da814b2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java @@ -12,8 +12,8 @@ public final class LinkedStorageAccountsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsDelete.json */ /** * Sample code: LinkedStorageAccountsDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java index 9a0d884e4eaf..8daaa01f4b01 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java @@ -12,8 +12,8 @@ public final class LinkedStorageAccountsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsGet.json */ /** * Sample code: LinkedStorageAccountsGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java index e1ae26a204db..fe8d0ae5dedd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class LinkedStorageAccountsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsListByWorkspace.json */ /** * Sample code: Gets list of linked storage accounts on a workspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java index 0cdabc9ffbb7..a5cae6936dfc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java @@ -10,8 +10,8 @@ public final class ManagementGroupsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListManagementGroups.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListManagementGroups.json */ /** * Sample code: WorkspacesListManagementGroups. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java index 853be869b15e..51a13f359a24 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java @@ -10,8 +10,8 @@ public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * OperationStatusesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationStatusesGet.json */ /** * Sample code: Get specific operation status. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java index 374a6f18606b..5319828b6c8e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java @@ -10,8 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * OperationsListByTenant.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationsListByTenant.json */ /** * Sample code: Get specific operation status. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java index 387ca164856b..6a94f9eea7f9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java @@ -10,8 +10,8 @@ public final class QueriesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesDelete.json */ /** * Sample code: QueryDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java index 064096ffaa8b..e9a55236fc7d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java @@ -10,8 +10,8 @@ public final class QueriesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesGet.json */ /** * Sample code: QueryGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java index aa03bcd8a840..eb84f1e717ff 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java @@ -10,8 +10,8 @@ public final class QueriesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesList.json */ /** * Sample code: QueryList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java index 0ad9950cf1db..29d0da6c96b1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java @@ -15,8 +15,8 @@ public final class QueriesPutSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesPut.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesPut.json */ /** * Sample code: QueryPut. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java index 95c9a54af48e..90defb533d09 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java @@ -16,8 +16,8 @@ public final class QueriesSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesSearch.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesSearch.json */ /** * Sample code: QuerySearch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java index aa5b79266f20..642be814b4cd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java @@ -16,8 +16,8 @@ public final class QueriesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesUpdate.json */ /** * Sample code: QueryPatch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java index c12df416effa..45c21ff9f308 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreate.json */ /** * Sample code: QueryPackCreate. @@ -31,8 +31,8 @@ public static void queryPackCreate(com.azure.resourcemanager.loganalytics.LogAna /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdate.json */ /** * Sample code: QueryPackUpdate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java index ea6b29b2488a..95d70e02bfc1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java @@ -14,8 +14,8 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreateNoName.json */ /** * Sample code: QueryPackCreateNoName. @@ -30,8 +30,8 @@ public static void queryPackCreateNoName(com.azure.resourcemanager.loganalytics. /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackUpdateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackUpdateNoName.json */ /** * Sample code: QueryPackUpdateNoName. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java index 71a8666537c5..1decd4ade04c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksDelete.json */ /** * Sample code: QueryPacksDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java index bb2f520554f9..4b604de0c92c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksGet.json */ /** * Sample code: QueryPackGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java index d6a9196b8adf..4c31805b962e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksListByResourceGroup.json */ /** * Sample code: QueryPackListByResourceGroup. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java index cfbfa4347068..5355f9299ebd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksList.json */ /** * Sample code: QueryPacksList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java index 5dd53593eed6..88b05a54b46e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java @@ -14,8 +14,8 @@ public final class QueryPacksUpdateTagsSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdateTagsOnly.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdateTagsOnly.json */ /** * Sample code: QueryPackUpdateTagsOnly. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java index d1eb2e1ebce7..7c2e0682ff07 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class SavedSearchesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json */ /** * Sample code: SavedSearchCreateOrUpdate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java index cb0a0e4c8fd1..1d3b072e2c4e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java @@ -10,8 +10,8 @@ public final class SavedSearchesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDeleteSavedSearches.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDeleteSavedSearches.json */ /** * Sample code: SavedSearchesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java index dda1d9c87f7c..e07b43e10354 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java @@ -10,8 +10,8 @@ public final class SavedSearchesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesGet.json */ /** * Sample code: SavedSearchesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java index 7bf9bc3c73fb..2931575b93b6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class SavedSearchesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesListByWorkspace.json */ /** * Sample code: SavedSearchesList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java index 33fa55b4dd20..3fdd88e572db 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java @@ -10,8 +10,8 @@ public final class SchemaGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesGetSchema.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesGetSchema.json */ /** * Sample code: WorkspacesGetSchema. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java index 68efb62c6ca4..abe0dae55397 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java @@ -10,8 +10,8 @@ public final class SharedKeysOperationGetSharedKeysSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGetSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGetSharedKeys.json */ /** * Sample code: SharedKeysList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java index 1739d55e2a41..80804317660d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java @@ -10,8 +10,8 @@ public final class SharedKeysOperationRegenerateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesRegenerateSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesRegenerateSharedKeys.json */ /** * Sample code: RegenerateSharedKeys. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java index a36413877d66..91fd24cca068 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class StorageInsightConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsCreateOrUpdate.json */ /** * Sample code: StorageInsightsCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java index fd6a760cda89..7a5f529dcfc3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java @@ -10,8 +10,8 @@ public final class StorageInsightConfigsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsDelete.json */ /** * Sample code: StorageInsightsDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java index 0f9fcc8b7936..58ba9630b883 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java @@ -10,8 +10,8 @@ public final class StorageInsightConfigsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsGet.json */ /** * Sample code: StorageInsightsGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java index b7b8e6125f33..ac06f1708f10 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class StorageInsightConfigsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsListByWorkspace.json */ /** * Sample code: StorageInsightsList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b902ab163ad7 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationCreateOrUpdateSamples.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.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation CreateOrUpdate. + */ +public final class SummaryLogsOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsUpsert.json + */ + /** + * Sample code: SummaryLogsUpsert. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .define("summarylogs1") + .withExistingWorkspace("oiautorest6685", "oiautorest6685") + .withRuleType(RuleTypeEnum.USER) + .withRuleDefinition(new RuleDefinition().withQuery("MyTable_CL") + .withBinSize(180) + .withBinDelay(10) + .withBinStartTime(OffsetDateTime.parse("2020-02-03T04:05:06Z"))) + .create(); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationDeleteSamples.java new file mode 100644 index 000000000000..b6408d8f24ad --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationDeleteSamples.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; + +/** + * Samples for SummaryLogsOperation Delete. + */ +public final class SummaryLogsOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsDelete.json + */ + /** + * Sample code: SummaryLogsDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .delete("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationGetSamples.java new file mode 100644 index 000000000000..0d582cfee879 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationGetSamples.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; + +/** + * Samples for SummaryLogsOperation Get. + */ +public final class SummaryLogsOperationGetSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsGet.json + */ + /** + * Sample code: SummaryLogsGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .getWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationListByWorkspaceSamples.java new file mode 100644 index 000000000000..8d9b0affc88c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationListByWorkspaceSamples.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; + +/** + * Samples for SummaryLogsOperation ListByWorkspace. + */ +public final class SummaryLogsOperationListByWorkspaceSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsList.json + */ + /** + * Sample code: SummaryLogsListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .listByWorkspace("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationRetryBinSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationRetryBinSamples.java new file mode 100644 index 000000000000..d85ecb3f400b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationRetryBinSamples.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.SummaryLogsRetryBin; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation RetryBin. + */ +public final class SummaryLogsOperationRetryBinSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsRetryBin.json + */ + /** + * Sample code: SummaryLogsRetryBin. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsRetryBin(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .retryBin("oiautorest6685", "oiautorest6685", "summarylogs1", + new SummaryLogsRetryBin().withProperties(new SummaryLogsRetryBinProperties() + .withRetryBinStartTime(OffsetDateTime.parse("2020-02-03T04:00:00Z"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStartSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStartSamples.java new file mode 100644 index 000000000000..eda03e18fabc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStartSamples.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; + +/** + * Samples for SummaryLogsOperation Start. + */ +public final class SummaryLogsOperationStartSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStart.json + */ + /** + * Sample code: SummaryLogsStart. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStart(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .start("exampleresourcegroup", "exampleworkspace", "summarylogs3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStopSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStopSamples.java new file mode 100644 index 000000000000..17f38ebd3033 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStopSamples.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; + +/** + * Samples for SummaryLogsOperation Stop. + */ +public final class SummaryLogsOperationStopSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStop.json + */ + /** + * Sample code: SummaryLogsStop. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStop(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .stopWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java index 6afa7f1b9cfe..30c81cbb67d6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java @@ -10,8 +10,8 @@ public final class TablesCancelSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesSearchCancel.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesSearchCancel.json */ /** * Sample code: TablesSearchCancel. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java index 9a6bd6faddec..d7c87acef97f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class TablesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java index b7172bcbfb3e..60b8aa3ff60c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java @@ -10,8 +10,8 @@ public final class TablesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesDelete.json */ /** * Sample code: TablesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java index 05d356b11506..2d33860a4c20 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java @@ -10,8 +10,8 @@ public final class TablesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesGet.json */ /** * Sample code: TablesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java index 15fea02884c7..071274de8c87 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class TablesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesList.json */ /** * Sample code: TablesListByWorkspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java index 8e0515e6611a..fb24107ad910 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java @@ -10,8 +10,8 @@ public final class TablesMigrateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesMigrate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesMigrate.json */ /** * Sample code: TablesMigrate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java index ecb767fb0cee..55b3e1add3ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java @@ -16,8 +16,8 @@ public final class TablesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java index 1d4068a6ee85..5ab1c8899e83 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java @@ -10,8 +10,8 @@ public final class UsagesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListUsages.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListUsages.json */ /** * Sample code: UsagesList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java index 69ff88bf84d6..28923a3085aa 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java @@ -10,8 +10,8 @@ public final class WorkspacePurgeGetPurgeStatusSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeOperation.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeOperation.json */ /** * Sample code: WorkspacePurgeOperation. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java index 1dd676c20ecb..9e7fa0a8e4d3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java @@ -14,8 +14,8 @@ public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeResourceId.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeResourceId.json */ /** * Sample code: WorkspacePurgeResourceId. @@ -34,8 +34,8 @@ public static void workspacePurgeResourceId(com.azure.resourcemanager.loganalyti /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurge.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurge.json */ /** * Sample code: WorkspacePurge. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java index abce117e89b4..d70ce13ef48d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesCreate.json */ /** * Sample code: WorkspacesCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java index dac400c21743..03b2a34a2113 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDelete.json */ /** * Sample code: WorkspacesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java new file mode 100644 index 000000000000..63a6e1af3357 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces Failback. + */ +public final class WorkspacesFailbackSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailback.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failback("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java new file mode 100644 index 000000000000..364b08df0dea --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces Failover. + */ +public final class WorkspacesFailoverSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailover.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failover("oiautorest6685", "eastus", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java index 845b2fba7be5..5cd903c4e779 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGet.json */ /** * Sample code: WorkspaceGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspSamples.java new file mode 100644 index 000000000000..3fc7ad9c9b00 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces GetNsp. + */ +public final class WorkspacesGetNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Get.json + */ + /** + * Sample code: Get NSP config by name for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + getNSPConfigByNameForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .getNspWithResponse("exampleRG", "someWorkspace", "somePerimeterConfiguration", + com.azure.core.util.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 index 165d1c4d6af1..d16ea5977e33 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspSamples.java new file mode 100644 index 000000000000..296676ebf5d6 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspSamples.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; + +/** + * Samples for Workspaces ListNsp. + */ +public final class WorkspacesListNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_List.json + */ + /** + * Sample code: List NSP configs by Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + listNSPConfigsByScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().listNsp("exampleRG", "someWorkspace", com.azure.core.util.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 index 535445f0da1b..ebbbd4be541e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesReconcileNspSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesReconcileNspSamples.java new file mode 100644 index 000000000000..066789b7ff8f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesReconcileNspSamples.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 Workspaces ReconcileNsp. + */ +public final class WorkspacesReconcileNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Reconcile.json + */ + /** + * Sample code: Reconcile NSP config for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + reconcileNSPConfigForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .reconcileNsp("exampleRG", "someWorkspace", "somePerimeterConfiguration", com.azure.core.util.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 index 9d1fef46d1c6..c41aee9f55da 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java @@ -15,8 +15,8 @@ public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesUpdate.json */ /** * Sample code: WorkspacesPatch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesSubscriptionsItemTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesSubscriptionsItemTests.java new file mode 100644 index 000000000000..af4fbaa556d3 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesSubscriptionsItemTests.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; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import org.junit.jupiter.api.Assertions; + +public final class AccessRulePropertiesSubscriptionsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRulePropertiesSubscriptionsItem model = BinaryData.fromString("{\"id\":\"mzdlyjdfqwmkyo\"}") + .toObject(AccessRulePropertiesSubscriptionsItem.class); + Assertions.assertEquals("mzdlyjdfqwmkyo", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AccessRulePropertiesSubscriptionsItem model + = new AccessRulePropertiesSubscriptionsItem().withId("mzdlyjdfqwmkyo"); + model = BinaryData.fromObject(model).toObject(AccessRulePropertiesSubscriptionsItem.class); + Assertions.assertEquals("mzdlyjdfqwmkyo", model.id()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesTests.java new file mode 100644 index 000000000000..ef4918aed685 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesTests.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.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class AccessRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRuleProperties model = BinaryData.fromString( + "{\"direction\":\"Outbound\",\"addressPrefixes\":[\"ywuhpsvfuur\",\"tlwexxwlalniexz\",\"rzpgep\"],\"subscriptions\":[{\"id\":\"bwwpgdakchzy\"}],\"networkSecurityPerimeters\":[{\"id\":\"q\",\"perimeterGuid\":\"93bc26fc-f9fb-4e69-9852-158903792b58\",\"location\":\"cxkjibnxmysuxswq\"},{\"id\":\"tvlwijpsttexoq\",\"perimeterGuid\":\"4eded75f-0555-44c1-944a-0d0074ddf66e\",\"location\":\"cyyufmh\"},{\"id\":\"nc\",\"perimeterGuid\":\"344e5ead-a6e5-4329-9351-1a3ed62f4f98\",\"location\":\"qspkcdqzhlctd\"},{\"id\":\"nqndyfpchrqbn\",\"perimeterGuid\":\"de737e0c-b524-425d-b66b-095fab635f9c\",\"location\":\"cgegydcwbo\"}],\"fullyQualifiedDomainNames\":[\"mvqqolih\"],\"emailAddresses\":[\"iouaubrjt\",\"oq\",\"fuojrngif\"],\"phoneNumbers\":[\"pasccbi\"]}") + .toObject(AccessRuleProperties.class); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.direction()); + Assertions.assertEquals("ywuhpsvfuur", model.addressPrefixes().get(0)); + Assertions.assertEquals("bwwpgdakchzy", model.subscriptions().get(0).id()); + Assertions.assertEquals("q", model.networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("93bc26fc-f9fb-4e69-9852-158903792b58"), + model.networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("cxkjibnxmysuxswq", model.networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("mvqqolih", model.fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iouaubrjt", model.emailAddresses().get(0)); + Assertions.assertEquals("pasccbi", model.phoneNumbers().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AccessRuleProperties model = new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("ywuhpsvfuur", "tlwexxwlalniexz", "rzpgep")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem().withId("bwwpgdakchzy"))) + .withNetworkSecurityPerimeters(Arrays.asList( + new NetworkSecurityPerimeter().withId("q") + .withPerimeterGuid(UUID.fromString("93bc26fc-f9fb-4e69-9852-158903792b58")) + .withLocation("cxkjibnxmysuxswq"), + new NetworkSecurityPerimeter().withId("tvlwijpsttexoq") + .withPerimeterGuid(UUID.fromString("4eded75f-0555-44c1-944a-0d0074ddf66e")) + .withLocation("cyyufmh"), + new NetworkSecurityPerimeter().withId("nc") + .withPerimeterGuid(UUID.fromString("344e5ead-a6e5-4329-9351-1a3ed62f4f98")) + .withLocation("qspkcdqzhlctd"), + new NetworkSecurityPerimeter().withId("nqndyfpchrqbn") + .withPerimeterGuid(UUID.fromString("de737e0c-b524-425d-b66b-095fab635f9c")) + .withLocation("cgegydcwbo"))) + .withFullyQualifiedDomainNames(Arrays.asList("mvqqolih")) + .withEmailAddresses(Arrays.asList("iouaubrjt", "oq", "fuojrngif")) + .withPhoneNumbers(Arrays.asList("pasccbi")); + model = BinaryData.fromObject(model).toObject(AccessRuleProperties.class); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.direction()); + Assertions.assertEquals("ywuhpsvfuur", model.addressPrefixes().get(0)); + Assertions.assertEquals("bwwpgdakchzy", model.subscriptions().get(0).id()); + Assertions.assertEquals("q", model.networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("93bc26fc-f9fb-4e69-9852-158903792b58"), + model.networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("cxkjibnxmysuxswq", model.networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("mvqqolih", model.fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iouaubrjt", model.emailAddresses().get(0)); + Assertions.assertEquals("pasccbi", model.phoneNumbers().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRuleTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRuleTests.java new file mode 100644 index 000000000000..3bf48de73d63 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRuleTests.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class AccessRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRule model = BinaryData.fromString( + "{\"name\":\"yrxpdlcgqls\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"rddga\",\"quhiosrsjuivf\",\"disyirnxz\",\"czexrxzbujrtrhqv\"],\"subscriptions\":[{\"id\":\"khgn\"}],\"networkSecurityPerimeters\":[{\"id\":\"nzlrpiqywncvjt\",\"perimeterGuid\":\"da835f74-0b91-40ea-b2cb-eb01d99bf24d\",\"location\":\"ofizehtdhgbj\"},{\"id\":\"reljeamur\",\"perimeterGuid\":\"214214b7-277e-49e9-9256-f50f7ae9cacc\",\"location\":\"lovuana\"},{\"id\":\"cxlpmjerb\",\"perimeterGuid\":\"3dbe07f2-7712-4b46-8c7a-50c7f90f2469\",\"location\":\"lvidizozs\"},{\"id\":\"ccxjm\",\"perimeterGuid\":\"86b2dc0b-6721-48cf-9996-5475b5828c29\",\"location\":\"dgnwncypuuwwlt\"}],\"fullyQualifiedDomainNames\":[\"jctzenkei\",\"zzhmkd\",\"svflyhbxcudch\"],\"emailAddresses\":[\"rb\",\"ldforobwj\",\"vizbfhfo\"],\"phoneNumbers\":[\"cqpbtuo\",\"xesz\",\"bbelawumuaslzk\",\"rrwoycqucwyhahn\"]}}") + .toObject(AccessRule.class); + Assertions.assertEquals("yrxpdlcgqls", model.name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.properties().direction()); + Assertions.assertEquals("rddga", model.properties().addressPrefixes().get(0)); + Assertions.assertEquals("khgn", model.properties().subscriptions().get(0).id()); + Assertions.assertEquals("nzlrpiqywncvjt", model.properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("da835f74-0b91-40ea-b2cb-eb01d99bf24d"), + model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("ofizehtdhgbj", model.properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("jctzenkei", model.properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("rb", model.properties().emailAddresses().get(0)); + Assertions.assertEquals("cqpbtuo", model.properties().phoneNumbers().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AccessRule model = new AccessRule().withName("yrxpdlcgqls") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("rddga", "quhiosrsjuivf", "disyirnxz", "czexrxzbujrtrhqv")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem().withId("khgn"))) + .withNetworkSecurityPerimeters(Arrays.asList( + new NetworkSecurityPerimeter().withId("nzlrpiqywncvjt") + .withPerimeterGuid(UUID.fromString("da835f74-0b91-40ea-b2cb-eb01d99bf24d")) + .withLocation("ofizehtdhgbj"), + new NetworkSecurityPerimeter().withId("reljeamur") + .withPerimeterGuid(UUID.fromString("214214b7-277e-49e9-9256-f50f7ae9cacc")) + .withLocation("lovuana"), + new NetworkSecurityPerimeter().withId("cxlpmjerb") + .withPerimeterGuid(UUID.fromString("3dbe07f2-7712-4b46-8c7a-50c7f90f2469")) + .withLocation("lvidizozs"), + new NetworkSecurityPerimeter().withId("ccxjm") + .withPerimeterGuid(UUID.fromString("86b2dc0b-6721-48cf-9996-5475b5828c29")) + .withLocation("dgnwncypuuwwlt"))) + .withFullyQualifiedDomainNames(Arrays.asList("jctzenkei", "zzhmkd", "svflyhbxcudch")) + .withEmailAddresses(Arrays.asList("rb", "ldforobwj", "vizbfhfo")) + .withPhoneNumbers(Arrays.asList("cqpbtuo", "xesz", "bbelawumuaslzk", "rrwoycqucwyhahn"))); + model = BinaryData.fromObject(model).toObject(AccessRule.class); + Assertions.assertEquals("yrxpdlcgqls", model.name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.properties().direction()); + Assertions.assertEquals("rddga", model.properties().addressPrefixes().get(0)); + Assertions.assertEquals("khgn", model.properties().subscriptions().get(0).id()); + Assertions.assertEquals("nzlrpiqywncvjt", model.properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("da835f74-0b91-40ea-b2cb-eb01d99bf24d"), + model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("ofizehtdhgbj", model.properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("jctzenkei", model.properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("rb", model.properties().emailAddresses().get(0)); + Assertions.assertEquals("cqpbtuo", model.properties().phoneNumbers().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java index 2a0ff4de6028..76f9fa64d04b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java @@ -11,7 +11,7 @@ public final class AssociatedWorkspaceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AssociatedWorkspace model = BinaryData.fromString( - "{\"workspaceId\":\"pagao\",\"workspaceName\":\"ulpqblylsyxkqjn\",\"resourceId\":\"ervtiagxs\",\"associateDate\":\"zuempsbzkf\"}") + "{\"workspaceId\":\"a86d2e6d-74b6-4e05-a0b9-c41d1cdb673b\",\"workspaceName\":\"cqhsm\",\"resourceId\":\"rkdtmlxh\",\"associateDate\":\"2021-09-14T21:41:32Z\"}") .toObject(AssociatedWorkspace.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java index 13f701c200bb..75085a254fff 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java @@ -11,7 +11,7 @@ public final class AvailableServiceTierInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AvailableServiceTierInner model = BinaryData.fromString( - "{\"serviceTier\":\"Premium\",\"enabled\":true,\"minimumRetention\":2447311563304363726,\"maximumRetention\":2614637191948743156,\"defaultRetention\":5459563894986340273,\"capacityReservationLevel\":7110930774958137161,\"lastSkuUpdate\":\"piexpbtgiw\"}") + "{\"serviceTier\":\"Standalone\",\"enabled\":true,\"minimumRetention\":1510156696946077578,\"maximumRetention\":4193584240156362355,\"defaultRetention\":6508308958074251403,\"capacityReservationLevel\":550039120288444364,\"lastSkuUpdate\":\"mtz\"}") .toObject(AvailableServiceTierInner.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java index 11fb44320e42..a99343810768 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.AvailableServiceTier; @@ -21,17 +21,17 @@ public final class AvailableServiceTiersListByWorkspaceWithResponseMockTests { @Test public void testListByWorkspaceWithResponse() throws Exception { String responseStr - = "[{\"serviceTier\":\"CapacityReservation\",\"enabled\":true,\"minimumRetention\":3767644182859901371,\"maximumRetention\":7248546755237746462,\"defaultRetention\":840422895247134750,\"capacityReservationLevel\":8295020029995054755,\"lastSkuUpdate\":\"ujr\"},{\"serviceTier\":\"PerGB2018\",\"enabled\":false,\"minimumRetention\":120736086062160717,\"maximumRetention\":2641992673329436235,\"defaultRetention\":3461505183507942780,\"capacityReservationLevel\":854242813011904996,\"lastSkuUpdate\":\"ikzoeovvtzejetj\"},{\"serviceTier\":\"Free\",\"enabled\":false,\"minimumRetention\":7781117605646169012,\"maximumRetention\":159668866868514414,\"defaultRetention\":7370744360813533838,\"capacityReservationLevel\":700409671675457936,\"lastSkuUpdate\":\"rzvh\"}]"; + = "[{\"serviceTier\":\"CapacityReservation\",\"enabled\":false,\"minimumRetention\":1432087697888177845,\"maximumRetention\":8313394416637011338,\"defaultRetention\":5559566767637280772,\"capacityReservationLevel\":6950782705334382897,\"lastSkuUpdate\":\"jg\"},{\"serviceTier\":\"Premium\",\"enabled\":true,\"minimumRetention\":5983360915282781316,\"maximumRetention\":4653983891463635460,\"defaultRetention\":3143366093760834812,\"capacityReservationLevel\":4708968390247773451,\"lastSkuUpdate\":\"ltxijjumfqwazln\"},{\"serviceTier\":\"PerGB2018\",\"enabled\":false,\"minimumRetention\":3523690994753868801,\"maximumRetention\":3035438207417975715,\"defaultRetention\":1193446146950584030,\"capacityReservationLevel\":6287732006458517592,\"lastSkuUpdate\":\"yfu\"},{\"serviceTier\":\"Standalone\",\"enabled\":true,\"minimumRetention\":3265340554220962405,\"maximumRetention\":1400392420008149330,\"defaultRetention\":2431415951490180842,\"capacityReservationLevel\":3788300585704298114,\"lastSkuUpdate\":\"hm\"}]"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); List response = manager.availableServiceTiers() - .listByWorkspaceWithResponse("ztlvtmvagbwidqlv", "ukoveofi", com.azure.core.util.Context.NONE) + .listByWorkspaceWithResponse("qtferrqwexjkmf", "apjwogqqnobpudcd", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java index aec477e4178d..5755d7c4687c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java @@ -10,9 +10,9 @@ public final class AzureEntityResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AzureEntityResource model = BinaryData - .fromString("{\"etag\":\"slbi\",\"id\":\"kojgcyzts\",\"name\":\"mznbaeqphch\",\"type\":\"nrnrp\"}") - .toObject(AzureEntityResource.class); + AzureEntityResource model + = BinaryData.fromString("{\"etag\":\"whcjyxcc\",\"id\":\"bvpa\",\"name\":\"akkud\",\"type\":\"px\"}") + .toObject(AzureEntityResource.class); } @org.junit.jupiter.api.Test diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java deleted file mode 100644 index d2daa1af46c4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.AzureResourceProperties; - -public final class AzureResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceProperties model - = BinaryData.fromString("{\"id\":\"sxlzevgbmqj\",\"name\":\"bcypmi\",\"type\":\"w\"}") - .toObject(AzureResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceProperties model = new AzureResourceProperties(); - model = BinaryData.fromObject(model).toObject(AzureResourceProperties.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java index a404402661f5..18652f10597f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java @@ -11,7 +11,7 @@ public final class CapacityReservationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapacityReservationProperties model - = BinaryData.fromString("{\"lastSkuUpdate\":\"eyvpnqicvinvkj\",\"minCapacity\":2624293456615314766}") + = BinaryData.fromString("{\"lastSkuUpdate\":\"2021-01-05T18:43:06Z\",\"minCapacity\":8378841457136361246}") .toObject(CapacityReservationProperties.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterReplicationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterReplicationPropertiesTests.java new file mode 100644 index 000000000000..ea1c0aeecb42 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterReplicationPropertiesTests.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.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterReplicationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterReplicationProperties model = BinaryData.fromString( + "{\"location\":\"kc\",\"enabled\":false,\"isAvailabilityZonesEnabled\":true,\"provisioningState\":\"Enabling\",\"createdDate\":\"2021-03-12T09:05:14Z\",\"lastModifiedDate\":\"2021-11-03T04:50:08Z\"}") + .toObject(ClusterReplicationProperties.class); + Assertions.assertEquals("kc", model.location()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.isAvailabilityZonesEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterReplicationProperties model = new ClusterReplicationProperties().withLocation("kc") + .withEnabled(false) + .withIsAvailabilityZonesEnabled(true); + model = BinaryData.fromObject(model).toObject(ClusterReplicationProperties.class); + Assertions.assertEquals("kc", model.location()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.isAvailabilityZonesEnabled()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java index 9a2be34cbd19..ec54834d00ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; import org.junit.jupiter.api.Assertions; @@ -13,18 +12,18 @@ public final class ClusterSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterSku model - = BinaryData.fromString("{\"capacity\":2000,\"name\":\"CapacityReservation\"}").toObject(ClusterSku.class); - Assertions.assertEquals(Capacity.TWO_ZERO_ZERO_ZERO, model.capacity()); + ClusterSku model = BinaryData.fromString("{\"capacity\":4121879659269768466,\"name\":\"CapacityReservation\"}") + .toObject(ClusterSku.class); + Assertions.assertEquals(4121879659269768466L, model.capacity()); Assertions.assertEquals(ClusterSkuNameEnum.CAPACITY_RESERVATION, model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterSku model = new ClusterSku().withCapacity(Capacity.TWO_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION); + ClusterSku model + = new ClusterSku().withCapacity(4121879659269768466L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION); model = BinaryData.fromObject(model).toObject(ClusterSku.class); - Assertions.assertEquals(Capacity.TWO_ZERO_ZERO_ZERO, model.capacity()); + Assertions.assertEquals(4121879659269768466L, model.capacity()); Assertions.assertEquals(ClusterSkuNameEnum.CAPACITY_RESERVATION, model.name()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java index 57864c8d9600..ab6b2cc44564 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.clusters().delete("rnfxtgddp", "th", com.azure.core.util.Context.NONE); + manager.clusters().delete("aglkafhon", "juj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java index e3f8126a79ec..fb56750955dd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java @@ -14,27 +14,27 @@ public final class ColumnTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Column model = BinaryData.fromString( - "{\"name\":\"q\",\"type\":\"dateTime\",\"dataTypeHint\":\"guid\",\"displayName\":\"jb\",\"description\":\"gaehvvibrxjjst\",\"isDefaultDisplay\":false,\"isHidden\":false}") + "{\"name\":\"pikpz\",\"type\":\"real\",\"dataTypeHint\":\"uri\",\"displayName\":\"nlfzxiavrmbz\",\"description\":\"okixrjqcir\",\"isDefaultDisplay\":false,\"isHidden\":true}") .toObject(Column.class); - Assertions.assertEquals("q", model.name()); - Assertions.assertEquals(ColumnTypeEnum.DATE_TIME, model.type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.dataTypeHint()); - Assertions.assertEquals("jb", model.displayName()); - Assertions.assertEquals("gaehvvibrxjjst", model.description()); + Assertions.assertEquals("pikpz", model.name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.dataTypeHint()); + Assertions.assertEquals("nlfzxiavrmbz", model.displayName()); + Assertions.assertEquals("okixrjqcir", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Column model = new Column().withName("q") - .withType(ColumnTypeEnum.DATE_TIME) - .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("jb") - .withDescription("gaehvvibrxjjst"); + Column model = new Column().withName("pikpz") + .withType(ColumnTypeEnum.REAL) + .withDataTypeHint(ColumnDataTypeHintEnum.URI) + .withDisplayName("nlfzxiavrmbz") + .withDescription("okixrjqcir"); model = BinaryData.fromObject(model).toObject(Column.class); - Assertions.assertEquals("q", model.name()); - Assertions.assertEquals(ColumnTypeEnum.DATE_TIME, model.type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.dataTypeHint()); - Assertions.assertEquals("jb", model.displayName()); - Assertions.assertEquals("gaehvvibrxjjst", model.description()); + Assertions.assertEquals("pikpz", model.name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.dataTypeHint()); + Assertions.assertEquals("nlfzxiavrmbz", model.displayName()); + Assertions.assertEquals("okixrjqcir", model.description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java index 7ac059f116db..2bb6c7f6df27 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java @@ -12,18 +12,17 @@ public final class CoreSummaryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CoreSummary model - = BinaryData.fromString("{\"status\":\"elpcirelsfeaenwa\",\"numberOfDocuments\":6225068900260031070}") + = BinaryData.fromString("{\"status\":\"zvqtmnubexkp\",\"numberOfDocuments\":6799001413428276597}") .toObject(CoreSummary.class); - Assertions.assertEquals("elpcirelsfeaenwa", model.status()); - Assertions.assertEquals(6225068900260031070L, model.numberOfDocuments()); + Assertions.assertEquals("zvqtmnubexkp", model.status()); + Assertions.assertEquals(6799001413428276597L, model.numberOfDocuments()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CoreSummary model - = new CoreSummary().withStatus("elpcirelsfeaenwa").withNumberOfDocuments(6225068900260031070L); + CoreSummary model = new CoreSummary().withStatus("zvqtmnubexkp").withNumberOfDocuments(6799001413428276597L); model = BinaryData.fromObject(model).toObject(CoreSummary.class); - Assertions.assertEquals("elpcirelsfeaenwa", model.status()); - Assertions.assertEquals(6225068900260031070L, model.numberOfDocuments()); + Assertions.assertEquals("zvqtmnubexkp", model.status()); + Assertions.assertEquals(6799001413428276597L, model.numberOfDocuments()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java index 77d446726320..62a324915bf1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java @@ -13,33 +13,33 @@ public final class DataExportInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataExportInner model = BinaryData.fromString( - "{\"properties\":{\"dataExportId\":\"ovm\",\"tableNames\":[\"kacspkw\",\"hzdobpxjmflbvvnc\"],\"destination\":{\"resourceId\":\"kcciwwzjuqkhr\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"ku\"}},\"enable\":false,\"createdDate\":\"kg\",\"lastModifiedDate\":\"auu\"},\"id\":\"mjmvxieduugidyjr\",\"name\":\"f\",\"type\":\"y\"}") + "{\"properties\":{\"dataExportId\":\"qeof\",\"tableNames\":[\"e\",\"jhqjbasvmsmjqul\",\"gsntnbybkzgcwr\",\"clxxwrljdo\"],\"destination\":{\"resourceId\":\"kcqvkocrc\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"nh\"}},\"enable\":true,\"createdDate\":\"biksq\",\"lastModifiedDate\":\"lssai\"},\"id\":\"qpjwnzlljfm\",\"name\":\"pee\",\"type\":\"vmgxsab\"}") .toObject(DataExportInner.class); - Assertions.assertEquals("ovm", model.dataExportId()); - Assertions.assertEquals("kacspkw", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("kg", model.createdDate()); - Assertions.assertEquals("auu", model.lastModifiedDate()); - Assertions.assertEquals("kcciwwzjuqkhr", model.resourceId()); - Assertions.assertEquals("ku", model.eventHubName()); + Assertions.assertEquals("qeof", model.dataExportId()); + Assertions.assertEquals("e", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("biksq", model.createdDate()); + Assertions.assertEquals("lssai", model.lastModifiedDate()); + Assertions.assertEquals("kcqvkocrc", model.resourceId()); + Assertions.assertEquals("nh", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataExportInner model = new DataExportInner().withDataExportId("ovm") - .withTableNames(Arrays.asList("kacspkw", "hzdobpxjmflbvvnc")) - .withEnable(false) - .withCreatedDate("kg") - .withLastModifiedDate("auu") - .withResourceId("kcciwwzjuqkhr") - .withEventHubName("ku"); + DataExportInner model = new DataExportInner().withDataExportId("qeof") + .withTableNames(Arrays.asList("e", "jhqjbasvmsmjqul", "gsntnbybkzgcwr", "clxxwrljdo")) + .withEnable(true) + .withCreatedDate("biksq") + .withLastModifiedDate("lssai") + .withResourceId("kcqvkocrc") + .withEventHubName("nh"); model = BinaryData.fromObject(model).toObject(DataExportInner.class); - Assertions.assertEquals("ovm", model.dataExportId()); - Assertions.assertEquals("kacspkw", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("kg", model.createdDate()); - Assertions.assertEquals("auu", model.lastModifiedDate()); - Assertions.assertEquals("kcciwwzjuqkhr", model.resourceId()); - Assertions.assertEquals("ku", model.eventHubName()); + Assertions.assertEquals("qeof", model.dataExportId()); + Assertions.assertEquals("e", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("biksq", model.createdDate()); + Assertions.assertEquals("lssai", model.lastModifiedDate()); + Assertions.assertEquals("kcqvkocrc", model.resourceId()); + Assertions.assertEquals("nh", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java index 011824c5d840..42883713205f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java @@ -14,41 +14,55 @@ public final class DataExportListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataExportListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dataExportId\":\"exfwhy\",\"tableNames\":[\"i\",\"vyvdcs\",\"tynnaamdectehfi\",\"scjeypv\"],\"destination\":{\"resourceId\":\"zrkgqhcjrefovg\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"eyyvxyqjpkcat\"}},\"enable\":false,\"createdDate\":\"jcrcczsqpjhvmda\",\"lastModifiedDate\":\"nysounqe\"},\"id\":\"a\",\"name\":\"oaeupfhyhltrpmo\",\"type\":\"jmcmatuokthfu\"},{\"properties\":{\"dataExportId\":\"odsfcpkvxodpuozm\",\"tableNames\":[\"ydagfuaxbe\",\"yiuokktwh\",\"dxwzywqsmbsurexi\",\"o\"],\"destination\":{\"resourceId\":\"ocfs\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"ddystkiiuxhqy\"}},\"enable\":false,\"createdDate\":\"rrqnbpoczvyifqrv\",\"lastModifiedDate\":\"vjsllrmvvdfw\"},\"id\":\"t\",\"name\":\"pnpulexxbczwtru\",\"type\":\"iqzbq\"}]}") + "{\"value\":[{\"properties\":{\"dataExportId\":\"tihfx\",\"tableNames\":[\"jbpzvgnwzsymg\",\"zufcyzkohdbi\",\"anufhfcbjysag\",\"th\"],\"destination\":{\"resourceId\":\"hab\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"xwczbyscnp\"}},\"enable\":true,\"createdDate\":\"ivyqniwbybrkxvd\",\"lastModifiedDate\":\"jgrtfwvukxga\"},\"id\":\"dcc\",\"name\":\"nhsjcnyej\",\"type\":\"kryhtnapczwlokj\"},{\"properties\":{\"dataExportId\":\"kkvnipjox\",\"tableNames\":[\"nchgej\",\"podmailzydehojwy\"],\"destination\":{\"resourceId\":\"uxinpmqnjaq\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"prozvcputegjvwmf\"}},\"enable\":false,\"createdDate\":\"cmdv\",\"lastModifiedDate\":\"hulsuuvmkjozkrwf\"},\"id\":\"dio\",\"name\":\"jpslwejd\",\"type\":\"vwryoqpso\"},{\"properties\":{\"dataExportId\":\"tazak\",\"tableNames\":[\"lahbcryff\"],\"destination\":{\"resourceId\":\"dosyg\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"jakhmsbzjh\"}},\"enable\":false,\"createdDate\":\"vdphlxaolthqtr\",\"lastModifiedDate\":\"jbp\"},\"id\":\"zfsinzgvf\",\"name\":\"jrwzox\",\"type\":\"j\"},{\"properties\":{\"dataExportId\":\"lluwfzitonpeq\",\"tableNames\":[\"jkjlxofpdvhpfx\",\"ypininm\",\"yhuybbkpod\"],\"destination\":{\"resourceId\":\"ooginuvamih\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"rxzxtheo\"}},\"enable\":false,\"createdDate\":\"vyevcciqi\",\"lastModifiedDate\":\"hungbwjzrnf\"},\"id\":\"gxg\",\"name\":\"spemvtzfk\",\"type\":\"fublj\"}]}") .toObject(DataExportListResult.class); - Assertions.assertEquals("exfwhy", model.value().get(0).dataExportId()); - Assertions.assertEquals("i", model.value().get(0).tableNames().get(0)); - Assertions.assertEquals(false, model.value().get(0).enable()); - Assertions.assertEquals("jcrcczsqpjhvmda", model.value().get(0).createdDate()); - Assertions.assertEquals("nysounqe", model.value().get(0).lastModifiedDate()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).resourceId()); - Assertions.assertEquals("eyyvxyqjpkcat", model.value().get(0).eventHubName()); + Assertions.assertEquals("tihfx", model.value().get(0).dataExportId()); + Assertions.assertEquals("jbpzvgnwzsymg", model.value().get(0).tableNames().get(0)); + Assertions.assertTrue(model.value().get(0).enable()); + Assertions.assertEquals("ivyqniwbybrkxvd", model.value().get(0).createdDate()); + Assertions.assertEquals("jgrtfwvukxga", model.value().get(0).lastModifiedDate()); + Assertions.assertEquals("hab", model.value().get(0).resourceId()); + Assertions.assertEquals("xwczbyscnp", model.value().get(0).eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DataExportListResult model = new DataExportListResult().withValue(Arrays.asList( - new DataExportInner().withDataExportId("exfwhy") - .withTableNames(Arrays.asList("i", "vyvdcs", "tynnaamdectehfi", "scjeypv")) + new DataExportInner().withDataExportId("tihfx") + .withTableNames(Arrays.asList("jbpzvgnwzsymg", "zufcyzkohdbi", "anufhfcbjysag", "th")) + .withEnable(true) + .withCreatedDate("ivyqniwbybrkxvd") + .withLastModifiedDate("jgrtfwvukxga") + .withResourceId("hab") + .withEventHubName("xwczbyscnp"), + new DataExportInner().withDataExportId("kkvnipjox") + .withTableNames(Arrays.asList("nchgej", "podmailzydehojwy")) .withEnable(false) - .withCreatedDate("jcrcczsqpjhvmda") - .withLastModifiedDate("nysounqe") - .withResourceId("zrkgqhcjrefovg") - .withEventHubName("eyyvxyqjpkcat"), - new DataExportInner().withDataExportId("odsfcpkvxodpuozm") - .withTableNames(Arrays.asList("ydagfuaxbe", "yiuokktwh", "dxwzywqsmbsurexi", "o")) + .withCreatedDate("cmdv") + .withLastModifiedDate("hulsuuvmkjozkrwf") + .withResourceId("uxinpmqnjaq") + .withEventHubName("prozvcputegjvwmf"), + new DataExportInner().withDataExportId("tazak") + .withTableNames(Arrays.asList("lahbcryff")) .withEnable(false) - .withCreatedDate("rrqnbpoczvyifqrv") - .withLastModifiedDate("vjsllrmvvdfw") - .withResourceId("ocfs") - .withEventHubName("ddystkiiuxhqy"))); + .withCreatedDate("vdphlxaolthqtr") + .withLastModifiedDate("jbp") + .withResourceId("dosyg") + .withEventHubName("jakhmsbzjh"), + new DataExportInner().withDataExportId("lluwfzitonpeq") + .withTableNames(Arrays.asList("jkjlxofpdvhpfx", "ypininm", "yhuybbkpod")) + .withEnable(false) + .withCreatedDate("vyevcciqi") + .withLastModifiedDate("hungbwjzrnf") + .withResourceId("ooginuvamih") + .withEventHubName("rxzxtheo"))); model = BinaryData.fromObject(model).toObject(DataExportListResult.class); - Assertions.assertEquals("exfwhy", model.value().get(0).dataExportId()); - Assertions.assertEquals("i", model.value().get(0).tableNames().get(0)); - Assertions.assertEquals(false, model.value().get(0).enable()); - Assertions.assertEquals("jcrcczsqpjhvmda", model.value().get(0).createdDate()); - Assertions.assertEquals("nysounqe", model.value().get(0).lastModifiedDate()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).resourceId()); - Assertions.assertEquals("eyyvxyqjpkcat", model.value().get(0).eventHubName()); + Assertions.assertEquals("tihfx", model.value().get(0).dataExportId()); + Assertions.assertEquals("jbpzvgnwzsymg", model.value().get(0).tableNames().get(0)); + Assertions.assertTrue(model.value().get(0).enable()); + Assertions.assertEquals("ivyqniwbybrkxvd", model.value().get(0).createdDate()); + Assertions.assertEquals("jgrtfwvukxga", model.value().get(0).lastModifiedDate()); + Assertions.assertEquals("hab", model.value().get(0).resourceId()); + Assertions.assertEquals("xwczbyscnp", model.value().get(0).eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java index 02615cd49ba4..d06950c1fe67 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java @@ -13,33 +13,33 @@ public final class DataExportPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataExportProperties model = BinaryData.fromString( - "{\"dataExportId\":\"svexcsonpclhoco\",\"tableNames\":[\"lkevle\",\"gz\"],\"destination\":{\"resourceId\":\"u\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"axkffei\"}},\"enable\":false,\"createdDate\":\"vmezy\",\"lastModifiedDate\":\"hxmzsbbzoggig\"}") + "{\"dataExportId\":\"qduujitcjczdz\",\"tableNames\":[\"ndhkrw\",\"d\",\"ppdsbdkvwrwj\"],\"destination\":{\"resourceId\":\"usnhutje\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"dhugjzzdatqxhocd\"}},\"enable\":true,\"createdDate\":\"lgphu\",\"lastModifiedDate\":\"cndvkaozwyiftyhx\"}") .toObject(DataExportProperties.class); - Assertions.assertEquals("svexcsonpclhoco", model.dataExportId()); - Assertions.assertEquals("lkevle", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("vmezy", model.createdDate()); - Assertions.assertEquals("hxmzsbbzoggig", model.lastModifiedDate()); - Assertions.assertEquals("u", model.resourceId()); - Assertions.assertEquals("axkffei", model.eventHubName()); + Assertions.assertEquals("qduujitcjczdz", model.dataExportId()); + Assertions.assertEquals("ndhkrw", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("lgphu", model.createdDate()); + Assertions.assertEquals("cndvkaozwyiftyhx", model.lastModifiedDate()); + Assertions.assertEquals("usnhutje", model.resourceId()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataExportProperties model = new DataExportProperties().withDataExportId("svexcsonpclhoco") - .withTableNames(Arrays.asList("lkevle", "gz")) - .withEnable(false) - .withCreatedDate("vmezy") - .withLastModifiedDate("hxmzsbbzoggig") - .withResourceId("u") - .withEventHubName("axkffei"); + DataExportProperties model = new DataExportProperties().withDataExportId("qduujitcjczdz") + .withTableNames(Arrays.asList("ndhkrw", "d", "ppdsbdkvwrwj")) + .withEnable(true) + .withCreatedDate("lgphu") + .withLastModifiedDate("cndvkaozwyiftyhx") + .withResourceId("usnhutje") + .withEventHubName("dhugjzzdatqxhocd"); model = BinaryData.fromObject(model).toObject(DataExportProperties.class); - Assertions.assertEquals("svexcsonpclhoco", model.dataExportId()); - Assertions.assertEquals("lkevle", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("vmezy", model.createdDate()); - Assertions.assertEquals("hxmzsbbzoggig", model.lastModifiedDate()); - Assertions.assertEquals("u", model.resourceId()); - Assertions.assertEquals("axkffei", model.eventHubName()); + Assertions.assertEquals("qduujitcjczdz", model.dataExportId()); + Assertions.assertEquals("ndhkrw", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("lgphu", model.createdDate()); + Assertions.assertEquals("cndvkaozwyiftyhx", model.lastModifiedDate()); + Assertions.assertEquals("usnhutje", model.resourceId()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java index fd97979e9f33..5089be2ae13d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataExport; @@ -22,33 +22,33 @@ public final class DataExportsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataExportId\":\"lfmk\",\"tableNames\":[\"cazuaw\",\"tzxpuamwabzxrv\",\"cush\",\"phai\"],\"destination\":{\"resourceId\":\"xyasflvgsgzw\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"ihknsmjbl\"}},\"enable\":true,\"createdDate\":\"lnymzotqy\",\"lastModifiedDate\":\"uzcbmqq\"},\"id\":\"xmvwfg\",\"name\":\"ayxonsupeujl\",\"type\":\"qnhcvsqltnzoibg\"}"; + = "{\"properties\":{\"dataExportId\":\"crwnamikz\",\"tableNames\":[\"rqbsmswziq\",\"fuhok\",\"ruswhv\"],\"destination\":{\"resourceId\":\"zznvfbyc\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"wix\"}},\"enable\":true,\"createdDate\":\"wmxqhndvnoamlds\",\"lastModifiedDate\":\"aohdjh\"},\"id\":\"flzokxco\",\"name\":\"pelnjetag\",\"type\":\"tsxoatftgz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataExport response = manager.dataExports() - .define("igjkskyrio") - .withExistingWorkspace("hv", "slkvntjl") - .withDataExportId("idsxwaabzmifry") - .withTableNames(Arrays.asList("nmmaxrizkzob", "opxlhslnelxieixy", "llxecwc", "ojphslhc")) + .define("qwhix") + .withExistingWorkspace("rtixokff", "yinljqe") + .withDataExportId("stshiy") + .withTableNames(Arrays.asList("velfcldu", "cb")) .withEnable(true) - .withCreatedDate("n") - .withLastModifiedDate("ujeickp") - .withResourceId("jutifdwfmvigorqj") - .withEventHubName("raglk") + .withCreatedDate("tmninw") + .withLastModifiedDate("zcilnghg") + .withResourceId("ds") + .withEventHubName("b") .create(); - Assertions.assertEquals("lfmk", response.dataExportId()); - Assertions.assertEquals("cazuaw", response.tableNames().get(0)); - Assertions.assertEquals(true, response.enable()); - Assertions.assertEquals("lnymzotqy", response.createdDate()); - Assertions.assertEquals("uzcbmqq", response.lastModifiedDate()); - Assertions.assertEquals("xyasflvgsgzw", response.resourceId()); - Assertions.assertEquals("ihknsmjbl", response.eventHubName()); + Assertions.assertEquals("crwnamikz", response.dataExportId()); + Assertions.assertEquals("rqbsmswziq", response.tableNames().get(0)); + Assertions.assertTrue(response.enable()); + Assertions.assertEquals("wmxqhndvnoamlds", response.createdDate()); + Assertions.assertEquals("aohdjh", response.lastModifiedDate()); + Assertions.assertEquals("zznvfbyc", response.resourceId()); + Assertions.assertEquals("wix", response.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java index aa6e5e28ee07..f4d201295f7d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.dataExports() - .deleteWithResponse("cfhmlrqryxyn", "nzrdpsovwxz", "ptgoeiybbabp", com.azure.core.util.Context.NONE); + .deleteWithResponse("gicgaaoepttaq", "tdewemxswvruu", "zzjgehkfki", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java index 7cc8ab74fe0b..4130ea85ff98 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataExport; @@ -21,24 +21,25 @@ public final class DataExportsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataExportId\":\"sdaultxij\",\"tableNames\":[\"mfqwa\"],\"destination\":{\"resourceId\":\"nqnm\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"qdqx\"}},\"enable\":false,\"createdDate\":\"gny\",\"lastModifiedDate\":\"sf\"},\"id\":\"svtui\",\"name\":\"zh\",\"type\":\"jqg\"}"; + = "{\"properties\":{\"dataExportId\":\"wbuqn\",\"tableNames\":[\"phzfylsgcrp\",\"bcunezzceze\",\"fwyfwlwxjwet\"],\"destination\":{\"resourceId\":\"sihclafzvaylp\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"wztcmwqkchc\"}},\"enable\":false,\"createdDate\":\"fewz\",\"lastModifiedDate\":\"jexfdeqvhp\"},\"id\":\"ylkkshkbffmbm\",\"name\":\"zjrgyww\",\"type\":\"gjxsnptfu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - DataExport response - = manager.dataExports().getWithResponse("jg", "yexaoguy", "i", com.azure.core.util.Context.NONE).getValue(); + DataExport response = manager.dataExports() + .getWithResponse("nsnvpd", "bmikost", "z", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("sdaultxij", response.dataExportId()); - Assertions.assertEquals("mfqwa", response.tableNames().get(0)); - Assertions.assertEquals(false, response.enable()); - Assertions.assertEquals("gny", response.createdDate()); - Assertions.assertEquals("sf", response.lastModifiedDate()); - Assertions.assertEquals("nqnm", response.resourceId()); - Assertions.assertEquals("qdqx", response.eventHubName()); + Assertions.assertEquals("wbuqn", response.dataExportId()); + Assertions.assertEquals("phzfylsgcrp", response.tableNames().get(0)); + Assertions.assertFalse(response.enable()); + Assertions.assertEquals("fewz", response.createdDate()); + Assertions.assertEquals("jexfdeqvhp", response.lastModifiedDate()); + Assertions.assertEquals("sihclafzvaylp", response.resourceId()); + Assertions.assertEquals("wztcmwqkchc", response.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java index 87c97ad27ebf..1a604d6c6a7b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataExport; @@ -22,24 +22,24 @@ public final class DataExportsListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"dataExportId\":\"iljhahz\",\"tableNames\":[\"chndbnwie\",\"olewjwi\",\"ubwefqs\",\"ap\"],\"destination\":{\"resourceId\":\"tf\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"ex\"}},\"enable\":true,\"createdDate\":\"xap\",\"lastModifiedDate\":\"og\"},\"id\":\"qnobp\",\"name\":\"dcdab\",\"type\":\"qwpwyawbzasqbuc\"}]}"; + = "{\"value\":[{\"properties\":{\"dataExportId\":\"qpofvwbc\",\"tableNames\":[\"embnkbw\",\"qvxkd\",\"vqihebwtswbzuwf\",\"duragegizvc\"],\"destination\":{\"resourceId\":\"elisdjub\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"gkxkbsazgakg\"}},\"enable\":true,\"createdDate\":\"cmjdmspof\",\"lastModifiedDate\":\"vuhrylni\"},\"id\":\"frzgbzjed\",\"name\":\"st\",\"type\":\"vnlvxbcuiiznktwf\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.dataExports().listByWorkspace("zejnhl", "kpbz", com.azure.core.util.Context.NONE); + = manager.dataExports().listByWorkspace("iiqbi", "htmwwinh", com.azure.core.util.Context.NONE); - Assertions.assertEquals("iljhahz", response.iterator().next().dataExportId()); - Assertions.assertEquals("chndbnwie", response.iterator().next().tableNames().get(0)); - Assertions.assertEquals(true, response.iterator().next().enable()); - Assertions.assertEquals("xap", response.iterator().next().createdDate()); - Assertions.assertEquals("og", response.iterator().next().lastModifiedDate()); - Assertions.assertEquals("tf", response.iterator().next().resourceId()); - Assertions.assertEquals("ex", response.iterator().next().eventHubName()); + Assertions.assertEquals("qpofvwbc", response.iterator().next().dataExportId()); + Assertions.assertEquals("embnkbw", response.iterator().next().tableNames().get(0)); + Assertions.assertTrue(response.iterator().next().enable()); + Assertions.assertEquals("cmjdmspof", response.iterator().next().createdDate()); + Assertions.assertEquals("vuhrylni", response.iterator().next().lastModifiedDate()); + Assertions.assertEquals("elisdjub", response.iterator().next().resourceId()); + Assertions.assertEquals("gkxkbsazgakg", response.iterator().next().eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java index e4167ab17473..2d28f321fc85 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java @@ -15,23 +15,23 @@ public final class DataSourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataSourceInner model = BinaryData.fromString( - "{\"properties\":\"datakbldngkpocipa\",\"etag\":\"xoegukgjnpiucgy\",\"kind\":\"LinuxChangeTrackingPath\",\"tags\":{\"izcdrqjsd\":\"zntypmrb\",\"cwif\":\"ydnfyhxdeoejz\"},\"id\":\"jttgzf\",\"name\":\"ishc\",\"type\":\"khaj\"}") + "{\"properties\":\"dataasy\",\"etag\":\"nddhsgcbacph\",\"kind\":\"ChangeTrackingRegistry\",\"tags\":{\"ndlik\":\"tynqgoul\"},\"id\":\"yqkgfg\",\"name\":\"bmadgak\",\"type\":\"qsrxybzqqed\"}") .toObject(DataSourceInner.class); - Assertions.assertEquals("xoegukgjnpiucgy", model.etag()); - Assertions.assertEquals(DataSourceKind.LINUX_CHANGE_TRACKING_PATH, model.kind()); - Assertions.assertEquals("zntypmrb", model.tags().get("izcdrqjsd")); + Assertions.assertEquals("nddhsgcbacph", model.etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_REGISTRY, model.kind()); + Assertions.assertEquals("tynqgoul", model.tags().get("ndlik")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataSourceInner model = new DataSourceInner().withProperties("datakbldngkpocipa") - .withEtag("xoegukgjnpiucgy") - .withKind(DataSourceKind.LINUX_CHANGE_TRACKING_PATH) - .withTags(mapOf("izcdrqjsd", "zntypmrb", "cwif", "ydnfyhxdeoejz")); + DataSourceInner model = new DataSourceInner().withProperties("dataasy") + .withEtag("nddhsgcbacph") + .withKind(DataSourceKind.CHANGE_TRACKING_REGISTRY) + .withTags(mapOf("ndlik", "tynqgoul")); model = BinaryData.fromObject(model).toObject(DataSourceInner.class); - Assertions.assertEquals("xoegukgjnpiucgy", model.etag()); - Assertions.assertEquals(DataSourceKind.LINUX_CHANGE_TRACKING_PATH, model.kind()); - Assertions.assertEquals("zntypmrb", model.tags().get("izcdrqjsd")); + Assertions.assertEquals("nddhsgcbacph", model.etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_REGISTRY, model.kind()); + Assertions.assertEquals("tynqgoul", model.tags().get("ndlik")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java index 6432973976d0..8b745c80d1fe 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java @@ -17,42 +17,36 @@ public final class DataSourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataSourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":\"dataeamdp\",\"etag\":\"g\",\"kind\":\"CustomLog\",\"tags\":{\"ow\":\"uxwgipwho\",\"injep\":\"gshwankixz\"},\"id\":\"ttmrywnuzoqf\",\"name\":\"iyqzrnk\",\"type\":\"qvyxlwhzlsicoho\"},{\"properties\":\"dataqnwvlrya\",\"etag\":\"hheunmmqhgyx\",\"kind\":\"ChangeTrackingDataTypeConfiguration\",\"tags\":{\"conuqszfkbeype\":\"ocukoklyax\"},\"id\":\"rmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"},{\"properties\":\"dataqylihkaetckt\",\"etag\":\"civfsnkymuctq\",\"kind\":\"SqlDataClassification\",\"tags\":{\"fuwutttxf\":\"ebrjcxe\",\"hfnljkyq\":\"jrbirphxepcyv\",\"uujqgidokgjljyo\":\"j\",\"bgsncghkjeszzhb\":\"gvcl\"},\"id\":\"jhtxfvgxbfsmxne\",\"name\":\"mpvecxgodebfqk\",\"type\":\"rbmpukgri\"},{\"properties\":\"dataflz\",\"etag\":\"bxzpuzycisp\",\"kind\":\"CustomLogCollection\",\"tags\":{\"hibnuqqkpika\":\"hmgkbrpyy\",\"buynhijggm\":\"rgvtqag\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}],\"nextLink\":\"tdbhrbnla\"}") + "{\"value\":[{\"properties\":\"databciqfouflm\",\"etag\":\"kzsmodm\",\"kind\":\"ChangeTrackingServices\",\"tags\":{\"uqktap\":\"gpbkwtmut\",\"kdosvqw\":\"pwgcuertu\"},\"id\":\"bmdg\",\"name\":\"bjf\",\"type\":\"dgmb\"},{\"properties\":\"databexppb\",\"etag\":\"q\",\"kind\":\"ChangeTrackingContentLocation\",\"tags\":{\"jgzjaoyfhrtx\":\"fpfpsalgbquxigj\"},\"id\":\"lnerkujysvleju\",\"name\":\"fqawrlyxw\",\"type\":\"kcprbnw\"},{\"properties\":\"dataxgjvtbv\",\"etag\":\"sszdnru\",\"kind\":\"SecurityEventCollectionConfiguration\",\"tags\":{\"uitnwuiz\":\"hmuouqfprwzwbn\",\"x\":\"a\",\"hr\":\"fizuckyf\",\"zwdzuh\":\"idf\"},\"id\":\"ymwisdkft\",\"name\":\"wxmnteiwao\",\"type\":\"vkmijcmmxdcuf\"}],\"nextLink\":\"srp\"}") .toObject(DataSourceListResult.class); - Assertions.assertEquals("g", model.value().get(0).etag()); - Assertions.assertEquals(DataSourceKind.CUSTOM_LOG, model.value().get(0).kind()); - Assertions.assertEquals("uxwgipwho", model.value().get(0).tags().get("ow")); - Assertions.assertEquals("tdbhrbnla", model.nextLink()); + Assertions.assertEquals("kzsmodm", model.value().get(0).etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_SERVICES, model.value().get(0).kind()); + Assertions.assertEquals("gpbkwtmut", model.value().get(0).tags().get("uqktap")); + Assertions.assertEquals("srp", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataSourceListResult model - = new DataSourceListResult() - .withValue(Arrays.asList( - new DataSourceInner().withProperties("dataeamdp") - .withEtag("g") - .withKind(DataSourceKind.CUSTOM_LOG) - .withTags(mapOf("ow", "uxwgipwho", "injep", "gshwankixz")), - new DataSourceInner().withProperties("dataqnwvlrya") - .withEtag("hheunmmqhgyx") - .withKind(DataSourceKind.CHANGE_TRACKING_DATA_TYPE_CONFIGURATION) - .withTags(mapOf("conuqszfkbeype", "ocukoklyax")), - new DataSourceInner().withProperties("dataqylihkaetckt") - .withEtag("civfsnkymuctq") - .withKind(DataSourceKind.SQL_DATA_CLASSIFICATION) - .withTags(mapOf("fuwutttxf", "ebrjcxe", "hfnljkyq", "jrbirphxepcyv", "uujqgidokgjljyo", "j", - "bgsncghkjeszzhb", "gvcl")), - new DataSourceInner().withProperties("dataflz") - .withEtag("bxzpuzycisp") - .withKind(DataSourceKind.CUSTOM_LOG_COLLECTION) - .withTags(mapOf("hibnuqqkpika", "hmgkbrpyy", "buynhijggm", "rgvtqag")))) - .withNextLink("tdbhrbnla"); + DataSourceListResult model = new DataSourceListResult() + .withValue(Arrays.asList( + new DataSourceInner().withProperties("databciqfouflm") + .withEtag("kzsmodm") + .withKind(DataSourceKind.CHANGE_TRACKING_SERVICES) + .withTags(mapOf("uqktap", "gpbkwtmut", "kdosvqw", "pwgcuertu")), + new DataSourceInner().withProperties("databexppb") + .withEtag("q") + .withKind(DataSourceKind.CHANGE_TRACKING_CONTENT_LOCATION) + .withTags(mapOf("jgzjaoyfhrtx", "fpfpsalgbquxigj")), + new DataSourceInner().withProperties("dataxgjvtbv") + .withEtag("sszdnru") + .withKind(DataSourceKind.SECURITY_EVENT_COLLECTION_CONFIGURATION) + .withTags(mapOf("uitnwuiz", "hmuouqfprwzwbn", "x", "a", "hr", "fizuckyf", "zwdzuh", "idf")))) + .withNextLink("srp"); model = BinaryData.fromObject(model).toObject(DataSourceListResult.class); - Assertions.assertEquals("g", model.value().get(0).etag()); - Assertions.assertEquals(DataSourceKind.CUSTOM_LOG, model.value().get(0).kind()); - Assertions.assertEquals("uxwgipwho", model.value().get(0).tags().get("ow")); - Assertions.assertEquals("tdbhrbnla", model.nextLink()); + Assertions.assertEquals("kzsmodm", model.value().get(0).etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_SERVICES, model.value().get(0).kind()); + Assertions.assertEquals("gpbkwtmut", model.value().get(0).tags().get("uqktap")); + Assertions.assertEquals("srp", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java index c82310019a03..94d9917c64f4 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSource; @@ -24,27 +24,27 @@ public final class DataSourcesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":\"dataejjtbxqmul\",\"etag\":\"lxqzvn\",\"kind\":\"ChangeTrackingDataTypeConfiguration\",\"tags\":{\"qbsms\":\"ycucrwnamikzeb\",\"kzruswh\":\"ziqgfuh\",\"ycjsx\":\"hczznvf\",\"xqhndvnoamlds\":\"wwixzvumw\"},\"id\":\"haohdjhhflzokxc\",\"name\":\"xpelnjetagltsx\",\"type\":\"atftgzpnpbsw\"}"; + = "{\"properties\":\"datactctbrxkjz\",\"etag\":\"gxffmshkwf\",\"kind\":\"CustomLogCollection\",\"tags\":{\"clnapxbiygnugjkn\":\"zxwopdbydpizq\",\"oiquvrehmrnjhvs\":\"smfcttuxuuyilfl\"},\"id\":\"jztczytqj\",\"name\":\"w\",\"type\":\"auunfprnjletlx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataSource response = manager.dataSources() - .define("jx") - .withExistingWorkspace("bffmbmxz", "rgywwp") - .withProperties("datanptfujgi") - .withKind(DataSourceKind.LINUX_SYSLOG) - .withTags(mapOf("gehkfkimrtixokff", "mxswvruunzz", "qwhix", "yinljqe", "i", "onsts")) - .withEtag("aaoepttaqut") + .define("wfl") + .withExistingWorkspace("p", "gqoweyirdhlisn") + .withProperties("dataqmp") + .withKind(DataSourceKind.CHANGE_TRACKING_PATH) + .withTags(mapOf("xtmkzjvkviir", "ngjsaasi")) + .withEtag("ruwnpqxpx") .create(); - Assertions.assertEquals("lxqzvn", response.etag()); - Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_DATA_TYPE_CONFIGURATION, response.kind()); - Assertions.assertEquals("ycucrwnamikzeb", response.tags().get("qbsms")); + Assertions.assertEquals("gxffmshkwf", response.etag()); + Assertions.assertEquals(DataSourceKind.CUSTOM_LOG_COLLECTION, response.kind()); + Assertions.assertEquals("zxwopdbydpizq", response.tags().get("clnapxbiygnugjkn")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java index d578c9558375..d54dcb41f86a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.dataSources() - .deleteWithResponse("xgnxfyqonmpqoxwd", "fdbxiqxeiiqbim", "tmwwi", com.azure.core.util.Context.NONE); + manager.dataSources().deleteWithResponse("npbs", "vefloccsrmozihmi", "g", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java index 59d8090c48f3..54519497c59e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSource; @@ -22,21 +22,21 @@ public final class DataSourcesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":\"datakbwvqvxkdiv\",\"etag\":\"heb\",\"kind\":\"ChangeTrackingRegistry\",\"tags\":{\"gi\":\"bzuwfmdurag\",\"igkxkbsazga\":\"vcjfelisdjubggb\",\"apvu\":\"gacyrcmjdmspo\",\"zjedmstkvnlv\":\"rylniofrzg\"},\"id\":\"bcuiiz\",\"name\":\"ktwfa\",\"type\":\"snvpdibmi\"}"; + = "{\"properties\":\"dataztrksxwpndf\",\"etag\":\"fnznth\",\"kind\":\"SecurityEventCollectionConfiguration\",\"tags\":{\"amktcqiosmgbzah\":\"jaosrxuzv\",\"tz\":\"xqdlyrtltlapr\",\"s\":\"atbhjmznn\"},\"id\":\"qeqala\",\"name\":\"vlagun\",\"type\":\"tgfebwln\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataSource response = manager.dataSources() - .getWithResponse("h", "hfqpofv", "bcblemb", com.azure.core.util.Context.NONE) + .getWithResponse("wtxxpkyjcx", "jxgrytfmp", "ycilrmcaykggnox", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("heb", response.etag()); - Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_REGISTRY, response.kind()); - Assertions.assertEquals("bzuwfmdurag", response.tags().get("gi")); + Assertions.assertEquals("fnznth", response.etag()); + Assertions.assertEquals(DataSourceKind.SECURITY_EVENT_COLLECTION_CONFIGURATION, response.kind()); + Assertions.assertEquals("jaosrxuzv", response.tags().get("amktcqiosmgbzah")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java index 00be625a916f..e89ecf5dc62f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSource; @@ -23,20 +23,20 @@ public final class DataSourcesListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":\"datalfwyfwlwxjwetn\",\"etag\":\"ihclafzv\",\"kind\":\"WindowsPerformanceCounter\",\"tags\":{\"tcmwqkchc\":\"trsqqw\"},\"id\":\"waxfewzjkj\",\"name\":\"xfdeqvhpsyl\",\"type\":\"ksh\"}]}"; + = "{\"value\":[{\"properties\":\"dataqtobaxkjeyt\",\"etag\":\"lbfjkwr\",\"kind\":\"ChangeTrackingContentLocation\",\"tags\":{\"njqhdenxa\":\"qbhsyrq\"},\"id\":\"l\",\"name\":\"pakdkifmjnnawt\",\"type\":\"abpxuc\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.dataSources() - .listByWorkspace("ostbzbkiwb", "qnyophzfyls", "crpfbcunez", "cez", com.azure.core.util.Context.NONE); + .listByWorkspace("mhyreeudz", "av", "pdqmjxlyyzglgouw", "lmjjyuo", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ihclafzv", response.iterator().next().etag()); - Assertions.assertEquals(DataSourceKind.WINDOWS_PERFORMANCE_COUNTER, response.iterator().next().kind()); - Assertions.assertEquals("trsqqw", response.iterator().next().tags().get("tcmwqkchc")); + Assertions.assertEquals("lbfjkwr", response.iterator().next().etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_CONTENT_LOCATION, response.iterator().next().kind()); + Assertions.assertEquals("qbhsyrq", response.iterator().next().tags().get("njqhdenxa")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java index 0a2347b703b1..58b23a2b1a39 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,38 +25,38 @@ public final class DeletedWorkspacesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"customerId\":\"qyn\",\"sku\":{\"name\":\"Standalone\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"aq\"},\"retentionInDays\":530847681,\"workspaceCapping\":{\"dailyQuotaGb\":80.1550882239485,\"quotaNextResetTime\":\"hwddkvbxgkq\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"w\",\"modifiedDate\":\"dacarvvlfnty\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"erohzrsqalsxkdn\",\"scopeId\":\"apfgsdpcvessm\"},{\"resourceId\":\"h\",\"scopeId\":\"uipldqq\"},{\"resourceId\":\"ekvalblhtjq\",\"scopeId\":\"yvwehtaemxh\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"ivzrrryveimipsk\",\"disableLocalAuth\":true,\"\":{\"tjvv\":\"datavfuzka\"}},\"defaultDataCollectionRuleResourceId\":\"xwigsye\"},\"identity\":{\"principalId\":\"dsmjtgr\",\"tenantId\":\"dgkkile\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ygbdgwumgxdgdhpa\":{\"principalId\":\"mknhwtbbaedor\",\"clientId\":\"mqfl\"},\"tefhexcgjokjl\":{\"principalId\":\"dexjddvjs\",\"clientId\":\"wotmmwllcolsrsxa\"}}},\"systemData\":{\"createdBy\":\"v\",\"createdByType\":\"Key\",\"createdAt\":\"2021-11-03T13:01:45Z\",\"lastModifiedBy\":\"peeksnbksdqhjv\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-07-06T01:14:39Z\"},\"etag\":\"lkhhu\",\"location\":\"tcpoqma\",\"tags\":{\"jkxyb\":\"qjwgoknlej\",\"jbzten\":\"fdb\"},\"id\":\"vkzykjtjknsxf\",\"name\":\"us\",\"type\":\"cdp\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"uqndaizupfkhuy\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":1048467054,\"lastSkuUpdate\":\"2021-11-22T12:40:39Z\"},\"retentionInDays\":1254328830,\"workspaceCapping\":{\"dailyQuotaGb\":12.895250494222898,\"quotaNextResetTime\":\"qiukvzwyd\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"2021-02-07T19:45:29Z\",\"modifiedDate\":\"2021-08-08T18:31:32Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"shajqf\",\"scopeId\":\"peexpgeumilhwuit\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"fninbdbzs\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"mpcbbprtugav\",\"zbcyksiv\"],\"tbfcm\":\"datagd\"},\"defaultDataCollectionRuleResourceId\":\"ftsjcwj\",\"replication\":{\"location\":\"gmbawvifdxk\",\"enabled\":false,\"provisioningState\":\"RollingBack\",\"createdDate\":\"2021-01-30T06:13:56Z\",\"lastModifiedDate\":\"2021-11-01T17:33:31Z\"},\"failover\":{\"state\":\"Activating\",\"lastModifiedDate\":\"2021-08-18T18:47:44Z\"}},\"identity\":{\"principalId\":\"txvcm\",\"tenantId\":\"unlcpxxv\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"iahxmfqryarvs\":{\"principalId\":\"ngjgvrquvpyg\",\"clientId\":\"pmcrdcuelj\"},\"tgblioskkfmk\":{\"principalId\":\"qbglcjkaysp\",\"clientId\":\"zodubtlm\"}}},\"etag\":\"jxyxgb\",\"location\":\"kqvjcteoedlr\",\"tags\":{\"pxvjnzd\":\"kk\",\"pcnab\":\"vocoj\",\"nggy\":\"zf\",\"vzilmhiv\":\"e\"},\"id\":\"kwwwnckn\",\"name\":\"zdajlskzptjxu\",\"type\":\"weucyrth\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.deletedWorkspaces().listByResourceGroup("djus", com.azure.core.util.Context.NONE); + = manager.deletedWorkspaces().listByResourceGroup("ldtzmpypefcp", com.azure.core.util.Context.NONE); - Assertions.assertEquals("tcpoqma", response.iterator().next().location()); - Assertions.assertEquals("qjwgoknlej", response.iterator().next().tags().get("jkxyb")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("lkhhu", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(530847681, response.iterator().next().retentionInDays()); - Assertions.assertEquals(80.1550882239485D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("kqvjcteoedlr", response.iterator().next().location()); + Assertions.assertEquals("kk", response.iterator().next().tags().get("pxvjnzd")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals("jxyxgb", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); + Assertions.assertEquals(1048467054, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(1254328830, response.iterator().next().retentionInDays()); + Assertions.assertEquals(12.895250494222898D, response.iterator().next().workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.iterator().next().publicNetworkAccessForIngestion()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(false, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("ivzrrryveimipsk", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("xwigsye", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertFalse(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertFalse(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("fninbdbzs", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("ftsjcwj", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("gmbawvifdxk", response.iterator().next().replication().location()); + Assertions.assertFalse(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java index 891c3528ebe5..fc8bf7ed34a5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,37 +25,37 @@ public final class DeletedWorkspacesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"customerId\":\"ztwhghmupg\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"xabb\"},\"retentionInDays\":1038396263,\"workspaceCapping\":{\"dailyQuotaGb\":38.243065707057745,\"quotaNextResetTime\":\"bbklqpxzuca\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"wwnlzafwxudgnh\",\"modifiedDate\":\"okrtalvnb\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"lvdjjukyr\",\"scopeId\":\"qo\"},{\"resourceId\":\"ahhxhqfaqnvzoqg\",\"scopeId\":\"pem\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"ejdtxptl\",\"disableLocalAuth\":true,\"\":{\"j\":\"dataomew\",\"uhqawmoaianc\":\"datatl\",\"blxydkxr\":\"datanvodrrs\"}},\"defaultDataCollectionRuleResourceId\":\"vbxiwkgfbqlj\"},\"identity\":{\"principalId\":\"hychocokuleh\",\"tenantId\":\"qlrqffaweyurk\",\"type\":\"key\",\"userAssignedIdentities\":{\"rxmrgchbapx\":{\"principalId\":\"xra\",\"clientId\":\"uqd\"},\"bajbuscgduusi\":{\"principalId\":\"y\",\"clientId\":\"j\"},\"kyxl\":{\"principalId\":\"cblevpmc\",\"clientId\":\"jy\"},\"vdwnapfdqwowft\":{\"principalId\":\"sjgkzzltafh\",\"clientId\":\"ffovwmbjlzqsczp\"}}},\"systemData\":{\"createdBy\":\"uwjtks\",\"createdByType\":\"Key\",\"createdAt\":\"2021-07-07T02:15:20Z\",\"lastModifiedBy\":\"y\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-04-28T02:09:32Z\"},\"etag\":\"q\",\"location\":\"hvyeldotj\",\"tags\":{\"spkxkdt\":\"wiswskukjtasbvw\",\"vtwknvgmmbugt\":\"fkndl\",\"kueatgroeshoy\":\"watmqa\",\"kfaoytehq\":\"zcbyfq\"},\"id\":\"uvjmv\",\"name\":\"mtdwcky\",\"type\":\"roejnndl\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"togmhmjpjscdfpd\",\"sku\":{\"name\":\"CapacityReservation\",\"capacityReservationLevel\":1893346412,\"lastSkuUpdate\":\"2021-07-14T18:14:24Z\"},\"retentionInDays\":1189635916,\"workspaceCapping\":{\"dailyQuotaGb\":44.46311972703302,\"quotaNextResetTime\":\"rxifvqnrx\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"2020-12-23T21:27:45Z\",\"modifiedDate\":\"2021-09-18T16:52:07Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"qpxlb\",\"scopeId\":\"akftng\"},{\"resourceId\":\"wmykyutry\",\"scopeId\":\"wmfjhp\"},{\"resourceId\":\"vjqdvdwkq\",\"scopeId\":\"drlefgnaavuag\"},{\"resourceId\":\"etaoutnpdc\",\"scopeId\":\"hspfefyihd\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"mtybkcgsu\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"wynefx\",\"x\",\"fciatxtjrr\",\"kmdskjhhxd\"],\"cvslxlhuavkrmukm\":\"datafoxcx\",\"qid\":\"datajmkxettcslojf\",\"tkbtnqlrngl\":\"dataqtoqxjhqxcsq\",\"nxhhl\":\"datambiipsnawwlqk\"},\"defaultDataCollectionRuleResourceId\":\"ricctkwmuqqoa\",\"replication\":{\"location\":\"iygle\",\"enabled\":true,\"provisioningState\":\"RollbackRequested\",\"createdDate\":\"2021-08-22T14:39:56Z\",\"lastModifiedDate\":\"2021-01-05T18:05:21Z\"},\"failover\":{\"state\":\"Active\",\"lastModifiedDate\":\"2021-01-06T05:50:32Z\"}},\"identity\":{\"principalId\":\"kbrup\",\"tenantId\":\"ehdmljzacvumep\",\"type\":\"None\",\"userAssignedIdentities\":{\"cjclykcgxv\":{\"principalId\":\"nzpphepife\",\"clientId\":\"eqir\"},\"u\":{\"principalId\":\"jlvczu\",\"clientId\":\"ac\"}}},\"etag\":\"tepdjxqes\",\"location\":\"oy\",\"tags\":{\"skwxe\":\"ylpckaewsedv\",\"fn\":\"qphr\"},\"id\":\"hctmjtsgh\",\"name\":\"bcbcpz\",\"type\":\"rpzeqac\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.deletedWorkspaces().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("hvyeldotj", response.iterator().next().location()); - Assertions.assertEquals("wiswskukjtasbvw", response.iterator().next().tags().get("spkxkdt")); - Assertions.assertEquals(IdentityType.KEY, response.iterator().next().identity().type()); - Assertions.assertEquals("q", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(1038396263, response.iterator().next().retentionInDays()); - Assertions.assertEquals(38.243065707057745D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("oy", response.iterator().next().location()); + Assertions.assertEquals("ylpckaewsedv", response.iterator().next().tags().get("skwxe")); + Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); + Assertions.assertEquals("tepdjxqes", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, response.iterator().next().sku().name()); + Assertions.assertEquals(1893346412, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(1189635916, response.iterator().next().retentionInDays()); + Assertions.assertEquals(44.46311972703302D, response.iterator().next().workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(true, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("ejdtxptl", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("vbxiwkgfbqlj", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertTrue(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertTrue(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("mtybkcgsu", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("ricctkwmuqqoa", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("iygle", response.iterator().next().replication().location()); + Assertions.assertTrue(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java index 3a73f10f1616..76c288c6e4d9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java @@ -12,14 +12,14 @@ public final class DestinationMetadataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DestinationMetadata model - = BinaryData.fromString("{\"eventHubName\":\"uknvudwti\"}").toObject(DestinationMetadata.class); - Assertions.assertEquals("uknvudwti", model.eventHubName()); + = BinaryData.fromString("{\"eventHubName\":\"kgiawxklryplwck\"}").toObject(DestinationMetadata.class); + Assertions.assertEquals("kgiawxklryplwck", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DestinationMetadata model = new DestinationMetadata().withEventHubName("uknvudwti"); + DestinationMetadata model = new DestinationMetadata().withEventHubName("kgiawxklryplwck"); model = BinaryData.fromObject(model).toObject(DestinationMetadata.class); - Assertions.assertEquals("uknvudwti", model.eventHubName()); + Assertions.assertEquals("kgiawxklryplwck", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java index 4d08fdd12af4..ef10a1cda898 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java @@ -12,18 +12,17 @@ public final class DestinationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Destination model = BinaryData - .fromString( - "{\"resourceId\":\"xwburvjxxjns\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"koen\"}}") + .fromString("{\"resourceId\":\"urokft\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"iwpwcuk\"}}") .toObject(Destination.class); - Assertions.assertEquals("xwburvjxxjns", model.resourceId()); - Assertions.assertEquals("koen", model.eventHubName()); + Assertions.assertEquals("urokft", model.resourceId()); + Assertions.assertEquals("iwpwcuk", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Destination model = new Destination().withResourceId("xwburvjxxjns").withEventHubName("koen"); + Destination model = new Destination().withResourceId("urokft").withEventHubName("iwpwcuk"); model = BinaryData.fromObject(model).toObject(Destination.class); - Assertions.assertEquals("xwburvjxxjns", model.resourceId()); - Assertions.assertEquals("koen", model.eventHubName()); + Assertions.assertEquals("urokft", model.resourceId()); + Assertions.assertEquals("iwpwcuk", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java index 7b433126c9b0..98739141551f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.gateways().deleteWithResponse("jwtrhtgvgzp", "rrkolawjmjs", "wro", com.azure.core.util.Context.NONE); + manager.gateways().deleteWithResponse("mr", "ddoui", "amowaziynknlqwzd", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java index c7ff9ea8ee6d..15bb6dc73575 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java @@ -16,17 +16,18 @@ public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Identity model = BinaryData.fromString( - "{\"principalId\":\"yl\",\"tenantId\":\"ool\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"urdoi\":{\"principalId\":\"iwkkbn\",\"clientId\":\"rywvtylbfpn\"}}}") + "{\"principalId\":\"e\",\"tenantId\":\"lfg\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"duvwpklvxwmygd\":{\"principalId\":\"kwdlenrdsutujba\",\"clientId\":\"juohminyflnorw\"},\"bjcrxgibbdaxco\":{\"principalId\":\"gpqch\",\"clientId\":\"zepn\"}}}") .toObject(Identity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Identity model = new Identity().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("urdoi", new UserIdentityProperties())); + Identity model = new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("duvwpklvxwmygd", new UserIdentityProperties(), "bjcrxgibbdaxco", new UserIdentityProperties())); model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.type()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java index 9b26c589211a..8b5b484fb648 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java @@ -12,20 +12,20 @@ public final class IntelligencePackInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IntelligencePackInner model - = BinaryData.fromString("{\"name\":\"xmyskp\",\"enabled\":true,\"displayName\":\"btkcxywnytnrsyn\"}") + = BinaryData.fromString("{\"name\":\"zidnsezcxtbzsgfy\",\"enabled\":false,\"displayName\":\"ewmdw\"}") .toObject(IntelligencePackInner.class); - Assertions.assertEquals("xmyskp", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("btkcxywnytnrsyn", model.displayName()); + Assertions.assertEquals("zidnsezcxtbzsgfy", model.name()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("ewmdw", model.displayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { IntelligencePackInner model - = new IntelligencePackInner().withName("xmyskp").withEnabled(true).withDisplayName("btkcxywnytnrsyn"); + = new IntelligencePackInner().withName("zidnsezcxtbzsgfy").withEnabled(false).withDisplayName("ewmdw"); model = BinaryData.fromObject(model).toObject(IntelligencePackInner.class); - Assertions.assertEquals("xmyskp", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("btkcxywnytnrsyn", model.displayName()); + Assertions.assertEquals("zidnsezcxtbzsgfy", model.name()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("ewmdw", model.displayName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java index 5f7ab2cf0601..4c8e3becb5fb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDisableWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.intelligencePacks() - .disableWithResponse("e", "loccsrmozihm", "pgawtxxpkyjcxcjx", com.azure.core.util.Context.NONE); + .disableWithResponse("piwhxqs", "dtmaa", "quhuxylrj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java index f9cf202b49cd..bac7d11c9fe1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testEnableWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.intelligencePacks() - .enableWithResponse("rytfmpcycil", "mcayk", "gnoxuztrksx", com.azure.core.util.Context.NONE); + .enableWithResponse("m", "ygjbmzyospspsh", "kfkyjp", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java index 5055a4ea2785..9b2dbe3126ca 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.IntelligencePack; @@ -21,22 +21,21 @@ public final class IntelligencePacksListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { - String responseStr - = "[{\"name\":\"zvoamktc\",\"enabled\":false,\"displayName\":\"mgbzahgxqdlyrtl\"},{\"name\":\"ap\",\"enabled\":false,\"displayName\":\"katbhjm\"},{\"name\":\"nbsoqeqalarv\",\"enabled\":true,\"displayName\":\"nbtgfebwl\"}]"; + String responseStr = "[{\"name\":\"tvczkcnyxr\",\"enabled\":false,\"displayName\":\"jdxvglnkvxlxpa\"}]"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); List response = manager.intelligencePacks() - .listWithResponse("pndfcpfnznt", "jtwkjaos", com.azure.core.util.Context.NONE) + .listWithResponse("sp", "pssdfppyogtie", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zvoamktc", response.get(0).name()); - Assertions.assertEquals(false, response.get(0).enabled()); - Assertions.assertEquals("mgbzahgxqdlyrtl", response.get(0).displayName()); + Assertions.assertEquals("tvczkcnyxr", response.get(0).name()); + Assertions.assertFalse(response.get(0).enabled()); + Assertions.assertEquals("jdxvglnkvxlxpa", response.get(0).displayName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java index a19e21dc77ed..0cef0b25e34b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java @@ -15,25 +15,27 @@ public final class LinkedServiceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedServiceInner model = BinaryData.fromString( - "{\"properties\":{\"resourceId\":\"idybyxczf\",\"writeAccessResourceId\":\"haaxdbabphl\",\"provisioningState\":\"ProvisioningAccount\"},\"tags\":{\"azt\":\"ktsthsucocmny\"},\"id\":\"bt\",\"name\":\"wrqpue\",\"type\":\"ckzywbiexzfeyue\"}") + "{\"properties\":{\"resourceId\":\"eiachboosflnr\",\"writeAccessResourceId\":\"fqpte\",\"provisioningState\":\"Updating\"},\"tags\":{\"swjdkirso\":\"ypyqrimzinp\",\"soifiyipjxsqw\":\"dqxhcrmnohjtckwh\",\"bznorcjxvsnby\":\"gr\",\"cyshurzafbljjgp\":\"qabnmoc\"},\"id\":\"toqcjmklja\",\"name\":\"bqidtqaj\",\"type\":\"yulpkudjkr\"}") .toObject(LinkedServiceInner.class); - Assertions.assertEquals("ktsthsucocmny", model.tags().get("azt")); - Assertions.assertEquals("idybyxczf", model.resourceId()); - Assertions.assertEquals("haaxdbabphl", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT, model.provisioningState()); + Assertions.assertEquals("ypyqrimzinp", model.tags().get("swjdkirso")); + Assertions.assertEquals("eiachboosflnr", model.resourceId()); + Assertions.assertEquals("fqpte", model.writeAccessResourceId()); + Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedServiceInner model = new LinkedServiceInner().withTags(mapOf("azt", "ktsthsucocmny")) - .withResourceId("idybyxczf") - .withWriteAccessResourceId("haaxdbabphl") - .withProvisioningState(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT); + LinkedServiceInner model = new LinkedServiceInner() + .withTags(mapOf("swjdkirso", "ypyqrimzinp", "soifiyipjxsqw", "dqxhcrmnohjtckwh", "bznorcjxvsnby", "gr", + "cyshurzafbljjgp", "qabnmoc")) + .withResourceId("eiachboosflnr") + .withWriteAccessResourceId("fqpte") + .withProvisioningState(LinkedServiceEntityStatus.UPDATING); model = BinaryData.fromObject(model).toObject(LinkedServiceInner.class); - Assertions.assertEquals("ktsthsucocmny", model.tags().get("azt")); - Assertions.assertEquals("idybyxczf", model.resourceId()); - Assertions.assertEquals("haaxdbabphl", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT, model.provisioningState()); + Assertions.assertEquals("ypyqrimzinp", model.tags().get("swjdkirso")); + Assertions.assertEquals("eiachboosflnr", model.resourceId()); + Assertions.assertEquals("fqpte", model.writeAccessResourceId()); + Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java index c02e8f9b63bc..310f04aa9cbd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java @@ -17,29 +17,37 @@ public final class LinkedServiceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedServiceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resourceId\":\"aepdkzjanc\",\"writeAccessResourceId\":\"rhdwbavxbniw\",\"provisioningState\":\"Deleting\"},\"tags\":{\"ytxhp\":\"tsdbpgn\"},\"id\":\"xbzpfzab\",\"name\":\"lcuhxwtctyqiklb\",\"type\":\"ovplw\"},{\"properties\":{\"resourceId\":\"hvgyuguosvmk\",\"writeAccessResourceId\":\"sxqu\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"lpvlopw\":\"gmgsxnkjzkde\"},\"id\":\"yighxpk\",\"name\":\"wzbaiue\",\"type\":\"baumnyqupedeoj\"}]}") + "{\"value\":[{\"properties\":{\"resourceId\":\"c\",\"writeAccessResourceId\":\"ierhhbcsglummaj\",\"provisioningState\":\"Deleting\"},\"tags\":{\"jionpimexgstxgc\":\"xobnbdxkqpxok\"},\"id\":\"odgmaajrmvdjwz\",\"name\":\"lovmclwhijcoe\",\"type\":\"ctbzaq\"},{\"properties\":{\"resourceId\":\"sycbkbfk\",\"writeAccessResourceId\":\"kdkexxp\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"vpmouexhdzxib\":\"axcfjpgddtocjjx\",\"wndeicbtwnp\":\"eojnxqbzvddn\",\"hcffcyddglmjthjq\":\"aoqvuh\",\"hix\":\"wpyeicxmqciwqvh\"},\"id\":\"igdtopbob\",\"name\":\"og\",\"type\":\"m\"},{\"properties\":{\"resourceId\":\"u\",\"writeAccessResourceId\":\"a\",\"provisioningState\":\"Deleting\"},\"tags\":{\"kftutqxlngxlefg\":\"yvvtpgvdfgio\",\"rvqdra\":\"gnxkrxdqmidtth\",\"skanyk\":\"hjybigehoqfbo\"},\"id\":\"zlcuiywgqywgndrv\",\"name\":\"nhzgpphrcgyn\",\"type\":\"ocpecfvmmco\"}]}") .toObject(LinkedServiceListResult.class); - Assertions.assertEquals("tsdbpgn", model.value().get(0).tags().get("ytxhp")); - Assertions.assertEquals("aepdkzjanc", model.value().get(0).resourceId()); - Assertions.assertEquals("rhdwbavxbniw", model.value().get(0).writeAccessResourceId()); + Assertions.assertEquals("xobnbdxkqpxok", model.value().get(0).tags().get("jionpimexgstxgc")); + Assertions.assertEquals("c", model.value().get(0).resourceId()); + Assertions.assertEquals("ierhhbcsglummaj", model.value().get(0).writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, model.value().get(0).provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LinkedServiceListResult model = new LinkedServiceListResult().withValue(Arrays.asList( - new LinkedServiceInner().withTags(mapOf("ytxhp", "tsdbpgn")) - .withResourceId("aepdkzjanc") - .withWriteAccessResourceId("rhdwbavxbniw") + new LinkedServiceInner().withTags(mapOf("jionpimexgstxgc", "xobnbdxkqpxok")) + .withResourceId("c") + .withWriteAccessResourceId("ierhhbcsglummaj") .withProvisioningState(LinkedServiceEntityStatus.DELETING), - new LinkedServiceInner().withTags(mapOf("lpvlopw", "gmgsxnkjzkde")) - .withResourceId("hvgyuguosvmk") - .withWriteAccessResourceId("sxqu") - .withProvisioningState(LinkedServiceEntityStatus.SUCCEEDED))); + new LinkedServiceInner() + .withTags(mapOf("vpmouexhdzxib", "axcfjpgddtocjjx", "wndeicbtwnp", "eojnxqbzvddn", "hcffcyddglmjthjq", + "aoqvuh", "hix", "wpyeicxmqciwqvh")) + .withResourceId("sycbkbfk") + .withWriteAccessResourceId("kdkexxp") + .withProvisioningState(LinkedServiceEntityStatus.SUCCEEDED), + new LinkedServiceInner() + .withTags( + mapOf("kftutqxlngxlefg", "yvvtpgvdfgio", "rvqdra", "gnxkrxdqmidtth", "skanyk", "hjybigehoqfbo")) + .withResourceId("u") + .withWriteAccessResourceId("a") + .withProvisioningState(LinkedServiceEntityStatus.DELETING))); model = BinaryData.fromObject(model).toObject(LinkedServiceListResult.class); - Assertions.assertEquals("tsdbpgn", model.value().get(0).tags().get("ytxhp")); - Assertions.assertEquals("aepdkzjanc", model.value().get(0).resourceId()); - Assertions.assertEquals("rhdwbavxbniw", model.value().get(0).writeAccessResourceId()); + Assertions.assertEquals("xobnbdxkqpxok", model.value().get(0).tags().get("jionpimexgstxgc")); + Assertions.assertEquals("c", model.value().get(0).resourceId()); + Assertions.assertEquals("ierhhbcsglummaj", model.value().get(0).writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, model.value().get(0).provisioningState()); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java index 1921880c37b5..d9655c34abc1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java @@ -14,21 +14,21 @@ public final class LinkedServicePropertiesTests { public void testDeserialize() throws Exception { LinkedServiceProperties model = BinaryData .fromString( - "{\"resourceId\":\"ibx\",\"writeAccessResourceId\":\"wbhqwal\",\"provisioningState\":\"Updating\"}") + "{\"resourceId\":\"hbzhfepg\",\"writeAccessResourceId\":\"qex\",\"provisioningState\":\"Updating\"}") .toObject(LinkedServiceProperties.class); - Assertions.assertEquals("ibx", model.resourceId()); - Assertions.assertEquals("wbhqwal", model.writeAccessResourceId()); + Assertions.assertEquals("hbzhfepg", model.resourceId()); + Assertions.assertEquals("qex", model.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedServiceProperties model = new LinkedServiceProperties().withResourceId("ibx") - .withWriteAccessResourceId("wbhqwal") + LinkedServiceProperties model = new LinkedServiceProperties().withResourceId("hbzhfepg") + .withWriteAccessResourceId("qex") .withProvisioningState(LinkedServiceEntityStatus.UPDATING); model = BinaryData.fromObject(model).toObject(LinkedServiceProperties.class); - Assertions.assertEquals("ibx", model.resourceId()); - Assertions.assertEquals("wbhqwal", model.writeAccessResourceId()); + Assertions.assertEquals("hbzhfepg", model.resourceId()); + Assertions.assertEquals("qex", model.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java index 8aa374bd1815..d6ae94e707f5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -24,27 +24,27 @@ public final class LinkedServicesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"resourceId\":\"psw\",\"writeAccessResourceId\":\"mvkhlggd\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"jfpgpicrmn\":\"qkzszuwiwtglxxh\",\"mqgjsxvpq\":\"hr\",\"bakclacjfrnxous\":\"bfrmbodthsqqgvri\"},\"id\":\"au\",\"name\":\"lwvsgm\",\"type\":\"ohqfzizv\"}"; + = "{\"properties\":{\"resourceId\":\"n\",\"writeAccessResourceId\":\"xjawrt\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"vnekhenlusfnrdtj\":\"yccxlzhcox\",\"ttgepuslvyjtcv\":\"txrdcqtjvi\"},\"id\":\"wkasiziesf\",\"name\":\"ughtuqfecjxeygtu\",\"type\":\"xu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedService response = manager.linkedServices() - .define("yp") - .withExistingWorkspace("aglqivbgkcvkh", "zvuqdflvon") - .withTags(mapOf("fgpikqm", "bgqjxgpnrhgo")) - .withResourceId("ubcpzgpxti") - .withWriteAccessResourceId("j") - .withProvisioningState(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT) + .define("obkauxofsh") + .withExistingWorkspace("c", "uahokq") + .withTags(mapOf("gsnnf", "fgf", "coc", "yetefyp", "urmlmuo", "fjgtixrjvzuy")) + .withResourceId("hwpnulaiywzejywh") + .withWriteAccessResourceId("wkojpllndnpd") + .withProvisioningState(LinkedServiceEntityStatus.UPDATING) .create(); - Assertions.assertEquals("qkzszuwiwtglxxh", response.tags().get("jfpgpicrmn")); - Assertions.assertEquals("psw", response.resourceId()); - Assertions.assertEquals("mvkhlggd", response.writeAccessResourceId()); + Assertions.assertEquals("yccxlzhcox", response.tags().get("vnekhenlusfnrdtj")); + Assertions.assertEquals("n", response.resourceId()); + Assertions.assertEquals("xjawrt", response.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.SUCCEEDED, response.provisioningState()); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java index e12a213a1bd0..dcbd77e0b1a7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -22,21 +22,21 @@ public final class LinkedServicesDeleteMockTests { @Test public void testDelete() throws Exception { String responseStr - = "{\"properties\":{\"resourceId\":\"mjjyuojq\",\"writeAccessResourceId\":\"baxk\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"jkwrusnkq\":\"nlb\",\"hdenxaulk\":\"hsyrqunj\",\"xuckpggqoweyir\":\"akdkifmjnnawtqab\"},\"id\":\"hlisngw\",\"name\":\"lqqmpiz\",\"type\":\"uwnpqxpxiwfcng\"}"; + = "{\"properties\":{\"resourceId\":\"dibgqjxgpnrhgov\",\"writeAccessResourceId\":\"pikqmh\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"qzdfuydzvkfvxcn\":\"rmzvupo\",\"psw\":\"mx\",\"gdhbe\":\"kmvkhl\"},\"id\":\"zqkzszuwi\",\"name\":\"tglxx\",\"type\":\"ljfp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - LinkedService response - = manager.linkedServices().delete("bmhyreeudz", "av", "pdqmjxlyyzglgouw", com.azure.core.util.Context.NONE); + LinkedService response = manager.linkedServices() + .delete("lqivbgkcv", "hpzvuqdflvoniyp", "pubcpzgpxtivhjk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("nlb", response.tags().get("jkwrusnkq")); - Assertions.assertEquals("mjjyuojq", response.resourceId()); - Assertions.assertEquals("baxk", response.writeAccessResourceId()); + Assertions.assertEquals("rmzvupo", response.tags().get("qzdfuydzvkfvxcn")); + Assertions.assertEquals("dibgqjxgpnrhgov", response.resourceId()); + Assertions.assertEquals("pikqmh", response.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.SUCCEEDED, response.provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java index cc7e7adb9e22..ea01d54b8a76 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -22,22 +22,22 @@ public final class LinkedServicesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"resourceId\":\"atzv\",\"writeAccessResourceId\":\"glbyvi\",\"provisioningState\":\"Updating\"},\"tags\":{\"fbkgozxwopdby\":\"rxkjzwrgxffmshk\",\"zqaclna\":\"p\"},\"id\":\"xbiygnugjknfsmf\",\"name\":\"ttuxuuyilflqoiqu\",\"type\":\"rehmr\"}"; + = "{\"properties\":{\"resourceId\":\"rnxousxauzlwvsg\",\"writeAccessResourceId\":\"ohqfzizv\",\"provisioningState\":\"Updating\"},\"tags\":{\"mribiat\":\"jsvthnwpzteko\",\"zcugswvxwlmzqw\":\"gplucfotangcfhny\",\"cvclxynpdk\":\"vtxnjmxmcuqud\",\"neiknpg\":\"gfabuiyjibuzphdu\"},\"id\":\"xgjiuqh\",\"name\":\"btozipqwje\",\"type\":\"mur\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedService response = manager.linkedServices() - .getWithResponse("saasiixtmkzj", "kv", "irhgfgrwsdp", com.azure.core.util.Context.NONE) + .getWithResponse("picrmnzhrgmqgjsx", "pqcbfrmbodthsq", "gvriibakclac", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rxkjzwrgxffmshk", response.tags().get("fbkgozxwopdby")); - Assertions.assertEquals("atzv", response.resourceId()); - Assertions.assertEquals("glbyvi", response.writeAccessResourceId()); + Assertions.assertEquals("jsvthnwpzteko", response.tags().get("mribiat")); + Assertions.assertEquals("rnxousxauzlwvsg", response.resourceId()); + Assertions.assertEquals("ohqfzizv", response.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, response.provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java index c3737d885ea1..ee55a5c65b90 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -23,21 +23,21 @@ public final class LinkedServicesListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"resourceId\":\"njle\",\"writeAccessResourceId\":\"xsmrpddouifamow\",\"provisioningState\":\"Deleting\"},\"tags\":{\"tmaaj\":\"knlqwzdvpiwhxqsz\",\"bmzyospsps\":\"uhuxylrjvmtyg\",\"fkyjpmspbpssdfpp\":\"c\"},\"id\":\"ogtieyujtvczkcny\",\"name\":\"rxmunjdxvgln\",\"type\":\"vxlx\"}]}"; + = "{\"value\":[{\"properties\":{\"resourceId\":\"cgwgcloxoebqinji\",\"writeAccessResourceId\":\"wjfuj\",\"provisioningState\":\"Deleting\"},\"tags\":{\"filkmkkholv\":\"bahhpzpofoiyjw\",\"ukyefchnmnahmnxh\":\"ndviauogphuartvt\",\"fifhxwrsnew\":\"xjqirwrweoox\",\"sycxhxzgaz\":\"ozqvbubqmam\"},\"id\":\"taboidvmf\",\"name\":\"hppubowsepdfgkmt\",\"type\":\"herngb\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.linkedServices().listByWorkspace("jhvsujztczyt", "jtwhauunf", com.azure.core.util.Context.NONE); + = manager.linkedServices().listByWorkspace("xxgewpk", "vqylkmqpzoyhl", com.azure.core.util.Context.NONE); - Assertions.assertEquals("knlqwzdvpiwhxqsz", response.iterator().next().tags().get("tmaaj")); - Assertions.assertEquals("njle", response.iterator().next().resourceId()); - Assertions.assertEquals("xsmrpddouifamow", response.iterator().next().writeAccessResourceId()); + Assertions.assertEquals("bahhpzpofoiyjw", response.iterator().next().tags().get("filkmkkholv")); + Assertions.assertEquals("cgwgcloxoebqinji", response.iterator().next().resourceId()); + Assertions.assertEquals("wjfuj", response.iterator().next().writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, response.iterator().next().provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java index c1bcb4df7e9e..d48b9a981fa2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -23,21 +23,21 @@ public final class LinkedStorageAccountsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataSourceType\":\"Alerts\",\"storageAccountIds\":[\"k\",\"jqirwrw\",\"ooxf\",\"i\"]},\"id\":\"hx\",\"name\":\"rsnewmozqvbubqma\",\"type\":\"hsycxhxzgaz\"}"; + = "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"qogsfikayian\"]},\"id\":\"haru\",\"name\":\"t\",\"type\":\"iqxf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedStorageAccountsResource response = manager.linkedStorageAccounts() .define(DataSourceType.QUERY) - .withExistingWorkspace("jipnwj", "ujqlafcbahh") - .withStorageAccountIds(Arrays.asList("iyjwpfilkmkkho")) + .withExistingWorkspace("dirazf", "xejw") + .withStorageAccountIds(Arrays.asList("tmvcop", "xcmjurbu")) .create(); - Assertions.assertEquals("k", response.storageAccountIds().get(0)); + Assertions.assertEquals("qogsfikayian", response.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java index 40493a52e050..8e903ac007f6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -26,10 +26,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.linkedStorageAccounts() - .deleteWithResponse("xmmkjs", "thnwpzte", DataSourceType.QUERY, com.azure.core.util.Context.NONE); + .deleteWithResponse("cbuewmrswnjlxuz", "hwpusxj", DataSourceType.QUERY, com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java index d10dd144a0b4..c573d8bbe878 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -22,20 +22,19 @@ public final class LinkedStorageAccountsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"wvxwlmzqwmvt\",\"njmxmcuqudtcvcl\",\"ynpdkvgfab\"]},\"id\":\"iyji\",\"name\":\"uzphdugnei\",\"type\":\"n\"}"; + = "{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"fepbnwgfmxjgc\",\"bjb\",\"dlfgtdysnaq\"]},\"id\":\"flq\",\"name\":\"ctqhamzjrwdk\",\"type\":\"zeqyjleziun\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedStorageAccountsResource response = manager.linkedStorageAccounts() - .getWithResponse("vmribiat", "gplucfotangcfhny", DataSourceType.CUSTOM_LOGS, - com.azure.core.util.Context.NONE) + .getWithResponse("qehgpd", "hzjqatucoige", DataSourceType.ALERTS, com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("wvxwlmzqwmvt", response.storageAccountIds().get(0)); + Assertions.assertEquals("fepbnwgfmxjgc", response.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java index aa5e03209483..1653382012f8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedStorageAccountsResource; @@ -22,18 +22,18 @@ public final class LinkedStorageAccountsListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"d\",\"urrxxgewpktv\",\"ylkmqp\"]},\"id\":\"o\",\"name\":\"hlfbcgwgc\",\"type\":\"oxoebqi\"}]}"; + = "{\"value\":[{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"nseqacjjvp\",\"lguooqjagmd\",\"tg\",\"eiookjbsah\"]},\"id\":\"tdtpdelqacslmo\",\"name\":\"oebn\",\"type\":\"xofvcjk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.linkedStorageAccounts().listByWorkspace("gox", "jiuqhibtozi", com.azure.core.util.Context.NONE); + = manager.linkedStorageAccounts().listByWorkspace("xdfzantkw", "eg", com.azure.core.util.Context.NONE); - Assertions.assertEquals("d", response.iterator().next().storageAccountIds().get(0)); + Assertions.assertEquals("nseqacjjvp", response.iterator().next().storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java index dd4162a279cc..72e9c44c5402 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java @@ -14,21 +14,18 @@ public final class LinkedStorageAccountsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedStorageAccountsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"vce\",\"vei\",\"ovnotyfjfcnjbkcn\",\"dhbt\"]},\"id\":\"kphywpnvjto\",\"name\":\"nermcl\",\"type\":\"plpho\"},{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"pabgyeps\",\"jta\"]},\"id\":\"qugxywpmueefjzwf\",\"name\":\"kqujidsuyono\",\"type\":\"glaocq\"},{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"g\",\"udxytlmoyrx\",\"wfudwpzntxhdzhl\",\"qj\"]},\"id\":\"hckfrlhrx\",\"name\":\"bkyvp\",\"type\":\"ca\"},{\"properties\":{\"dataSourceType\":\"CustomLogs\",\"storageAccountIds\":[\"zka\"]},\"id\":\"kuwbcrnwb\",\"name\":\"ehhseyvjusrts\",\"type\":\"hspkdeemao\"}]}") + "{\"value\":[{\"properties\":{\"dataSourceType\":\"CustomLogs\",\"storageAccountIds\":[\"ipheoflokeyyien\",\"bdlwtgrhpdjpj\",\"masxazjpqyegu\",\"lhbxxhejjzzvdud\"]},\"id\":\"wdslfhotwmcy\",\"name\":\"pwlbjnpg\",\"type\":\"cftadeh\"},{\"properties\":{\"dataSourceType\":\"Alerts\",\"storageAccountIds\":[\"fsoppusuesnzw\",\"ej\"]},\"id\":\"avo\",\"name\":\"xzdmohctb\",\"type\":\"vudwx\"}]}") .toObject(LinkedStorageAccountsListResult.class); - Assertions.assertEquals("vce", model.value().get(0).storageAccountIds().get(0)); + Assertions.assertEquals("ipheoflokeyyien", model.value().get(0).storageAccountIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LinkedStorageAccountsListResult model = new LinkedStorageAccountsListResult().withValue(Arrays.asList( - new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("vce", "vei", "ovnotyfjfcnjbkcn", "dhbt")), - new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("pabgyeps", "jta")), - new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("g", "udxytlmoyrx", "wfudwpzntxhdzhl", "qj")), - new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("zka")))); + new LinkedStorageAccountsResourceInner().withStorageAccountIds( + Arrays.asList("ipheoflokeyyien", "bdlwtgrhpdjpj", "masxazjpqyegu", "lhbxxhejjzzvdud")), + new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("fsoppusuesnzw", "ej")))); model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsListResult.class); - Assertions.assertEquals("vce", model.value().get(0).storageAccountIds().get(0)); + Assertions.assertEquals("ipheoflokeyyien", model.value().get(0).storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java index 9832736ff713..0646d7918b9a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java @@ -12,17 +12,17 @@ public final class LinkedStorageAccountsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LinkedStorageAccountsProperties model - = BinaryData.fromString("{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"sx\"]}") - .toObject(LinkedStorageAccountsProperties.class); - Assertions.assertEquals("sx", model.storageAccountIds().get(0)); + LinkedStorageAccountsProperties model = BinaryData.fromString( + "{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"nwsubisnj\",\"mpmngnzscxaqwoo\",\"hcbonqvpkvlr\"]}") + .toObject(LinkedStorageAccountsProperties.class); + Assertions.assertEquals("nwsubisnj", model.storageAccountIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedStorageAccountsProperties model - = new LinkedStorageAccountsProperties().withStorageAccountIds(Arrays.asList("sx")); + LinkedStorageAccountsProperties model = new LinkedStorageAccountsProperties() + .withStorageAccountIds(Arrays.asList("nwsubisnj", "mpmngnzscxaqwoo", "hcbonqvpkvlr")); model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsProperties.class); - Assertions.assertEquals("sx", model.storageAccountIds().get(0)); + Assertions.assertEquals("nwsubisnj", model.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java index 66a4b51c423d..57ce7268faaf 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java @@ -13,16 +13,16 @@ public final class LinkedStorageAccountsResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedStorageAccountsResourceInner model = BinaryData.fromString( - "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"hsmtxpsiebtfhvp\",\"sapskr\",\"qmhjjdhtld\"]},\"id\":\"kyzxuutk\",\"name\":\"cwscwsvlx\",\"type\":\"togt\"}") + "{\"properties\":{\"dataSourceType\":\"Ingestion\",\"storageAccountIds\":[\"zevgb\",\"qjqabcypmivkwl\",\"uvcc\"]},\"id\":\"wnfnbacf\",\"name\":\"onlebxetqgtzxdpn\",\"type\":\"bqqwxrj\"}") .toObject(LinkedStorageAccountsResourceInner.class); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.storageAccountIds().get(0)); + Assertions.assertEquals("zevgb", model.storageAccountIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LinkedStorageAccountsResourceInner model = new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("hsmtxpsiebtfhvp", "sapskr", "qmhjjdhtld")); + .withStorageAccountIds(Arrays.asList("zevgb", "qjqabcypmivkwl", "uvcc")); model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsResourceInner.class); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.storageAccountIds().get(0)); + Assertions.assertEquals("zevgb", model.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java index f562a725ec27..ddaba19b2e18 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java @@ -14,19 +14,19 @@ public final class LogAnalyticsQueryPackInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackInner model = BinaryData.fromString( - "{\"properties\":{\"queryPackId\":\"ijbpzvgnwzsymgl\",\"timeCreated\":\"2021-09-05T16:59:27Z\",\"timeModified\":\"2021-02-27T08:20:44Z\",\"provisioningState\":\"ohdbihanufh\"},\"location\":\"cbjy\",\"tags\":{\"xwczbyscnp\":\"ithxqhabifpi\"},\"id\":\"x\",\"name\":\"hiv\",\"type\":\"qniwbybrkxvdumj\"}") + "{\"properties\":{\"queryPackId\":\"vlvqhjkbegi\",\"timeCreated\":\"2021-03-26T15:32:51Z\",\"timeModified\":\"2021-02-11T17:20:18Z\",\"provisioningState\":\"ebwwaloayqc\"},\"location\":\"rtzju\",\"tags\":{\"txon\":\"yzm\",\"rknftguvriuhprwm\":\"mtsavjcbpwxqp\",\"bexrmcq\":\"yvxqtayriwwroy\"},\"id\":\"bycnojvkn\",\"name\":\"e\",\"type\":\"qsgzvahapj\"}") .toObject(LogAnalyticsQueryPackInner.class); - Assertions.assertEquals("cbjy", model.location()); - Assertions.assertEquals("ithxqhabifpi", model.tags().get("xwczbyscnp")); + Assertions.assertEquals("rtzju", model.location()); + Assertions.assertEquals("yzm", model.tags().get("txon")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackInner model - = new LogAnalyticsQueryPackInner().withLocation("cbjy").withTags(mapOf("xwczbyscnp", "ithxqhabifpi")); + LogAnalyticsQueryPackInner model = new LogAnalyticsQueryPackInner().withLocation("rtzju") + .withTags(mapOf("txon", "yzm", "rknftguvriuhprwm", "mtsavjcbpwxqp", "bexrmcq", "yvxqtayriwwroy")); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackInner.class); - Assertions.assertEquals("cbjy", model.location()); - Assertions.assertEquals("ithxqhabifpi", model.tags().get("xwczbyscnp")); + Assertions.assertEquals("rtzju", model.location()); + Assertions.assertEquals("yzm", model.tags().get("txon")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java index 9bbc678f07ca..2eeff82cfbe9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java @@ -16,27 +16,26 @@ public final class LogAnalyticsQueryPackListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"queryPackId\":\"hq\",\"timeCreated\":\"2021-08-01T15:29:09Z\",\"timeModified\":\"2021-10-26T10:24:19Z\",\"provisioningState\":\"ybczmehmtzo\"},\"location\":\"bsphrupidgsybbe\",\"tags\":{\"xaobhdxbmtqioqjz\":\"hoycm\"},\"id\":\"htbmuf\",\"name\":\"ownoizhw\",\"type\":\"rxybqsoq\"},{\"properties\":{\"queryPackId\":\"gkdmb\",\"timeCreated\":\"2021-12-03T16:46:54Z\",\"timeModified\":\"2021-03-24T06:15:27Z\",\"provisioningState\":\"c\"},\"location\":\"fp\",\"tags\":{\"qqjnqgl\":\"rbt\",\"foooj\":\"qgn\",\"saagdf\":\"wifsq\"},\"id\":\"glzlhjxrifkwmrv\",\"name\":\"tsizntocipaoua\",\"type\":\"psqucmpoyf\"},{\"properties\":{\"queryPackId\":\"fogknygjofjdde\",\"timeCreated\":\"2020-12-22T06:05:56Z\",\"timeModified\":\"2021-06-07T09:35:57Z\",\"provisioningState\":\"pewnw\"},\"location\":\"eitjz\",\"tags\":{\"hs\":\"usarhmofc\",\"xukcdmpar\":\"yurkdtmlxhekuksj\"},\"id\":\"ryuanzwuxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"}],\"nextLink\":\"nryrtihf\"}") + "{\"value\":[{\"properties\":{\"queryPackId\":\"r\",\"timeCreated\":\"2021-06-09T13:42:27Z\",\"timeModified\":\"2021-10-13T05:34:59Z\",\"provisioningState\":\"omzlfmi\"},\"location\":\"wbnb\",\"tags\":{\"urqhaka\":\"dawkzbali\",\"xcug\":\"hashsfwxosow\",\"ovbvmeueciv\":\"cjooxdjebwpucwwf\",\"otwmcdyt\":\"hzceuojgjrwjue\"},\"id\":\"x\",\"name\":\"it\",\"type\":\"nrjawgqwg\"},{\"properties\":{\"queryPackId\":\"ni\",\"timeCreated\":\"2021-10-14T20:39:54Z\",\"timeModified\":\"2021-05-28T01:48:43Z\",\"provisioningState\":\"py\"},\"location\":\"klwndnhjdauwhv\",\"tags\":{\"xujznbmpowu\":\"zbtd\",\"lupj\":\"przqlveu\"},\"id\":\"khfxobbcswsrt\",\"name\":\"riplrbpbewtg\",\"type\":\"fgb\"}],\"nextLink\":\"gw\"}") .toObject(LogAnalyticsQueryPackListResult.class); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).location()); - Assertions.assertEquals("hoycm", model.value().get(0).tags().get("xaobhdxbmtqioqjz")); - Assertions.assertEquals("nryrtihf", model.nextLink()); + Assertions.assertEquals("wbnb", model.value().get(0).location()); + Assertions.assertEquals("dawkzbali", model.value().get(0).tags().get("urqhaka")); + Assertions.assertEquals("gw", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LogAnalyticsQueryPackListResult model = new LogAnalyticsQueryPackListResult().withValue(Arrays.asList( - new LogAnalyticsQueryPackInner().withLocation("bsphrupidgsybbe") - .withTags(mapOf("xaobhdxbmtqioqjz", "hoycm")), - new LogAnalyticsQueryPackInner().withLocation("fp") - .withTags(mapOf("qqjnqgl", "rbt", "foooj", "qgn", "saagdf", "wifsq")), - new LogAnalyticsQueryPackInner().withLocation("eitjz") - .withTags(mapOf("hs", "usarhmofc", "xukcdmpar", "yurkdtmlxhekuksj")))) - .withNextLink("nryrtihf"); + new LogAnalyticsQueryPackInner().withLocation("wbnb") + .withTags(mapOf("urqhaka", "dawkzbali", "xcug", "hashsfwxosow", "ovbvmeueciv", "cjooxdjebwpucwwf", + "otwmcdyt", "hzceuojgjrwjue")), + new LogAnalyticsQueryPackInner().withLocation("klwndnhjdauwhv") + .withTags(mapOf("xujznbmpowu", "zbtd", "lupj", "przqlveu")))) + .withNextLink("gw"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackListResult.class); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).location()); - Assertions.assertEquals("hoycm", model.value().get(0).tags().get("xaobhdxbmtqioqjz")); - Assertions.assertEquals("nryrtihf", model.nextLink()); + Assertions.assertEquals("wbnb", model.value().get(0).location()); + Assertions.assertEquals("dawkzbali", model.value().get(0).tags().get("urqhaka")); + Assertions.assertEquals("gw", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java index 0083d9b1c802..8519059f3572 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java @@ -11,7 +11,7 @@ public final class LogAnalyticsQueryPackPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackProperties model = BinaryData.fromString( - "{\"queryPackId\":\"tfwvukxgaudc\",\"timeCreated\":\"2021-06-07T10:34:36Z\",\"timeModified\":\"2021-03-15T16:07:05Z\",\"provisioningState\":\"cnyejhkryhtnapcz\"}") + "{\"queryPackId\":\"hpvgqz\",\"timeCreated\":\"2021-01-17T14:10:43Z\",\"timeModified\":\"2021-03-29T21:57:57Z\",\"provisioningState\":\"jzlmw\"}") .toObject(LogAnalyticsQueryPackProperties.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java index 06a46115ccdf..e9775cc4a340 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java @@ -16,35 +16,37 @@ public final class LogAnalyticsQueryPackQueryInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryInner model = BinaryData.fromString( - "{\"properties\":{\"id\":\"qwpgrjbzn\",\"displayName\":\"rcjxvsnbyxqabn\",\"timeCreated\":\"2021-06-16T16:14:14Z\",\"timeModified\":\"2020-12-28T20:56:17Z\",\"author\":\"shurzafbljjgpbto\",\"description\":\"jmkljavbqidtqajz\",\"body\":\"ulpkudjkrl\",\"related\":{\"categories\":[\"hfepgzgqex\"],\"resourceTypes\":[\"c\",\"scpai\",\"rhhbcs\",\"l\"],\"solutions\":[\"a\",\"tjaodxobnb\"]},\"tags\":{\"mexgstxgcp\":[\"pxokajionp\"]},\"properties\":\"datagmaajrm\"},\"id\":\"jwzrl\",\"name\":\"mcl\",\"type\":\"ijcoejctb\"}") + "{\"properties\":{\"id\":\"bebrjcxerfuwuttt\",\"displayName\":\"fvjrbirphxepcy\",\"timeCreated\":\"2021-11-07T03:18:20Z\",\"timeModified\":\"2021-05-23T19:09:39Z\",\"author\":\"jky\",\"description\":\"j\",\"body\":\"uujqgidokgjljyo\",\"related\":{\"categories\":[\"ltbgsncghkj\",\"szzhbijhtxfvgxbf\",\"mxnehmp\",\"ec\"],\"resourceTypes\":[\"debfqkkrbmpukgri\",\"flz\",\"fbxzpuzycisp\",\"qzahmgkbrp\"],\"solutions\":[\"hibnuqqkpika\",\"rgvtqag\"]},\"tags\":{\"ttdbhrbnl\":[\"nhijggmebfsi\",\"rbu\",\"rcvpnazzmhjrunmp\"],\"czfc\":[\"kx\",\"yskpbhen\",\"tkcxywnytnrsy\",\"lqidyby\"]},\"properties\":\"dataaaxdbabphlwrq\"},\"id\":\"ktsthsucocmny\",\"name\":\"azt\",\"type\":\"bt\"}") .toObject(LogAnalyticsQueryPackQueryInner.class); - Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); - Assertions.assertEquals("jmkljavbqidtqajz", model.description()); - Assertions.assertEquals("ulpkudjkrl", model.body()); - Assertions.assertEquals("hfepgzgqex", model.related().categories().get(0)); - Assertions.assertEquals("c", model.related().resourceTypes().get(0)); - Assertions.assertEquals("a", model.related().solutions().get(0)); - Assertions.assertEquals("pxokajionp", model.tags().get("mexgstxgcp").get(0)); + Assertions.assertEquals("fvjrbirphxepcy", model.displayName()); + Assertions.assertEquals("j", model.description()); + Assertions.assertEquals("uujqgidokgjljyo", model.body()); + Assertions.assertEquals("ltbgsncghkj", model.related().categories().get(0)); + Assertions.assertEquals("debfqkkrbmpukgri", model.related().resourceTypes().get(0)); + Assertions.assertEquals("hibnuqqkpika", model.related().solutions().get(0)); + Assertions.assertEquals("nhijggmebfsi", model.tags().get("ttdbhrbnl").get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryInner model = new LogAnalyticsQueryPackQueryInner().withDisplayName("rcjxvsnbyxqabn") - .withDescription("jmkljavbqidtqajz") - .withBody("ulpkudjkrl") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("hfepgzgqex")) - .withResourceTypes(Arrays.asList("c", "scpai", "rhhbcs", "l")) - .withSolutions(Arrays.asList("a", "tjaodxobnb"))) - .withTags(mapOf("mexgstxgcp", Arrays.asList("pxokajionp"))) - .withProperties("datagmaajrm"); + LogAnalyticsQueryPackQueryInner model = new LogAnalyticsQueryPackQueryInner().withDisplayName("fvjrbirphxepcy") + .withDescription("j") + .withBody("uujqgidokgjljyo") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("ltbgsncghkj", "szzhbijhtxfvgxbf", "mxnehmp", "ec")) + .withResourceTypes(Arrays.asList("debfqkkrbmpukgri", "flz", "fbxzpuzycisp", "qzahmgkbrp")) + .withSolutions(Arrays.asList("hibnuqqkpika", "rgvtqag"))) + .withTags(mapOf("ttdbhrbnl", Arrays.asList("nhijggmebfsi", "rbu", "rcvpnazzmhjrunmp"), "czfc", + Arrays.asList("kx", "yskpbhen", "tkcxywnytnrsy", "lqidyby"))) + .withProperties("dataaaxdbabphlwrq"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryInner.class); - Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); - Assertions.assertEquals("jmkljavbqidtqajz", model.description()); - Assertions.assertEquals("ulpkudjkrl", model.body()); - Assertions.assertEquals("hfepgzgqex", model.related().categories().get(0)); - Assertions.assertEquals("c", model.related().resourceTypes().get(0)); - Assertions.assertEquals("a", model.related().solutions().get(0)); - Assertions.assertEquals("pxokajionp", model.tags().get("mexgstxgcp").get(0)); + Assertions.assertEquals("fvjrbirphxepcy", model.displayName()); + Assertions.assertEquals("j", model.description()); + Assertions.assertEquals("uujqgidokgjljyo", model.body()); + Assertions.assertEquals("ltbgsncghkj", model.related().categories().get(0)); + Assertions.assertEquals("debfqkkrbmpukgri", model.related().resourceTypes().get(0)); + Assertions.assertEquals("hibnuqqkpika", model.related().solutions().get(0)); + Assertions.assertEquals("nhijggmebfsi", model.tags().get("ttdbhrbnl").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java index bdf11fd483c3..6a9bbc95acaf 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java @@ -17,67 +17,42 @@ public final class LogAnalyticsQueryPackQueryListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"id\":\"yhuybbkpod\",\"displayName\":\"po\",\"timeCreated\":\"2021-05-29T14:24:22Z\",\"timeModified\":\"2021-09-25T10:25:19Z\",\"author\":\"amiheognarxz\",\"description\":\"heotusiv\",\"body\":\"evcciqihnhun\",\"related\":{\"categories\":[\"zrnf\",\"gxg\"],\"resourceTypes\":[\"emv\",\"zfkufubljofx\",\"eofjaeqjh\",\"jbasvmsmjqulngs\"],\"solutions\":[\"bybkzgcwrwclxx\",\"rljdouskcqv\",\"ocrcjdk\",\"tnhxbn\"]},\"tags\":{\"yqduujit\":[\"sqrglssainq\",\"jwnzlljfmp\",\"eebvmgxsab\"],\"nhutjeltmrldhugj\":[\"czdzev\",\"dhkrwpdappdsbdk\",\"wrwjfeu\"]},\"properties\":\"datadatqxhocdgeabl\"},\"id\":\"huticndvkao\",\"name\":\"yiftyhxhuro\",\"type\":\"tyxolniwpwc\"},{\"properties\":{\"id\":\"kgiawxklryplwck\",\"displayName\":\"asy\",\"timeCreated\":\"2021-10-21T22:29:11Z\",\"timeModified\":\"2021-07-26T02:42:45Z\",\"author\":\"sgcbac\",\"description\":\"ejk\",\"body\":\"tynqgoul\",\"related\":{\"categories\":[\"i\",\"wyqkgfgibm\",\"dgak\"],\"resourceTypes\":[\"rxybz\"],\"solutions\":[\"dqytbciqfouflmm\"]},\"tags\":{\"spwgcuertumkdosv\":[\"modmglougpb\",\"wtmutduq\",\"ta\"]},\"properties\":\"datahbmdgbbjfdd\"},\"id\":\"bmbexppbhtqqro\",\"name\":\"p\",\"type\":\"s\"},{\"properties\":{\"id\":\"qux\",\"displayName\":\"gjyjgzjaoyfhrtxi\",\"timeCreated\":\"2021-04-23T04:18:15Z\",\"timeModified\":\"2021-08-05T02:52:01Z\",\"author\":\"jysvl\",\"description\":\"uvfqawrlyxwj\",\"body\":\"cpr\",\"related\":{\"categories\":[\"xgjvtbv\"],\"resourceTypes\":[\"szdnr\",\"jq\"],\"solutions\":[\"muouqfp\",\"wzwbnguitn\",\"uizga\",\"x\"]},\"tags\":{\"idf\":[\"uckyf\",\"hr\"],\"pvkmijcmmxdcuf\":[\"wdzuhtymwisd\",\"fthwxmnteiwa\"],\"dwzjeiach\":[\"srp\",\"mzidnsezcxtb\",\"sgfyccsnew\"],\"pyqr\":[\"osfln\",\"osfqpteehzzv\"]},\"properties\":\"dataz\"},\"id\":\"pvswjdkirso\",\"name\":\"qxhcrmn\",\"type\":\"jtckwhdso\"}],\"nextLink\":\"yip\"}") + "{\"value\":[{\"properties\":{\"id\":\"nvudwtiukb\",\"displayName\":\"dng\",\"timeCreated\":\"2021-01-23T10:58:05Z\",\"timeModified\":\"2021-05-04T07:17:38Z\",\"author\":\"azyxoegukg\",\"description\":\"piu\",\"body\":\"gygev\",\"related\":{\"categories\":[\"yp\",\"rbpizc\",\"r\",\"j\"],\"resourceTypes\":[\"ydnfyhxdeoejz\"],\"solutions\":[\"ifsjttgzfbishcb\"]},\"tags\":{\"kix\":[\"deyeamdphagalpbu\",\"wgipwhono\",\"kgshwa\"],\"ttmrywnuzoqf\":[\"injep\"],\"oqqnwvlryav\":[\"yqzrnkcqvyxlw\",\"zlsico\"],\"szfkbe\":[\"heun\",\"mqhgyxzkonocuk\",\"klyaxuconu\"]},\"properties\":\"dataewrmjmwvvjektc\"},\"id\":\"enhwlrs\",\"name\":\"frzpwvlqdqgb\",\"type\":\"qylihkaetckt\"}],\"nextLink\":\"civfsnkymuctq\"}") .toObject(LogAnalyticsQueryPackQueryListResult.class); - Assertions.assertEquals("po", model.value().get(0).displayName()); - Assertions.assertEquals("heotusiv", model.value().get(0).description()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).body()); - Assertions.assertEquals("zrnf", model.value().get(0).related().categories().get(0)); - Assertions.assertEquals("emv", model.value().get(0).related().resourceTypes().get(0)); - Assertions.assertEquals("bybkzgcwrwclxx", model.value().get(0).related().solutions().get(0)); - Assertions.assertEquals("sqrglssainq", model.value().get(0).tags().get("yqduujit").get(0)); - Assertions.assertEquals("yip", model.nextLink()); + Assertions.assertEquals("dng", model.value().get(0).displayName()); + Assertions.assertEquals("piu", model.value().get(0).description()); + Assertions.assertEquals("gygev", model.value().get(0).body()); + Assertions.assertEquals("yp", model.value().get(0).related().categories().get(0)); + Assertions.assertEquals("ydnfyhxdeoejz", model.value().get(0).related().resourceTypes().get(0)); + Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).related().solutions().get(0)); + Assertions.assertEquals("deyeamdphagalpbu", model.value().get(0).tags().get("kix").get(0)); + Assertions.assertEquals("civfsnkymuctq", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryListResult model - = new LogAnalyticsQueryPackQueryListResult() - .withValue( - Arrays - .asList( - new LogAnalyticsQueryPackQueryInner().withDisplayName("po") - .withDescription("heotusiv") - .withBody("evcciqihnhun") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("zrnf", "gxg")) - .withResourceTypes( - Arrays.asList("emv", "zfkufubljofx", "eofjaeqjh", "jbasvmsmjqulngs")) - .withSolutions(Arrays.asList("bybkzgcwrwclxx", "rljdouskcqv", "ocrcjdk", "tnhxbn"))) - .withTags(mapOf("yqduujit", Arrays.asList("sqrglssainq", "jwnzlljfmp", "eebvmgxsab"), - "nhutjeltmrldhugj", Arrays.asList("czdzev", "dhkrwpdappdsbdk", "wrwjfeu"))) - .withProperties("datadatqxhocdgeabl"), - new LogAnalyticsQueryPackQueryInner().withDisplayName("asy") - .withDescription("ejk") - .withBody("tynqgoul") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("i", "wyqkgfgibm", "dgak")) - .withResourceTypes(Arrays.asList("rxybz")) - .withSolutions(Arrays.asList("dqytbciqfouflmm"))) - .withTags(mapOf("spwgcuertumkdosv", Arrays.asList("modmglougpb", "wtmutduq", "ta"))) - .withProperties("datahbmdgbbjfdd"), - new LogAnalyticsQueryPackQueryInner().withDisplayName("gjyjgzjaoyfhrtxi") - .withDescription("uvfqawrlyxwj") - .withBody("cpr") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("xgjvtbv")) - .withResourceTypes(Arrays.asList("szdnr", "jq")) - .withSolutions(Arrays.asList("muouqfp", "wzwbnguitn", "uizga", "x"))) - .withTags(mapOf("idf", Arrays.asList("uckyf", "hr"), "pvkmijcmmxdcuf", - Arrays.asList("wdzuhtymwisd", "fthwxmnteiwa"), "dwzjeiach", - Arrays.asList("srp", "mzidnsezcxtb", "sgfyccsnew"), "pyqr", - Arrays.asList("osfln", "osfqpteehzzv"))) - .withProperties("dataz"))) - .withNextLink("yip"); + LogAnalyticsQueryPackQueryListResult model = new LogAnalyticsQueryPackQueryListResult() + .withValue(Arrays.asList(new LogAnalyticsQueryPackQueryInner().withDisplayName("dng") + .withDescription("piu") + .withBody("gygev") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("yp", "rbpizc", "r", "j")) + .withResourceTypes(Arrays.asList("ydnfyhxdeoejz")) + .withSolutions(Arrays.asList("ifsjttgzfbishcb"))) + .withTags(mapOf("kix", Arrays.asList("deyeamdphagalpbu", "wgipwhono", "kgshwa"), "ttmrywnuzoqf", + Arrays.asList("injep"), "oqqnwvlryav", Arrays.asList("yqzrnkcqvyxlw", "zlsico"), "szfkbe", + Arrays.asList("heun", "mqhgyxzkonocuk", "klyaxuconu"))) + .withProperties("dataewrmjmwvvjektc"))) + .withNextLink("civfsnkymuctq"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryListResult.class); - Assertions.assertEquals("po", model.value().get(0).displayName()); - Assertions.assertEquals("heotusiv", model.value().get(0).description()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).body()); - Assertions.assertEquals("zrnf", model.value().get(0).related().categories().get(0)); - Assertions.assertEquals("emv", model.value().get(0).related().resourceTypes().get(0)); - Assertions.assertEquals("bybkzgcwrwclxx", model.value().get(0).related().solutions().get(0)); - Assertions.assertEquals("sqrglssainq", model.value().get(0).tags().get("yqduujit").get(0)); - Assertions.assertEquals("yip", model.nextLink()); + Assertions.assertEquals("dng", model.value().get(0).displayName()); + Assertions.assertEquals("piu", model.value().get(0).description()); + Assertions.assertEquals("gygev", model.value().get(0).body()); + Assertions.assertEquals("yp", model.value().get(0).related().categories().get(0)); + Assertions.assertEquals("ydnfyhxdeoejz", model.value().get(0).related().resourceTypes().get(0)); + Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).related().solutions().get(0)); + Assertions.assertEquals("deyeamdphagalpbu", model.value().get(0).tags().get("kix").get(0)); + Assertions.assertEquals("civfsnkymuctq", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java index 5f1816304495..394b262405ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java @@ -13,22 +13,22 @@ public final class LogAnalyticsQueryPackQueryPropertiesRelatedTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryPropertiesRelated model = BinaryData.fromString( - "{\"categories\":[\"tthzrvqd\"],\"resourceTypes\":[\"hjybigehoqfbo\"],\"solutions\":[\"anyktzlcuiywg\",\"ywgndrv\",\"nhzgpphrcgyn\",\"ocpecfvmmco\"]}") + "{\"categories\":[\"yqupedeojnabckh\",\"mtxpsiebtfh\",\"pesapskrdqmhjj\",\"htldwk\"],\"resourceTypes\":[\"uutkncw\",\"cwsvlxotog\",\"wrupqsxvnmicykvc\",\"o\"],\"solutions\":[\"lo\",\"notyfjfcnjbkcn\"]}") .toObject(LogAnalyticsQueryPackQueryPropertiesRelated.class); - Assertions.assertEquals("tthzrvqd", model.categories().get(0)); - Assertions.assertEquals("hjybigehoqfbo", model.resourceTypes().get(0)); - Assertions.assertEquals("anyktzlcuiywg", model.solutions().get(0)); + Assertions.assertEquals("yqupedeojnabckh", model.categories().get(0)); + Assertions.assertEquals("uutkncw", model.resourceTypes().get(0)); + Assertions.assertEquals("lo", model.solutions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryPropertiesRelated model - = new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("tthzrvqd")) - .withResourceTypes(Arrays.asList("hjybigehoqfbo")) - .withSolutions(Arrays.asList("anyktzlcuiywg", "ywgndrv", "nhzgpphrcgyn", "ocpecfvmmco")); + LogAnalyticsQueryPackQueryPropertiesRelated model = new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("yqupedeojnabckh", "mtxpsiebtfh", "pesapskrdqmhjj", "htldwk")) + .withResourceTypes(Arrays.asList("uutkncw", "cwsvlxotog", "wrupqsxvnmicykvc", "o")) + .withSolutions(Arrays.asList("lo", "notyfjfcnjbkcn")); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryPropertiesRelated.class); - Assertions.assertEquals("tthzrvqd", model.categories().get(0)); - Assertions.assertEquals("hjybigehoqfbo", model.resourceTypes().get(0)); - Assertions.assertEquals("anyktzlcuiywg", model.solutions().get(0)); + Assertions.assertEquals("yqupedeojnabckh", model.categories().get(0)); + Assertions.assertEquals("uutkncw", model.resourceTypes().get(0)); + Assertions.assertEquals("lo", model.solutions().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java index be3ea54f5034..a2042415c0c5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java @@ -16,37 +16,37 @@ public final class LogAnalyticsQueryPackQueryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryProperties model = BinaryData.fromString( - "{\"id\":\"s\",\"displayName\":\"sycbkbfk\",\"timeCreated\":\"2021-04-13T09:52:22Z\",\"timeModified\":\"2021-02-11T20:09:09Z\",\"author\":\"xxppofm\",\"description\":\"x\",\"body\":\"fjpgddtocjjxhvp\",\"related\":{\"categories\":[\"xhdzxibqeojnx\"],\"resourceTypes\":[\"vddntwn\",\"eic\",\"twnpzaoqvuhrhcf\",\"cyddglmjthjqk\"],\"solutions\":[\"eicxmqciwqvhkhi\",\"uigdtopbobjog\",\"m\",\"w\"]},\"tags\":{\"gvdfgiotkftutq\":[\"uhrzayvvt\"]},\"properties\":\"datangxlefgugnxkrxdq\"}") + "{\"id\":\"rq\",\"displayName\":\"uedck\",\"timeCreated\":\"2021-02-12T19:04:46Z\",\"timeModified\":\"2021-04-30T21:59:13Z\",\"author\":\"xzfeyueaxibxuj\",\"description\":\"hqwa\",\"body\":\"muzyoxaepdk\",\"related\":{\"categories\":[\"cuxrhdwbavx\",\"niwdjsw\",\"tsdbpgn\"],\"resourceTypes\":[\"x\"],\"solutions\":[\"xbzpfzab\",\"lcuhxwtctyqiklb\",\"ovplw\"]},\"tags\":{\"svmkfssxquk\":[\"gy\",\"gu\"],\"zkd\":[\"plgmgsxnk\"],\"wzbaiue\":[\"lpvlopw\",\"yighxpk\"]},\"properties\":\"dataa\"}") .toObject(LogAnalyticsQueryPackQueryProperties.class); - Assertions.assertEquals("sycbkbfk", model.displayName()); - Assertions.assertEquals("x", model.description()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.body()); - Assertions.assertEquals("xhdzxibqeojnx", model.related().categories().get(0)); - Assertions.assertEquals("vddntwn", model.related().resourceTypes().get(0)); - Assertions.assertEquals("eicxmqciwqvhkhi", model.related().solutions().get(0)); - Assertions.assertEquals("uhrzayvvt", model.tags().get("gvdfgiotkftutq").get(0)); + Assertions.assertEquals("uedck", model.displayName()); + Assertions.assertEquals("hqwa", model.description()); + Assertions.assertEquals("muzyoxaepdk", model.body()); + Assertions.assertEquals("cuxrhdwbavx", model.related().categories().get(0)); + Assertions.assertEquals("x", model.related().resourceTypes().get(0)); + Assertions.assertEquals("xbzpfzab", model.related().solutions().get(0)); + Assertions.assertEquals("gy", model.tags().get("svmkfssxquk").get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryProperties model - = new LogAnalyticsQueryPackQueryProperties().withDisplayName("sycbkbfk") - .withDescription("x") - .withBody("fjpgddtocjjxhvp") - .withRelated( - new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("xhdzxibqeojnx")) - .withResourceTypes(Arrays.asList("vddntwn", "eic", "twnpzaoqvuhrhcf", "cyddglmjthjqk")) - .withSolutions(Arrays.asList("eicxmqciwqvhkhi", "uigdtopbobjog", "m", "w"))) - .withTags(mapOf("gvdfgiotkftutq", Arrays.asList("uhrzayvvt"))) - .withProperties("datangxlefgugnxkrxdq"); + LogAnalyticsQueryPackQueryProperties model = new LogAnalyticsQueryPackQueryProperties().withDisplayName("uedck") + .withDescription("hqwa") + .withBody("muzyoxaepdk") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("cuxrhdwbavx", "niwdjsw", "tsdbpgn")) + .withResourceTypes(Arrays.asList("x")) + .withSolutions(Arrays.asList("xbzpfzab", "lcuhxwtctyqiklb", "ovplw"))) + .withTags(mapOf("svmkfssxquk", Arrays.asList("gy", "gu"), "zkd", Arrays.asList("plgmgsxnk"), "wzbaiue", + Arrays.asList("lpvlopw", "yighxpk"))) + .withProperties("dataa"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryProperties.class); - Assertions.assertEquals("sycbkbfk", model.displayName()); - Assertions.assertEquals("x", model.description()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.body()); - Assertions.assertEquals("xhdzxibqeojnx", model.related().categories().get(0)); - Assertions.assertEquals("vddntwn", model.related().resourceTypes().get(0)); - Assertions.assertEquals("eicxmqciwqvhkhi", model.related().solutions().get(0)); - Assertions.assertEquals("uhrzayvvt", model.tags().get("gvdfgiotkftutq").get(0)); + Assertions.assertEquals("uedck", model.displayName()); + Assertions.assertEquals("hqwa", model.description()); + Assertions.assertEquals("muzyoxaepdk", model.body()); + Assertions.assertEquals("cuxrhdwbavx", model.related().categories().get(0)); + Assertions.assertEquals("x", model.related().resourceTypes().get(0)); + Assertions.assertEquals("xbzpfzab", model.related().solutions().get(0)); + Assertions.assertEquals("gy", model.tags().get("svmkfssxquk").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java index c39cfaf402d7..9accebae05c9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java @@ -13,22 +13,22 @@ public final class LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQuerySearchPropertiesRelated model = BinaryData.fromString( - "{\"categories\":[\"owgujjugwdkcglhs\"],\"resourceTypes\":[\"jdyggdtji\"],\"solutions\":[\"kuofqweykhme\"]}") + "{\"categories\":[\"vt\"],\"resourceTypes\":[\"mqkrhahvljuahaqu\",\"c\",\"hmdua\"],\"solutions\":[\"xqpvfadmw\"]}") .toObject(LogAnalyticsQueryPackQuerySearchPropertiesRelated.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.categories().get(0)); - Assertions.assertEquals("jdyggdtji", model.resourceTypes().get(0)); - Assertions.assertEquals("kuofqweykhme", model.solutions().get(0)); + Assertions.assertEquals("vt", model.categories().get(0)); + Assertions.assertEquals("mqkrhahvljuahaqu", model.resourceTypes().get(0)); + Assertions.assertEquals("xqpvfadmw", model.solutions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LogAnalyticsQueryPackQuerySearchPropertiesRelated model - = new LogAnalyticsQueryPackQuerySearchPropertiesRelated().withCategories(Arrays.asList("owgujjugwdkcglhs")) - .withResourceTypes(Arrays.asList("jdyggdtji")) - .withSolutions(Arrays.asList("kuofqweykhme")); + = new LogAnalyticsQueryPackQuerySearchPropertiesRelated().withCategories(Arrays.asList("vt")) + .withResourceTypes(Arrays.asList("mqkrhahvljuahaqu", "c", "hmdua")) + .withSolutions(Arrays.asList("xqpvfadmw")); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQuerySearchPropertiesRelated.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.categories().get(0)); - Assertions.assertEquals("jdyggdtji", model.resourceTypes().get(0)); - Assertions.assertEquals("kuofqweykhme", model.solutions().get(0)); + Assertions.assertEquals("vt", model.categories().get(0)); + Assertions.assertEquals("mqkrhahvljuahaqu", model.resourceTypes().get(0)); + Assertions.assertEquals("xqpvfadmw", model.solutions().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java index 71d88a2658ff..75150951e370 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java @@ -16,29 +16,29 @@ public final class LogAnalyticsQueryPackQuerySearchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQuerySearchProperties model = BinaryData.fromString( - "{\"related\":{\"categories\":[\"c\",\"wnfnbacf\",\"onlebxetqgtzxdpn\",\"bqqwxrj\"],\"resourceTypes\":[\"llnwsubi\"],\"solutions\":[\"ampmngnz\",\"c\",\"aqw\",\"ochcbonqvpkvl\"]},\"tags\":{\"enjbdlwtgrhp\":[\"ea\",\"eipheoflokeyy\"],\"masxazjpqyegu\":[\"pj\"],\"cftadeh\":[\"hb\",\"xhejjzzvdud\",\"wdslfhotwmcy\",\"pwlbjnpg\"],\"xdn\":[\"ltyfsop\",\"usue\",\"nzwdejba\",\"orxzdmohctbqvud\"]}}") + "{\"related\":{\"categories\":[\"ttkphywpnvjtoqne\"],\"resourceTypes\":[\"lfplp\"],\"solutions\":[\"uscrpabgyepsb\"]},\"tags\":{\"kqujidsuyono\":[\"qugxywpmueefjzwf\"],\"wfudwpzntxhdzhl\":[\"laocqxtccmg\",\"udxytlmoyrx\"],\"sbkyvpycanuzbp\":[\"jbhckfrlhr\"],\"mx\":[\"afkuwb\",\"rnwb\",\"ehhseyvjusrts\",\"hspkdeemao\"]}}") .toObject(LogAnalyticsQueryPackQuerySearchProperties.class); - Assertions.assertEquals("c", model.related().categories().get(0)); - Assertions.assertEquals("llnwsubi", model.related().resourceTypes().get(0)); - Assertions.assertEquals("ampmngnz", model.related().solutions().get(0)); - Assertions.assertEquals("ea", model.tags().get("enjbdlwtgrhp").get(0)); + Assertions.assertEquals("ttkphywpnvjtoqne", model.related().categories().get(0)); + Assertions.assertEquals("lfplp", model.related().resourceTypes().get(0)); + Assertions.assertEquals("uscrpabgyepsb", model.related().solutions().get(0)); + Assertions.assertEquals("qugxywpmueefjzwf", model.tags().get("kqujidsuyono").get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LogAnalyticsQueryPackQuerySearchProperties model = new LogAnalyticsQueryPackQuerySearchProperties() .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() - .withCategories(Arrays.asList("c", "wnfnbacf", "onlebxetqgtzxdpn", "bqqwxrj")) - .withResourceTypes(Arrays.asList("llnwsubi")) - .withSolutions(Arrays.asList("ampmngnz", "c", "aqw", "ochcbonqvpkvl"))) - .withTags(mapOf("enjbdlwtgrhp", Arrays.asList("ea", "eipheoflokeyy"), "masxazjpqyegu", Arrays.asList("pj"), - "cftadeh", Arrays.asList("hb", "xhejjzzvdud", "wdslfhotwmcy", "pwlbjnpg"), "xdn", - Arrays.asList("ltyfsop", "usue", "nzwdejba", "orxzdmohctbqvud"))); + .withCategories(Arrays.asList("ttkphywpnvjtoqne")) + .withResourceTypes(Arrays.asList("lfplp")) + .withSolutions(Arrays.asList("uscrpabgyepsb"))) + .withTags(mapOf("kqujidsuyono", Arrays.asList("qugxywpmueefjzwf"), "wfudwpzntxhdzhl", + Arrays.asList("laocqxtccmg", "udxytlmoyrx"), "sbkyvpycanuzbp", Arrays.asList("jbhckfrlhr"), "mx", + Arrays.asList("afkuwb", "rnwb", "ehhseyvjusrts", "hspkdeemao"))); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQuerySearchProperties.class); - Assertions.assertEquals("c", model.related().categories().get(0)); - Assertions.assertEquals("llnwsubi", model.related().resourceTypes().get(0)); - Assertions.assertEquals("ampmngnz", model.related().solutions().get(0)); - Assertions.assertEquals("ea", model.tags().get("enjbdlwtgrhp").get(0)); + Assertions.assertEquals("ttkphywpnvjtoqne", model.related().categories().get(0)); + Assertions.assertEquals("lfplp", model.related().resourceTypes().get(0)); + Assertions.assertEquals("uscrpabgyepsb", model.related().solutions().get(0)); + Assertions.assertEquals("qugxywpmueefjzwf", model.tags().get("kqujidsuyono").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java index 1120c66992dd..ade4f7073fbe 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java @@ -16,7 +16,7 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"be80a829-4e64-42e8-8144-39a2107e6f7c\",\"tenantId\":\"b2f99afe-ea18-409c-8c3e-b8c6b30c667e\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"y\":{\"principalId\":\"c2094247-fc23-44d9-b2fb-e5752b134ff0\",\"clientId\":\"4d837673-32af-4936-b1b8-c1678c46ffd8\"},\"atdooaojkniod\":{\"principalId\":\"a4d2535b-4098-4a09-b1e0-60b30476302d\",\"clientId\":\"07b997ea-ecde-461d-a172-5a10933b8c37\"}}}") + "{\"principalId\":\"4f489df3-8016-476b-8e91-c04b1f58e415\",\"tenantId\":\"42e608e0-f5a7-4847-a317-9f231b68adfa\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"f\":{\"principalId\":\"e3f04b40-47a8-4323-8155-b654561a6e5d\",\"clientId\":\"ad28cede-46a0-4859-b5a6-fd978dadf090\"},\"rvktsi\":{\"principalId\":\"9b2c09be-ae3e-489c-a76a-522e98790141\",\"clientId\":\"c6139a3e-11c3-4025-b8af-8c1aba50601f\"},\"ocipaouajpsqucm\":{\"principalId\":\"a3b1ce65-9f5a-471b-b615-d8104f9cf738\",\"clientId\":\"b61166de-704d-4a8d-85a3-a06d54506119\"}}}") .toObject(ManagedServiceIdentity.class); Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); } @@ -24,8 +24,8 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("y", new UserAssignedIdentity(), "atdooaojkniod", new UserAssignedIdentity())); + .withUserAssignedIdentities(mapOf("f", new UserAssignedIdentity(), "rvktsi", new UserAssignedIdentity(), + "ocipaouajpsqucm", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java index 64509598976a..1bebfb74bd7f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java @@ -13,36 +13,36 @@ public final class ManagementGroupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagementGroupInner model = BinaryData.fromString( - "{\"properties\":{\"serverCount\":903805755,\"isGateway\":true,\"name\":\"y\",\"id\":\"klwndnhjdauwhv\",\"created\":\"2021-04-27T11:03:59Z\",\"dataReceived\":\"2021-08-28T16:11:31Z\",\"version\":\"dhxujznbmpo\",\"sku\":\"wpr\"}}") + "{\"properties\":{\"serverCount\":2031463120,\"isGateway\":true,\"name\":\"jpkcattpng\",\"id\":\"rcczsqpjhvmd\",\"created\":\"2021-11-26T10:49:59Z\",\"dataReceived\":\"2021-07-30T15:20:57Z\",\"version\":\"ounqecano\",\"sku\":\"upfh\"}}") .toObject(ManagementGroupInner.class); - Assertions.assertEquals(903805755, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("klwndnhjdauwhv", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T16:11:31Z"), model.dataReceived()); - Assertions.assertEquals("dhxujznbmpo", model.version()); - Assertions.assertEquals("wpr", model.sku()); + Assertions.assertEquals(2031463120, model.serverCount()); + Assertions.assertTrue(model.isGateway()); + Assertions.assertEquals("jpkcattpng", model.name()); + Assertions.assertEquals("rcczsqpjhvmd", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T10:49:59Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T15:20:57Z"), model.dataReceived()); + Assertions.assertEquals("ounqecano", model.version()); + Assertions.assertEquals("upfh", model.sku()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagementGroupInner model = new ManagementGroupInner().withServerCount(903805755) + ManagementGroupInner model = new ManagementGroupInner().withServerCount(2031463120) .withIsGateway(true) - .withName("y") - .withId("klwndnhjdauwhv") - .withCreated(OffsetDateTime.parse("2021-04-27T11:03:59Z")) - .withDataReceived(OffsetDateTime.parse("2021-08-28T16:11:31Z")) - .withVersion("dhxujznbmpo") - .withSku("wpr"); + .withName("jpkcattpng") + .withId("rcczsqpjhvmd") + .withCreated(OffsetDateTime.parse("2021-11-26T10:49:59Z")) + .withDataReceived(OffsetDateTime.parse("2021-07-30T15:20:57Z")) + .withVersion("ounqecano") + .withSku("upfh"); model = BinaryData.fromObject(model).toObject(ManagementGroupInner.class); - Assertions.assertEquals(903805755, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("klwndnhjdauwhv", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T16:11:31Z"), model.dataReceived()); - Assertions.assertEquals("dhxujznbmpo", model.version()); - Assertions.assertEquals("wpr", model.sku()); + Assertions.assertEquals(2031463120, model.serverCount()); + Assertions.assertTrue(model.isGateway()); + Assertions.assertEquals("jpkcattpng", model.name()); + Assertions.assertEquals("rcczsqpjhvmd", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T10:49:59Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T15:20:57Z"), model.dataReceived()); + Assertions.assertEquals("ounqecano", model.version()); + Assertions.assertEquals("upfh", model.sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java index a0b72ac3c800..9c56646abbb9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java @@ -13,36 +13,36 @@ public final class ManagementGroupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagementGroupProperties model = BinaryData.fromString( - "{\"serverCount\":741975656,\"isGateway\":true,\"name\":\"alupjm\",\"id\":\"fxobbcsws\",\"created\":\"2021-04-25T18:58:37Z\",\"dataReceived\":\"2021-09-18T23:40:57Z\",\"version\":\"lrbpbewtghfgbl\",\"sku\":\"wxzvlvqhjkb\"}") + "{\"serverCount\":2101228547,\"isGateway\":false,\"name\":\"mopjmc\",\"id\":\"tuo\",\"created\":\"2021-09-23T02:42:43Z\",\"dataReceived\":\"2021-10-23T10:51:29Z\",\"version\":\"uaodsfcpk\",\"sku\":\"odpuozmyzydag\"}") .toObject(ManagementGroupProperties.class); - Assertions.assertEquals(741975656, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("alupjm", model.name()); - Assertions.assertEquals("fxobbcsws", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T18:58:37Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T23:40:57Z"), model.dataReceived()); - Assertions.assertEquals("lrbpbewtghfgbl", model.version()); - Assertions.assertEquals("wxzvlvqhjkb", model.sku()); + Assertions.assertEquals(2101228547, model.serverCount()); + Assertions.assertFalse(model.isGateway()); + Assertions.assertEquals("mopjmc", model.name()); + Assertions.assertEquals("tuo", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T02:42:43Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T10:51:29Z"), model.dataReceived()); + Assertions.assertEquals("uaodsfcpk", model.version()); + Assertions.assertEquals("odpuozmyzydag", model.sku()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagementGroupProperties model = new ManagementGroupProperties().withServerCount(741975656) - .withIsGateway(true) - .withName("alupjm") - .withId("fxobbcsws") - .withCreated(OffsetDateTime.parse("2021-04-25T18:58:37Z")) - .withDataReceived(OffsetDateTime.parse("2021-09-18T23:40:57Z")) - .withVersion("lrbpbewtghfgbl") - .withSku("wxzvlvqhjkb"); + ManagementGroupProperties model = new ManagementGroupProperties().withServerCount(2101228547) + .withIsGateway(false) + .withName("mopjmc") + .withId("tuo") + .withCreated(OffsetDateTime.parse("2021-09-23T02:42:43Z")) + .withDataReceived(OffsetDateTime.parse("2021-10-23T10:51:29Z")) + .withVersion("uaodsfcpk") + .withSku("odpuozmyzydag"); model = BinaryData.fromObject(model).toObject(ManagementGroupProperties.class); - Assertions.assertEquals(741975656, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("alupjm", model.name()); - Assertions.assertEquals("fxobbcsws", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T18:58:37Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T23:40:57Z"), model.dataReceived()); - Assertions.assertEquals("lrbpbewtghfgbl", model.version()); - Assertions.assertEquals("wxzvlvqhjkb", model.sku()); + Assertions.assertEquals(2101228547, model.serverCount()); + Assertions.assertFalse(model.isGateway()); + Assertions.assertEquals("mopjmc", model.name()); + Assertions.assertEquals("tuo", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T02:42:43Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T10:51:29Z"), model.dataReceived()); + Assertions.assertEquals("uaodsfcpk", model.version()); + Assertions.assertEquals("odpuozmyzydag", model.sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java index accd55f70333..93bc4c379260 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.ManagementGroup; @@ -22,26 +22,26 @@ public final class ManagementGroupsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"serverCount\":1980561633,\"isGateway\":false,\"name\":\"tcjuahokqto\",\"id\":\"auxofshfph\",\"created\":\"2021-08-16T03:23:29Z\",\"dataReceived\":\"2021-07-09T19:35:04Z\",\"version\":\"iywzejy\",\"sku\":\"slwkojpl\"}}]}"; + = "{\"value\":[{\"properties\":{\"serverCount\":2014474860,\"isGateway\":true,\"name\":\"vnqvcd\",\"id\":\"uaucmf\",\"created\":\"2021-12-08T13:34:35Z\",\"dataReceived\":\"2021-10-13T05:52:15Z\",\"version\":\"xpunjqi\",\"sku\":\"zvvitacgxmfcs\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.managementGroups().list("taboidvmf", "hppubowsepdfgkmt", com.azure.core.util.Context.NONE); + = manager.managementGroups().list("yjqtt", "wkpqhjpenuygbq", com.azure.core.util.Context.NONE); - Assertions.assertEquals(1980561633, response.iterator().next().serverCount()); - Assertions.assertEquals(false, response.iterator().next().isGateway()); - Assertions.assertEquals("tcjuahokqto", response.iterator().next().name()); - Assertions.assertEquals("auxofshfph", response.iterator().next().id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T03:23:29Z"), response.iterator().next().created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-09T19:35:04Z"), + Assertions.assertEquals(2014474860, response.iterator().next().serverCount()); + Assertions.assertTrue(response.iterator().next().isGateway()); + Assertions.assertEquals("vnqvcd", response.iterator().next().name()); + Assertions.assertEquals("uaucmf", response.iterator().next().id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T13:34:35Z"), response.iterator().next().created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T05:52:15Z"), response.iterator().next().dataReceived()); - Assertions.assertEquals("iywzejy", response.iterator().next().version()); - Assertions.assertEquals("slwkojpl", response.iterator().next().sku()); + Assertions.assertEquals("xpunjqi", response.iterator().next().version()); + Assertions.assertEquals("zvvitacgxmfcs", response.iterator().next().sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java index ba8915de7029..0fee218fc5bb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java @@ -11,17 +11,17 @@ public final class MetricNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricName model = BinaryData.fromString("{\"value\":\"gdtpnapnyiro\",\"localizedValue\":\"hpigv\"}") + MetricName model = BinaryData.fromString("{\"value\":\"emdwzrmuhapfc\",\"localizedValue\":\"psqxq\"}") .toObject(MetricName.class); - Assertions.assertEquals("gdtpnapnyiro", model.value()); - Assertions.assertEquals("hpigv", model.localizedValue()); + Assertions.assertEquals("emdwzrmuhapfc", model.value()); + Assertions.assertEquals("psqxq", model.localizedValue()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricName model = new MetricName().withValue("gdtpnapnyiro").withLocalizedValue("hpigv"); + MetricName model = new MetricName().withValue("emdwzrmuhapfc").withLocalizedValue("psqxq"); model = BinaryData.fromObject(model).toObject(MetricName.class); - Assertions.assertEquals("gdtpnapnyiro", model.value()); - Assertions.assertEquals("hpigv", model.localizedValue()); + Assertions.assertEquals("emdwzrmuhapfc", model.value()); + Assertions.assertEquals("psqxq", model.localizedValue()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationInnerTests.java new file mode 100644 index 000000000000..a85ef70a72ba --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationInnerTests.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Failed\",\"provisioningIssues\":[{\"name\":\"iglaecx\",\"properties\":{\"issueType\":\"ConfigurationPropagationFailure\",\"severity\":\"Warning\",\"description\":\"pvz\",\"suggestedResourceIds\":[\"t\",\"ld\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"irclnpk\",\"perimeterGuid\":\"fa0916ff-3ecd-4956-b4d5-c41b1b8fe746\",\"location\":\"yzriykhy\"},\"resourceAssociation\":{\"name\":\"vjlboxqvk\",\"accessMode\":\"Enforced\"},\"profile\":{\"name\":\"omdynhdwdigum\",\"accessRulesVersion\":1924046982,\"accessRules\":[{\"name\":\"zzp\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"dz\",\"ezwwv\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"fonkphhqyikvyla\",\"yavluwmncstt\",\"jfybvpoekrsgsgb\",\"huzqgn\"],\"emailAddresses\":[\"kynscliqhzv\",\"xnkomtkubo\",\"ppnvdxz\"],\"phoneNumbers\":[\"hfrbbc\",\"vqagtltdhlf\",\"qojpy\"]}},{\"name\":\"gtrd\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"zsdymbrnysuxmpra\",\"wgck\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"ffwafq\",\"oudaspavehhrvk\",\"unzo\",\"ud\"],\"emailAddresses\":[\"gkmoyxcdyuibhmfd\"],\"phoneNumbers\":[\"ydvfvfcjnae\",\"isrvhm\"]}},{\"name\":\"r\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"cvwmzhwplefa\",\"vxilcbt\",\"nhnzeyqxt\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"hycav\",\"dggxdbeesmi\",\"knlrariaawiuagy\",\"wqfbylyrfgiagt\"],\"emailAddresses\":[\"ocqwogfnzjvus\",\"zldmozuxy\",\"fsbtkad\",\"ysownbtgkbug\"],\"phoneNumbers\":[\"cto\",\"cmisofie\",\"pe\"]}}],\"diagnosticSettingsVersion\":419692653,\"enabledLogCategories\":[\"dh\",\"u\"]}},\"id\":\"cp\",\"name\":\"cwkhihi\",\"type\":\"lhzdsqtzb\"}") + .toObject(NetworkSecurityPerimeterConfigurationInner.class); + Assertions.assertEquals("irclnpk", model.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("fa0916ff-3ecd-4956-b4d5-c41b1b8fe746"), + model.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("yzriykhy", model.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("vjlboxqvk", model.properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, + model.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("omdynhdwdigum", model.properties().profile().name()); + Assertions.assertEquals(1924046982, model.properties().profile().accessRulesVersion()); + Assertions.assertEquals("zzp", model.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, + model.properties().profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("dz", + model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("fonkphhqyikvyla", + model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("kynscliqhzv", + model.properties().profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("hfrbbc", + model.properties().profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(419692653, model.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("dh", model.properties().profile().enabledLogCategories().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeterConfigurationInner model = new NetworkSecurityPerimeterConfigurationInner() + .withProperties(new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("irclnpk") + .withPerimeterGuid(UUID.fromString("fa0916ff-3ecd-4956-b4d5-c41b1b8fe746")) + .withLocation("yzriykhy")) + .withResourceAssociation(new ResourceAssociation().withName("vjlboxqvk") + .withAccessMode(ResourceAssociationAccessMode.ENFORCED)) + .withProfile(new NetworkSecurityProfile().withName("omdynhdwdigum") + .withAccessRulesVersion(1924046982) + .withAccessRules(Arrays.asList( + new AccessRule().withName("zzp") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("dz", "ezwwv")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters( + Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames( + Arrays.asList("fonkphhqyikvyla", "yavluwmncstt", "jfybvpoekrsgsgb", "huzqgn")) + .withEmailAddresses(Arrays.asList("kynscliqhzv", "xnkomtkubo", "ppnvdxz")) + .withPhoneNumbers(Arrays.asList("hfrbbc", "vqagtltdhlf", "qojpy"))), + new AccessRule().withName("gtrd") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("zsdymbrnysuxmpra", "wgck")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("ffwafq", "oudaspavehhrvk", "unzo", "ud")) + .withEmailAddresses(Arrays.asList("gkmoyxcdyuibhmfd")) + .withPhoneNumbers(Arrays.asList("ydvfvfcjnae", "isrvhm"))), + new AccessRule().withName("r") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("cvwmzhwplefa", "vxilcbt", "nhnzeyqxt")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), + new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames( + Arrays.asList("hycav", "dggxdbeesmi", "knlrariaawiuagy", "wqfbylyrfgiagt")) + .withEmailAddresses( + Arrays.asList("ocqwogfnzjvus", "zldmozuxy", "fsbtkad", "ysownbtgkbug")) + .withPhoneNumbers(Arrays.asList("cto", "cmisofie", "pe"))))) + .withDiagnosticSettingsVersion(419692653) + .withEnabledLogCategories(Arrays.asList("dh", "u")))); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationInner.class); + Assertions.assertEquals("irclnpk", model.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("fa0916ff-3ecd-4956-b4d5-c41b1b8fe746"), + model.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("yzriykhy", model.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("vjlboxqvk", model.properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, + model.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("omdynhdwdigum", model.properties().profile().name()); + Assertions.assertEquals(1924046982, model.properties().profile().accessRulesVersion()); + Assertions.assertEquals("zzp", model.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, + model.properties().profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("dz", + model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("fonkphhqyikvyla", + model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("kynscliqhzv", + model.properties().profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("hfrbbc", + model.properties().profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(419692653, model.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("dh", model.properties().profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationListResultTests.java new file mode 100644 index 000000000000..b42919cd7469 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationListResultTests.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationListResult; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"provisioningIssues\":[{\"name\":\"tcyohpfkyrk\",\"properties\":{}},{\"name\":\"giogsjkmnwqjno\",\"properties\":{}},{\"name\":\"yhddvia\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"n\",\"perimeterGuid\":\"e47dd61c-072b-4ddc-bb17-201fe9f3719e\",\"location\":\"fpmvmemfnczd\"},\"resourceAssociation\":{\"name\":\"b\",\"accessMode\":\"Learning\"},\"profile\":{\"name\":\"lchpodbzevwrdn\",\"accessRulesVersion\":1073149595,\"accessRules\":[{}],\"diagnosticSettingsVersion\":1934709471,\"enabledLogCategories\":[\"swsmys\",\"uluqypfc\",\"lerchpq\"]}},\"id\":\"f\",\"name\":\"jbabwidf\",\"type\":\"xsspuunnoxyhk\"},{\"properties\":{\"provisioningState\":\"Updating\",\"provisioningIssues\":[{\"name\":\"hp\",\"properties\":{}},{\"name\":\"qcaaewdaomdjvl\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"kzbrmsgeivsiy\",\"perimeterGuid\":\"2bb25110-24ce-4c40-b14b-d1550a07934e\",\"location\":\"dncj\"},\"resourceAssociation\":{\"name\":\"nbzoggcu\",\"accessMode\":\"Audit\"},\"profile\":{\"name\":\"y\",\"accessRulesVersion\":1152319383,\"accessRules\":[{},{}],\"diagnosticSettingsVersion\":902332511,\"enabledLogCategories\":[\"pnylb\",\"uajlyj\"]}},\"id\":\"vofqzhvfc\",\"name\":\"byfmowuxr\",\"type\":\"jpvd\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningIssues\":[{\"name\":\"vwzjbhyz\",\"properties\":{}},{\"name\":\"rkambt\",\"properties\":{}},{\"name\":\"gvmnvuqeq\",\"properties\":{}},{\"name\":\"spastjbkkdmf\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"tmjlx\",\"perimeterGuid\":\"3d5425f3-7ad7-44f9-97df-905f3d3bc5fc\",\"location\":\"lozapeewchpxlk\"},\"resourceAssociation\":{\"name\":\"uziycsl\",\"accessMode\":\"Audit\"},\"profile\":{\"name\":\"ztcktyh\",\"accessRulesVersion\":400720959,\"accessRules\":[{},{}],\"diagnosticSettingsVersion\":1002446412,\"enabledLogCategories\":[\"lwmmrqzzrrjv\"]}},\"id\":\"lydzgk\",\"name\":\"vqeevtoep\",\"type\":\"yutnwytpzdmov\"}],\"nextLink\":\"fvaawzqa\"}") + .toObject(NetworkSecurityPerimeterConfigurationListResult.class); + Assertions.assertEquals("n", model.value().get(0).properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("e47dd61c-072b-4ddc-bb17-201fe9f3719e"), + model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("fpmvmemfnczd", + model.value().get(0).properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("b", model.value().get(0).properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + model.value().get(0).properties().resourceAssociation().accessMode()); + Assertions.assertEquals("lchpodbzevwrdn", model.value().get(0).properties().profile().name()); + Assertions.assertEquals(1073149595, model.value().get(0).properties().profile().accessRulesVersion()); + Assertions.assertEquals(1934709471, model.value().get(0).properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("swsmys", model.value().get(0).properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("fvaawzqa", model.nextLink()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeterConfigurationListResult model + = new NetworkSecurityPerimeterConfigurationListResult() + .withValue( + Arrays + .asList( + new NetworkSecurityPerimeterConfigurationInner() + .withProperties( + new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("n") + .withPerimeterGuid(UUID.fromString("e47dd61c-072b-4ddc-bb17-201fe9f3719e")) + .withLocation("fpmvmemfnczd")) + .withResourceAssociation(new ResourceAssociation().withName("b") + .withAccessMode(ResourceAssociationAccessMode.LEARNING)) + .withProfile( + new NetworkSecurityProfile().withName("lchpodbzevwrdn") + .withAccessRulesVersion(1073149595) + .withAccessRules(Arrays.asList(new AccessRule())) + .withDiagnosticSettingsVersion(1934709471) + .withEnabledLogCategories(Arrays.asList("swsmys", "uluqypfc", + "lerchpq")))), + new NetworkSecurityPerimeterConfigurationInner() + .withProperties(new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("kzbrmsgeivsiy") + .withPerimeterGuid(UUID.fromString("2bb25110-24ce-4c40-b14b-d1550a07934e")) + .withLocation("dncj")) + .withResourceAssociation(new ResourceAssociation().withName("nbzoggcu") + .withAccessMode(ResourceAssociationAccessMode.AUDIT)) + .withProfile(new NetworkSecurityProfile().withName("y") + .withAccessRulesVersion(1152319383) + .withAccessRules(Arrays.asList(new AccessRule(), new AccessRule())) + .withDiagnosticSettingsVersion(902332511) + .withEnabledLogCategories(Arrays.asList("pnylb", "uajlyj")))), + new NetworkSecurityPerimeterConfigurationInner() + .withProperties(new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("tmjlx") + .withPerimeterGuid(UUID.fromString("3d5425f3-7ad7-44f9-97df-905f3d3bc5fc")) + .withLocation("lozapeewchpxlk")) + .withResourceAssociation(new ResourceAssociation().withName("uziycsl") + .withAccessMode(ResourceAssociationAccessMode.AUDIT)) + .withProfile(new NetworkSecurityProfile().withName("ztcktyh") + .withAccessRulesVersion(400720959) + .withAccessRules(Arrays.asList(new AccessRule(), new AccessRule())) + .withDiagnosticSettingsVersion(1002446412) + .withEnabledLogCategories(Arrays.asList("lwmmrqzzrrjv")))))) + .withNextLink("fvaawzqa"); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationListResult.class); + Assertions.assertEquals("n", model.value().get(0).properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("e47dd61c-072b-4ddc-bb17-201fe9f3719e"), + model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("fpmvmemfnczd", + model.value().get(0).properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("b", model.value().get(0).properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + model.value().get(0).properties().resourceAssociation().accessMode()); + Assertions.assertEquals("lchpodbzevwrdn", model.value().get(0).properties().profile().name()); + Assertions.assertEquals(1073149595, model.value().get(0).properties().profile().accessRulesVersion()); + Assertions.assertEquals(1934709471, model.value().get(0).properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("swsmys", model.value().get(0).properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("fvaawzqa", model.nextLink()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java new file mode 100644 index 000000000000..55bd440c1a0d --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Canceled\",\"provisioningIssues\":[{\"name\":\"cjhfgmvecactxmw\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Error\",\"description\":\"luqovekqvg\",\"suggestedResourceIds\":[\"wifzmp\",\"wyivqikf\",\"cvhrfsp\"],\"suggestedAccessRules\":[{\"name\":\"rttikteusqc\",\"properties\":{}}]}}],\"networkSecurityPerimeter\":{\"id\":\"klxubyja\",\"perimeterGuid\":\"144b015c-170a-4060-be36-bdf1b0e5ee4e\",\"location\":\"mfblcqcuubg\"},\"resourceAssociation\":{\"name\":\"rtalmet\",\"accessMode\":\"Enforced\"},\"profile\":{\"name\":\"slqxi\",\"accessRulesVersion\":5802151,\"accessRules\":[{\"name\":\"i\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"xiutcx\",\"pzhyr\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"joxslhvnhla\",\"rqnkkzjcjbtr\"],\"emailAddresses\":[\"hvv\",\"brxjjsto\"],\"phoneNumbers\":[\"it\",\"kxzt\",\"oobklftidgfcwq\"]}},{\"name\":\"imaq\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"yhohujswtwkozzwc\",\"lkb\",\"wpfaj\",\"jwltlwtjjgu\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"vkcdmxzr\",\"oaimlnw\",\"aaomylweazu\"],\"emailAddresses\":[\"ethwwnpjhlfz\",\"wpchwahf\"],\"phoneNumbers\":[\"snfepgfewetwlyx\",\"ncxykxhdjhlimm\",\"cxfhbcporxv\"]}},{\"name\":\"jzh\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"xtgqscjavftjuh\",\"qaz\",\"mtggu\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"civmmg\",\"f\"],\"emailAddresses\":[\"wrxgkneuvy\",\"nzqodfvpg\"],\"phoneNumbers\":[\"xgsg\",\"p\",\"gzdjtxvzf\",\"bqvgaqv\"]}}],\"diagnosticSettingsVersion\":247476852,\"enabledLogCategories\":[\"qusrdvetnws\",\"tutnwlduycvuzhyr\"]}}") + .toObject(NetworkSecurityPerimeterConfigurationProperties.class); + Assertions.assertEquals("klxubyja", model.networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("144b015c-170a-4060-be36-bdf1b0e5ee4e"), + model.networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("mfblcqcuubg", model.networkSecurityPerimeter().location()); + Assertions.assertEquals("rtalmet", model.resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, model.resourceAssociation().accessMode()); + Assertions.assertEquals("slqxi", model.profile().name()); + Assertions.assertEquals(5802151, model.profile().accessRulesVersion()); + Assertions.assertEquals("i", model.profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, + model.profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("xiutcx", model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("joxslhvnhla", + model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("hvv", model.profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("it", model.profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(247476852, model.profile().diagnosticSettingsVersion()); + Assertions.assertEquals("qusrdvetnws", model.profile().enabledLogCategories().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeterConfigurationProperties model = new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("klxubyja") + .withPerimeterGuid(UUID.fromString("144b015c-170a-4060-be36-bdf1b0e5ee4e")) + .withLocation("mfblcqcuubg")) + .withResourceAssociation( + new ResourceAssociation().withName("rtalmet").withAccessMode(ResourceAssociationAccessMode.ENFORCED)) + .withProfile(new NetworkSecurityProfile().withName("slqxi") + .withAccessRulesVersion(5802151) + .withAccessRules(Arrays.asList( + new AccessRule().withName("i") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("xiutcx", "pzhyr")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("joxslhvnhla", "rqnkkzjcjbtr")) + .withEmailAddresses(Arrays.asList("hvv", "brxjjsto")) + .withPhoneNumbers(Arrays.asList("it", "kxzt", "oobklftidgfcwq"))), + new AccessRule().withName("imaq") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("yhohujswtwkozzwc", "lkb", "wpfaj", "jwltlwtjjgu")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), + new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("vkcdmxzr", "oaimlnw", "aaomylweazu")) + .withEmailAddresses(Arrays.asList("ethwwnpjhlfz", "wpchwahf")) + .withPhoneNumbers(Arrays.asList("snfepgfewetwlyx", "ncxykxhdjhlimm", "cxfhbcporxv"))), + new AccessRule().withName("jzh") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("xtgqscjavftjuh", "qaz", "mtggu")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("civmmg", "f")) + .withEmailAddresses(Arrays.asList("wrxgkneuvy", "nzqodfvpg")) + .withPhoneNumbers(Arrays.asList("xgsg", "p", "gzdjtxvzf", "bqvgaqv"))))) + .withDiagnosticSettingsVersion(247476852) + .withEnabledLogCategories(Arrays.asList("qusrdvetnws", "tutnwlduycvuzhyr"))); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationProperties.class); + Assertions.assertEquals("klxubyja", model.networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("144b015c-170a-4060-be36-bdf1b0e5ee4e"), + model.networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("mfblcqcuubg", model.networkSecurityPerimeter().location()); + Assertions.assertEquals("rtalmet", model.resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, model.resourceAssociation().accessMode()); + Assertions.assertEquals("slqxi", model.profile().name()); + Assertions.assertEquals(5802151, model.profile().accessRulesVersion()); + Assertions.assertEquals("i", model.profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, + model.profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("xiutcx", model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("joxslhvnhla", + model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("hvv", model.profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("it", model.profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(247476852, model.profile().diagnosticSettingsVersion()); + Assertions.assertEquals("qusrdvetnws", model.profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterTests.java new file mode 100644 index 000000000000..eaa666e46718 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterTests.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.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeter model = BinaryData + .fromString( + "{\"id\":\"fdvruz\",\"perimeterGuid\":\"acdb3fe4-f602-47bc-ae5f-06f025c74d7f\",\"location\":\"ojhp\"}") + .toObject(NetworkSecurityPerimeter.class); + Assertions.assertEquals("fdvruz", model.id()); + Assertions.assertEquals(UUID.fromString("acdb3fe4-f602-47bc-ae5f-06f025c74d7f"), model.perimeterGuid()); + Assertions.assertEquals("ojhp", model.location()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeter model = new NetworkSecurityPerimeter().withId("fdvruz") + .withPerimeterGuid(UUID.fromString("acdb3fe4-f602-47bc-ae5f-06f025c74d7f")) + .withLocation("ojhp"); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeter.class); + Assertions.assertEquals("fdvruz", model.id()); + Assertions.assertEquals(UUID.fromString("acdb3fe4-f602-47bc-ae5f-06f025c74d7f"), model.perimeterGuid()); + Assertions.assertEquals("ojhp", model.location()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityProfileTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityProfileTests.java new file mode 100644 index 000000000000..354d5c426ba6 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityProfileTests.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.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityProfile model = BinaryData.fromString( + "{\"name\":\"ugeyzihgrkyuiza\",\"accessRulesVersion\":1192399452,\"accessRules\":[{\"name\":\"phojeevyhy\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"zbgomfgbeg\",\"qgleohibetnluank\",\"rfxeeebtij\"],\"subscriptions\":[{\"id\":\"bmqzbqqxlajrnwx\"},{\"id\":\"evehjkuyxoaf\"}],\"networkSecurityPerimeters\":[{\"id\":\"lt\",\"perimeterGuid\":\"cc01bf33-ad8d-4b13-8050-cf28e1d0b1d6\",\"location\":\"yl\"},{\"id\":\"mfgvxirpghriypo\",\"perimeterGuid\":\"01e0c3e3-1aee-4326-9024-494e3ab2d43f\",\"location\":\"hlqhykprlpy\"}],\"fullyQualifiedDomainNames\":[\"ciqdsme\",\"iitdfuxt\"],\"emailAddresses\":[\"iibmi\",\"bnn\",\"stgnl\",\"hnmgixhcm\"],\"phoneNumbers\":[\"qfoudorhcgyy\",\"rotwypundmbxhugc\",\"jkavl\"]}},{\"name\":\"rb\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"tzfjltf\",\"nzcyjtotp\",\"opv\",\"bdb\"],\"subscriptions\":[{\"id\":\"q\"},{\"id\":\"edsvqwthmk\"},{\"id\":\"bcysih\"}],\"networkSecurityPerimeters\":[{\"id\":\"wdhohsdtmcdzsu\",\"perimeterGuid\":\"cc5e625e-91c2-4e53-bd0f-2d47b117e538\",\"location\":\"hdxbzlm\"},{\"id\":\"uapcvhdbevwqqxe\",\"perimeterGuid\":\"6d6bf008-2b16-44a8-84c3-808f6ee860cf\",\"location\":\"onqzinkfkbgbzbow\"}],\"fullyQualifiedDomainNames\":[\"o\"],\"emailAddresses\":[\"mygvkzqkj\",\"eokbze\"],\"phoneNumbers\":[\"rx\",\"czurtlei\",\"q\"]}}],\"diagnosticSettingsVersion\":796775151,\"enabledLogCategories\":[\"zgnzv\"]}") + .toObject(NetworkSecurityProfile.class); + Assertions.assertEquals("ugeyzihgrkyuiza", model.name()); + Assertions.assertEquals(1192399452, model.accessRulesVersion()); + Assertions.assertEquals("phojeevyhy", model.accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, model.accessRules().get(0).properties().direction()); + Assertions.assertEquals("zbgomfgbeg", model.accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("bmqzbqqxlajrnwx", model.accessRules().get(0).properties().subscriptions().get(0).id()); + Assertions.assertEquals("lt", model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("cc01bf33-ad8d-4b13-8050-cf28e1d0b1d6"), + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("yl", + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("ciqdsme", model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iibmi", model.accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("qfoudorhcgyy", model.accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(796775151, model.diagnosticSettingsVersion()); + Assertions.assertEquals("zgnzv", model.enabledLogCategories().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityProfile model + = new NetworkSecurityProfile().withName("ugeyzihgrkyuiza") + .withAccessRulesVersion(1192399452) + .withAccessRules( + Arrays + .asList( + new AccessRule().withName("phojeevyhy") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("zbgomfgbeg", "qgleohibetnluank", "rfxeeebtij")) + .withSubscriptions(Arrays + .asList(new AccessRulePropertiesSubscriptionsItem().withId("bmqzbqqxlajrnwx"), + new AccessRulePropertiesSubscriptionsItem().withId("evehjkuyxoaf"))) + .withNetworkSecurityPerimeters( + Arrays.asList( + new NetworkSecurityPerimeter().withId("lt") + .withPerimeterGuid( + UUID.fromString("cc01bf33-ad8d-4b13-8050-cf28e1d0b1d6")) + .withLocation("yl"), + new NetworkSecurityPerimeter().withId("mfgvxirpghriypo") + .withPerimeterGuid( + UUID.fromString("01e0c3e3-1aee-4326-9024-494e3ab2d43f")) + .withLocation("hlqhykprlpy"))) + .withFullyQualifiedDomainNames(Arrays.asList("ciqdsme", "iitdfuxt")) + .withEmailAddresses(Arrays.asList("iibmi", "bnn", "stgnl", "hnmgixhcm")) + .withPhoneNumbers(Arrays.asList("qfoudorhcgyy", "rotwypundmbxhugc", "jkavl"))), + new AccessRule().withName("rb") + .withProperties( + new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("tzfjltf", "nzcyjtotp", "opv", "bdb")) + .withSubscriptions( + Arrays.asList(new AccessRulePropertiesSubscriptionsItem().withId("q"), + new AccessRulePropertiesSubscriptionsItem().withId("edsvqwthmk"), + new AccessRulePropertiesSubscriptionsItem().withId("bcysih"))) + .withNetworkSecurityPerimeters(Arrays.asList( + new NetworkSecurityPerimeter().withId("wdhohsdtmcdzsu") + .withPerimeterGuid( + UUID.fromString("cc5e625e-91c2-4e53-bd0f-2d47b117e538")) + .withLocation("hdxbzlm"), + new NetworkSecurityPerimeter().withId("uapcvhdbevwqqxe") + .withPerimeterGuid( + UUID.fromString("6d6bf008-2b16-44a8-84c3-808f6ee860cf")) + .withLocation("onqzinkfkbgbzbow"))) + .withFullyQualifiedDomainNames(Arrays.asList("o")) + .withEmailAddresses(Arrays.asList("mygvkzqkj", "eokbze")) + .withPhoneNumbers(Arrays.asList("rx", "czurtlei", "q"))))) + .withDiagnosticSettingsVersion(796775151) + .withEnabledLogCategories(Arrays.asList("zgnzv")); + model = BinaryData.fromObject(model).toObject(NetworkSecurityProfile.class); + Assertions.assertEquals("ugeyzihgrkyuiza", model.name()); + Assertions.assertEquals(1192399452, model.accessRulesVersion()); + Assertions.assertEquals("phojeevyhy", model.accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, model.accessRules().get(0).properties().direction()); + Assertions.assertEquals("zbgomfgbeg", model.accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("bmqzbqqxlajrnwx", model.accessRules().get(0).properties().subscriptions().get(0).id()); + Assertions.assertEquals("lt", model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("cc01bf33-ad8d-4b13-8050-cf28e1d0b1d6"), + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("yl", + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("ciqdsme", model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iibmi", model.accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("qfoudorhcgyy", model.accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(796775151, model.diagnosticSettingsVersion()); + Assertions.assertEquals("zgnzv", model.enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java index 658596d1c0f9..6f839b25fa58 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java @@ -12,24 +12,24 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"znqntoru\",\"resource\":\"gsahmkycgrauw\",\"operation\":\"etaebu\",\"description\":\"vdmovsmzlxwabm\"}") + "{\"provider\":\"ugidyjrr\",\"resource\":\"y\",\"operation\":\"svexcsonpclhoco\",\"description\":\"lkevle\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("znqntoru", model.provider()); - Assertions.assertEquals("gsahmkycgrauw", model.resource()); - Assertions.assertEquals("etaebu", model.operation()); - Assertions.assertEquals("vdmovsmzlxwabm", model.description()); + Assertions.assertEquals("ugidyjrr", model.provider()); + Assertions.assertEquals("y", model.resource()); + Assertions.assertEquals("svexcsonpclhoco", model.operation()); + Assertions.assertEquals("lkevle", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("znqntoru") - .withResource("gsahmkycgrauw") - .withOperation("etaebu") - .withDescription("vdmovsmzlxwabm"); + OperationDisplay model = new OperationDisplay().withProvider("ugidyjrr") + .withResource("y") + .withOperation("svexcsonpclhoco") + .withDescription("lkevle"); model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("znqntoru", model.provider()); - Assertions.assertEquals("gsahmkycgrauw", model.resource()); - Assertions.assertEquals("etaebu", model.operation()); - Assertions.assertEquals("vdmovsmzlxwabm", model.description()); + Assertions.assertEquals("ugidyjrr", model.provider()); + Assertions.assertEquals("y", model.resource()); + Assertions.assertEquals("svexcsonpclhoco", model.operation()); + Assertions.assertEquals("lkevle", model.description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java index 0c58020760f3..230330b39037 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java @@ -13,27 +13,27 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"vxb\",\"display\":{\"provider\":\"udutnco\",\"resource\":\"r\",\"operation\":\"qtvcofudflvkgj\",\"description\":\"gdknnqv\"}}") + "{\"name\":\"sa\",\"display\":{\"provider\":\"ku\",\"resource\":\"oskg\",\"operation\":\"auu\",\"description\":\"jmvxie\"}}") .toObject(OperationInner.class); - Assertions.assertEquals("vxb", model.name()); - Assertions.assertEquals("udutnco", model.display().provider()); - Assertions.assertEquals("r", model.display().resource()); - Assertions.assertEquals("qtvcofudflvkgj", model.display().operation()); - Assertions.assertEquals("gdknnqv", model.display().description()); + Assertions.assertEquals("sa", model.name()); + Assertions.assertEquals("ku", model.display().provider()); + Assertions.assertEquals("oskg", model.display().resource()); + Assertions.assertEquals("auu", model.display().operation()); + Assertions.assertEquals("jmvxie", model.display().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("vxb") - .withDisplay(new OperationDisplay().withProvider("udutnco") - .withResource("r") - .withOperation("qtvcofudflvkgj") - .withDescription("gdknnqv")); + OperationInner model = new OperationInner().withName("sa") + .withDisplay(new OperationDisplay().withProvider("ku") + .withResource("oskg") + .withOperation("auu") + .withDescription("jmvxie")); model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("vxb", model.name()); - Assertions.assertEquals("udutnco", model.display().provider()); - Assertions.assertEquals("r", model.display().resource()); - Assertions.assertEquals("qtvcofudflvkgj", model.display().operation()); - Assertions.assertEquals("gdknnqv", model.display().description()); + Assertions.assertEquals("sa", model.name()); + Assertions.assertEquals("ku", model.display().provider()); + Assertions.assertEquals("oskg", model.display().resource()); + Assertions.assertEquals("auu", model.display().operation()); + Assertions.assertEquals("jmvxie", model.display().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java index c98a9d19a474..3b474d738a34 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java @@ -15,28 +15,38 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"xzfe\",\"display\":{\"provider\":\"ppriol\",\"resource\":\"rjaltolmncw\",\"operation\":\"bqwcsdbnwdcf\",\"description\":\"cqdpfuv\"}}],\"nextLink\":\"sbjjc\"}") + "{\"value\":[{\"name\":\"bezy\",\"display\":{\"provider\":\"kktwhrdxw\",\"resource\":\"wqsmbsur\",\"operation\":\"imoryocfsfksym\",\"description\":\"ys\"}},{\"name\":\"i\",\"display\":{\"provider\":\"hqyudxorrqnbpoc\",\"resource\":\"yifqrvkdvjsllrmv\",\"operation\":\"f\",\"description\":\"t\"}},{\"name\":\"n\",\"display\":{\"provider\":\"exxbczwtr\",\"resource\":\"iqzbq\",\"operation\":\"sovmyokacspkwl\",\"description\":\"dobpxjmflbvvn\"}}],\"nextLink\":\"rkcciwwzjuqk\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("xzfe", model.value().get(0).name()); - Assertions.assertEquals("ppriol", model.value().get(0).display().provider()); - Assertions.assertEquals("rjaltolmncw", model.value().get(0).display().resource()); - Assertions.assertEquals("bqwcsdbnwdcf", model.value().get(0).display().operation()); - Assertions.assertEquals("cqdpfuv", model.value().get(0).display().description()); + Assertions.assertEquals("bezy", model.value().get(0).name()); + Assertions.assertEquals("kktwhrdxw", model.value().get(0).display().provider()); + Assertions.assertEquals("wqsmbsur", model.value().get(0).display().resource()); + Assertions.assertEquals("imoryocfsfksym", model.value().get(0).display().operation()); + Assertions.assertEquals("ys", model.value().get(0).display().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationListResult model - = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("xzfe") - .withDisplay(new OperationDisplay().withProvider("ppriol") - .withResource("rjaltolmncw") - .withOperation("bqwcsdbnwdcf") - .withDescription("cqdpfuv")))); + OperationListResult model = new OperationListResult().withValue(Arrays.asList( + new OperationInner().withName("bezy") + .withDisplay(new OperationDisplay().withProvider("kktwhrdxw") + .withResource("wqsmbsur") + .withOperation("imoryocfsfksym") + .withDescription("ys")), + new OperationInner().withName("i") + .withDisplay(new OperationDisplay().withProvider("hqyudxorrqnbpoc") + .withResource("yifqrvkdvjsllrmv") + .withOperation("f") + .withDescription("t")), + new OperationInner().withName("n") + .withDisplay(new OperationDisplay().withProvider("exxbczwtr") + .withResource("iqzbq") + .withOperation("sovmyokacspkwl") + .withDescription("dobpxjmflbvvn")))); model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("xzfe", model.value().get(0).name()); - Assertions.assertEquals("ppriol", model.value().get(0).display().provider()); - Assertions.assertEquals("rjaltolmncw", model.value().get(0).display().resource()); - Assertions.assertEquals("bqwcsdbnwdcf", model.value().get(0).display().operation()); - Assertions.assertEquals("cqdpfuv", model.value().get(0).display().description()); + Assertions.assertEquals("bezy", model.value().get(0).name()); + Assertions.assertEquals("kktwhrdxw", model.value().get(0).display().provider()); + Assertions.assertEquals("wqsmbsur", model.value().get(0).display().resource()); + Assertions.assertEquals("imoryocfsfksym", model.value().get(0).display().operation()); + Assertions.assertEquals("ys", model.value().get(0).display().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java index 3afabcdaf67d..5b44dd0d0ebd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.Operation; @@ -22,21 +22,21 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"xkykxdssjp\",\"display\":{\"provider\":\"ucfx\",\"resource\":\"kkflrmymyincqlhr\",\"operation\":\"wslmiiiovgqcg\",\"description\":\"ugqkctotiowlxteq\"}}]}"; + = "{\"value\":[{\"name\":\"rxhtvso\",\"display\":{\"provider\":\"wntsjgqrsxy\",\"resource\":\"uuuybnchrsziz\",\"operation\":\"uelyetndn\",\"description\":\"qyggagfl\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("xkykxdssjp", response.iterator().next().name()); - Assertions.assertEquals("ucfx", response.iterator().next().display().provider()); - Assertions.assertEquals("kkflrmymyincqlhr", response.iterator().next().display().resource()); - Assertions.assertEquals("wslmiiiovgqcg", response.iterator().next().display().operation()); - Assertions.assertEquals("ugqkctotiowlxteq", response.iterator().next().display().description()); + Assertions.assertEquals("rxhtvso", response.iterator().next().name()); + Assertions.assertEquals("wntsjgqrsxy", response.iterator().next().display().provider()); + Assertions.assertEquals("uuuybnchrsziz", response.iterator().next().display().resource()); + Assertions.assertEquals("uelyetndn", response.iterator().next().display().operation()); + Assertions.assertEquals("qyggagfl", response.iterator().next().display().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java index 653f54965b40..25393ad99897 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java @@ -11,19 +11,17 @@ public final class PrivateLinkScopedResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkScopedResource model - = BinaryData.fromString("{\"resourceId\":\"iakp\",\"scopeId\":\"qqmtedltmmji\"}") - .toObject(PrivateLinkScopedResource.class); - Assertions.assertEquals("iakp", model.resourceId()); - Assertions.assertEquals("qqmtedltmmji", model.scopeId()); + PrivateLinkScopedResource model = BinaryData.fromString("{\"resourceId\":\"bar\",\"scopeId\":\"uayjkqa\"}") + .toObject(PrivateLinkScopedResource.class); + Assertions.assertEquals("bar", model.resourceId()); + Assertions.assertEquals("uayjkqa", model.scopeId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateLinkScopedResource model - = new PrivateLinkScopedResource().withResourceId("iakp").withScopeId("qqmtedltmmji"); + PrivateLinkScopedResource model = new PrivateLinkScopedResource().withResourceId("bar").withScopeId("uayjkqa"); model = BinaryData.fromObject(model).toObject(PrivateLinkScopedResource.class); - Assertions.assertEquals("iakp", model.resourceId()); - Assertions.assertEquals("qqmtedltmmji", model.scopeId()); + Assertions.assertEquals("bar", model.resourceId()); + Assertions.assertEquals("uayjkqa", model.scopeId()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssuePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssuePropertiesTests.java new file mode 100644 index 000000000000..590d63691346 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssuePropertiesTests.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.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ProvisioningIssueProperties; + +public final class ProvisioningIssuePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProvisioningIssueProperties model = BinaryData.fromString( + "{\"issueType\":\"ConfigurationPropagationFailure\",\"severity\":\"Error\",\"description\":\"jjidjk\",\"suggestedResourceIds\":[\"kyxvxevblbjedn\",\"jlageu\",\"ulxunsmjbnkpp\"],\"suggestedAccessRules\":[{\"name\":\"nlsvxeiz\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"srmffeycxcktpiym\",\"rteeamm\",\"qiekkkzddrt\"],\"subscriptions\":[{\"id\":\"jbmxvavre\"}],\"networkSecurityPerimeters\":[{\"id\":\"svecuijpxtxs\",\"perimeterGuid\":\"adc52fcf-9956-4d7b-b885-5aa059cb79b8\",\"location\":\"rtujwsawddjibab\"},{\"id\":\"ititvtzeexavoxt\",\"perimeterGuid\":\"c8f16ee6-1657-4bf8-bb1f-7a971bba3367\",\"location\":\"ecdmdqbwpy\"}],\"fullyQualifiedDomainNames\":[\"gsfjac\",\"slhhxudbxv\"],\"emailAddresses\":[\"tnsi\",\"ud\"],\"phoneNumbers\":[\"mes\"]}},{\"name\":\"dlpagzrcxfail\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"boxdfgsftufq\",\"brjlnacgcckknhxk\",\"zvytnrzvuljraaer\",\"nok\"],\"subscriptions\":[{\"id\":\"kjq\"},{\"id\":\"broyla\"},{\"id\":\"ulcdisdosf\"},{\"id\":\"jsvg\"}],\"networkSecurityPerimeters\":[{\"id\":\"r\",\"perimeterGuid\":\"c2df6ff4-e0a7-439d-95d8-4f31eca1799f\",\"location\":\"cytdclxgccknfnwm\"},{\"id\":\"mvpdvjdhttzaef\",\"perimeterGuid\":\"72f9d23f-fe31-48a0-920c-847f5c621db6\",\"location\":\"ihchrphkmcrjdqn\"},{\"id\":\"fzpbgtgkyl\",\"perimeterGuid\":\"0966ae6c-c4d9-4729-b0ac-5ca57e868429\",\"location\":\"hrjeuutlw\"}],\"fullyQualifiedDomainNames\":[\"w\"],\"emailAddresses\":[\"kvbwnhhtqlgeh\",\"ppipifhpfeoa\",\"vgcxtx\",\"csheafidltugsr\"],\"phoneNumbers\":[\"kssjhoiftxfk\"]}},{\"name\":\"egprhptil\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"tgdqohmcwsldriz\",\"tpwb\",\"a\"],\"subscriptions\":[{\"id\":\"bphbqzmizakakank\"},{\"id\":\"dnjzh\"}],\"networkSecurityPerimeters\":[{\"id\":\"lhjlmuoyxprimr\",\"perimeterGuid\":\"b115af21-822a-496e-a1a4-18719c29d3b9\",\"location\":\"teecjmeislst\"},{\"id\":\"sylwxdzaumweooh\",\"perimeterGuid\":\"d109b4d6-3814-4e24-9057-c2d4006327a5\",\"location\":\"fuzboyjathwtzolb\"},{\"id\":\"mwmdxmebwjscjpa\",\"perimeterGuid\":\"20275b08-25e9-4438-9163-ba926dcda966\",\"location\":\"veabfqxnmwmqtib\"},{\"id\":\"ijddtvqc\",\"perimeterGuid\":\"8b3f4632-9d68-4176-bca0-f95e8827288a\",\"location\":\"dija\"}],\"fullyQualifiedDomainNames\":[\"mrsieekp\"],\"emailAddresses\":[\"aapm\",\"dqmeqwigpibudq\",\"yxeb\",\"ybpmzznrtffyaq\"],\"phoneNumbers\":[\"hheioqaqhvseuf\"]}}]}") + .toObject(ProvisioningIssueProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProvisioningIssueProperties model = new ProvisioningIssueProperties(); + model = BinaryData.fromObject(model).toObject(ProvisioningIssueProperties.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssueTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssueTests.java new file mode 100644 index 000000000000..5dfb515c0292 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssueTests.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.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ProvisioningIssue; + +public final class ProvisioningIssueTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProvisioningIssue model = BinaryData.fromString( + "{\"name\":\"wipmvekdxuk\",\"properties\":{\"issueType\":\"MissingIdentityConfiguration\",\"severity\":\"Error\",\"description\":\"undxgketw\",\"suggestedResourceIds\":[\"zjhfjmhvv\",\"uvgp\"],\"suggestedAccessRules\":[{\"name\":\"qsxvmhf\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"hsasbhu\",\"ypoh\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"nsqyrpfoobrltt\",\"msjnygqdnfw\",\"zdzgtilaxhnfhqly\"],\"emailAddresses\":[\"ouwivkxoyzunbixx\"],\"phoneNumbers\":[\"kvcpwpgclr\",\"ivtsoxfrkenxpm\"]}},{\"name\":\"efrp\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"skawaoqvmmb\",\"pqfrtqlkz\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"vkxlz\",\"qdrfegcealzxwhc\",\"nsymoyqhlwigd\"],\"emailAddresses\":[\"kbxgom\",\"ajuwas\",\"vdaeyyguxakjsq\"],\"phoneNumbers\":[\"bezkgimsidxasic\",\"dyvvjskgfmocwahp\",\"gat\",\"eaahhvjhhn\"]}}]}}") + .toObject(ProvisioningIssue.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProvisioningIssue model = new ProvisioningIssue(); + model = BinaryData.fromObject(model).toObject(ProvisioningIssue.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java index 24e1bf1eae46..c9626f6d165d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.queries().deleteWithResponse("jdfqwmkyoqufdvr", "zslzojhp", "tfnmdx", com.azure.core.util.Context.NONE); + manager.queries() + .deleteWithResponse("yjucejikzoeo", "vtzejetjklnti", "yjuzkdb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java index 1eee646bd614..24a7a169654d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -21,25 +21,25 @@ public final class QueriesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"id\":\"woycqucwyha\",\"displayName\":\"nomdrkywuhpsv\",\"timeCreated\":\"2021-05-26T05:35:58Z\",\"timeModified\":\"2021-01-31T05:51:43Z\",\"author\":\"lwexxwl\",\"description\":\"niexzsrzpgepq\",\"body\":\"yb\",\"related\":{\"categories\":[\"gdakchz\",\"vl\",\"xqnrkcxk\"],\"resourceTypes\":[\"nxm\"],\"solutions\":[\"xs\",\"qrntv\",\"wijpsttexoqqpwc\"]},\"tags\":{\"ndy\":[\"mhruncuwm\",\"spkcdqzh\",\"ctddun\"],\"boxjumvq\":[\"chrqb\",\"jjrcgegydc\"]},\"properties\":\"datalihrraiouaubr\"},\"id\":\"loqxfuojrngif\",\"name\":\"z\",\"type\":\"sccbiuimzd\"}"; + = "{\"properties\":{\"id\":\"rtws\",\"displayName\":\"hv\",\"timeCreated\":\"2021-09-06T01:44:02Z\",\"timeModified\":\"2021-03-26T17:24:30Z\",\"author\":\"vtrrmhwrbfdpyflu\",\"description\":\"vjglrocuyzlwhhme\",\"body\":\"hoocl\",\"related\":{\"categories\":[\"qmemc\",\"jk\"],\"resourceTypes\":[\"kyujxsglhsrrr\",\"ejylmbkzu\"],\"solutions\":[\"grfihotjewlp\",\"uzzjgnrefq\",\"hqo\"]},\"tags\":{\"tgbebj\":[\"iqakydiwfbr\",\"wpzdqtvhcspo\",\"aqa\",\"sipi\"],\"uhplrvkmjcwmjv\":[\"lbmoichd\",\"pnfpubntnbat\",\"viqsowsaaelcattc\"],\"idqlvhu\":[\"fggc\",\"kyylizr\",\"bjpsfxsfuztlvtm\",\"agb\"]},\"properties\":\"dataveo\"},\"id\":\"zrvjfnmjmvlwyzgi\",\"name\":\"lkujrllfojui\",\"type\":\"jpu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPackQuery response = manager.queries() - .getWithResponse("cqpbtuo", "xesz", "bbelawumuaslzk", com.azure.core.util.Context.NONE) + .getWithResponse("mtkhlowkxxpvbr", "fjmzsyzfho", "lhikcyychunsj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("nomdrkywuhpsv", response.displayName()); - Assertions.assertEquals("niexzsrzpgepq", response.description()); - Assertions.assertEquals("yb", response.body()); - Assertions.assertEquals("gdakchz", response.related().categories().get(0)); - Assertions.assertEquals("nxm", response.related().resourceTypes().get(0)); - Assertions.assertEquals("xs", response.related().solutions().get(0)); - Assertions.assertEquals("mhruncuwm", response.tags().get("ndy").get(0)); + Assertions.assertEquals("hv", response.displayName()); + Assertions.assertEquals("vjglrocuyzlwhhme", response.description()); + Assertions.assertEquals("hoocl", response.body()); + Assertions.assertEquals("qmemc", response.related().categories().get(0)); + Assertions.assertEquals("kyujxsglhsrrr", response.related().resourceTypes().get(0)); + Assertions.assertEquals("grfihotjewlp", response.related().solutions().get(0)); + Assertions.assertEquals("iqakydiwfbr", response.tags().get("tgbebj").get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java index cebe44dbb225..57f1762ccd5f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -22,24 +22,25 @@ public final class QueriesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"id\":\"rcxfailcfxwmdb\",\"displayName\":\"xdfgsftufqobr\",\"timeCreated\":\"2021-06-10T09:16:23Z\",\"timeModified\":\"2021-07-03T04:16:46Z\",\"author\":\"cc\",\"description\":\"nhxk\",\"body\":\"zvytnrzvuljraaer\",\"related\":{\"categories\":[\"qgukkjqnv\"],\"resourceTypes\":[\"ylaxxulcdi\",\"dosfjbjsvgjrw\"],\"solutions\":[\"vyc\",\"t\",\"c\",\"xgccknfnw\"]},\"tags\":{\"z\":[\"vpdvjdhttzae\",\"edxihchrphkmcrj\",\"qnsdfzpbgtgky\",\"kdghrjeuutlwx\"],\"oajvgcxtxjcs\":[\"hokvbwnh\",\"tqlgehgppi\",\"ifhpf\"],\"q\":[\"afidltugsres\",\"kssjhoiftxfk\",\"wegprh\",\"tillucbiqtg\"]},\"properties\":\"datamcwsldrizetpwb\"},\"id\":\"lllibph\",\"name\":\"zmizakakan\",\"type\":\"p\"}]}"; + = "{\"value\":[{\"properties\":{\"id\":\"hpdulon\",\"displayName\":\"acn\",\"timeCreated\":\"2021-04-12T19:25:08Z\",\"timeModified\":\"2020-12-27T20:17:23Z\",\"author\":\"tuevrh\",\"description\":\"jyoogwxh\",\"body\":\"sd\",\"related\":{\"categories\":[\"bsre\",\"rfqkfuar\"],\"resourceTypes\":[\"vhhtklnvnaf\",\"vkyfedevjbosl\",\"qxypokkhminq\"],\"solutions\":[\"czngnbdxxe\",\"unin\"]},\"tags\":{\"xxdtddmflh\":[\"chaqdtvqec\",\"qct\"]},\"properties\":\"datatx\"},\"id\":\"tznapxbannovv\",\"name\":\"xc\",\"type\":\"ytprwnwvroev\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.queries() - .list("vodhtn", "irudh", 522814180418790552L, false, "sckdlp", com.azure.core.util.Context.NONE); + .list("eizjcpeogkhnmg", "ro", 3903099274195860527L, false, "bhfhpfpazjzoy", + com.azure.core.util.Context.NONE); - Assertions.assertEquals("xdfgsftufqobr", response.iterator().next().displayName()); - Assertions.assertEquals("nhxk", response.iterator().next().description()); - Assertions.assertEquals("zvytnrzvuljraaer", response.iterator().next().body()); - Assertions.assertEquals("qgukkjqnv", response.iterator().next().related().categories().get(0)); - Assertions.assertEquals("ylaxxulcdi", response.iterator().next().related().resourceTypes().get(0)); - Assertions.assertEquals("vyc", response.iterator().next().related().solutions().get(0)); - Assertions.assertEquals("vpdvjdhttzae", response.iterator().next().tags().get("z").get(0)); + Assertions.assertEquals("acn", response.iterator().next().displayName()); + Assertions.assertEquals("jyoogwxh", response.iterator().next().description()); + Assertions.assertEquals("sd", response.iterator().next().body()); + Assertions.assertEquals("bsre", response.iterator().next().related().categories().get(0)); + Assertions.assertEquals("vhhtklnvnaf", response.iterator().next().related().resourceTypes().get(0)); + Assertions.assertEquals("czngnbdxxe", response.iterator().next().related().solutions().get(0)); + Assertions.assertEquals("chaqdtvqec", response.iterator().next().tags().get("xxdtddmflh").get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java index a5166c94e183..14b3befb2419 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -25,35 +25,36 @@ public final class QueriesPutWithResponseMockTests { @Test public void testPutWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"id\":\"gcmjkavl\",\"displayName\":\"or\",\"timeCreated\":\"2021-09-10T10:34:34Z\",\"timeModified\":\"2021-06-02T13:00:05Z\",\"author\":\"dtzfjltfvnzcy\",\"description\":\"otp\",\"body\":\"opv\",\"related\":{\"categories\":[\"zq\",\"qqihedsvqwthmk\"],\"resourceTypes\":[\"cysihs\",\"qcwdhoh\"],\"solutions\":[\"mcdzsufcohdxbz\",\"mcmuapc\",\"hdbevwqqxeyskon\"]},\"tags\":{\"ezrxcczurtleipqx\":[\"kfkbgbzbowxeqocl\",\"mygvkzqkj\",\"eokbze\"],\"nzvdfbzdixzmq\":[\"wvz\"],\"bostzel\":[\"odawopqhewjptmcg\"]},\"properties\":\"datala\"},\"id\":\"tmzlbiojlv\",\"name\":\"rbbpneqvcwwyy\",\"type\":\"mochpprprsnmok\"}"; + = "{\"properties\":{\"id\":\"itdigsxcdgljp\",\"displayName\":\"keuachtomf\",\"timeCreated\":\"2021-03-19T13:19:35Z\",\"timeModified\":\"2021-09-29T06:45:15Z\",\"author\":\"fpfmdgycxnmskwh\",\"description\":\"jyslurl\",\"body\":\"shhkvpedw\",\"related\":{\"categories\":[\"rhmpqvwwsk\",\"ndcbrwi\",\"uvqejosovyrrle\"],\"resourceTypes\":[\"inuqtljq\",\"bbpihehcecy\",\"mrqbrjbbmpxdlv\",\"kfrexcrseqwjks\"],\"solutions\":[\"dgzhxogj\",\"gsv\",\"u\"]},\"tags\":{\"o\":[\"bdafhrkm\",\"yomkxfbvfbhdy\",\"rhpw\",\"gddeimaw\"],\"comlikytwvczc\":[\"kkum\",\"ikjcjcazt\",\"wsnsqowx\"],\"cvejyfdvlvhbwrn\":[\"k\"],\"nkcoeqswankltyt\":[\"tgddpqthehnmnaoy\"]},\"properties\":\"datadroznn\"},\"id\":\"rlktgjcsggu\",\"name\":\"hemlwywaee\",\"type\":\"zgfbukklelssx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPackQuery response = manager.queries() - .define("absnmfpp") - .withExistingQueryPack("tngfdgugeyzihgr", "yui") - .withTags(mapOf("asiibmiybnnust", Arrays.asList("gh", "iypoqeyhlqhykprl", "yznuciqd", "mexiitdfuxt"))) - .withDisplayName("yhsgz") - .withDescription("glqgleoh") - .withBody("betnluankrrfxee") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("j")) - .withResourceTypes(Arrays.asList("vbmqzbqq", "lajrnwxacevehj")) - .withSolutions(Arrays.asList("xoafgaoqltfae", "linmfgv"))) - .withProperties("dataljhnmgixhcmav") + .define("rrkolawjmjs") + .withExistingQueryPack("zolxrzvhqjwtr", "tgvgzp") + .withTags(mapOf("gjekglklby", Arrays.asList("hzdtxetlgydlh", "vlnnpx", "b", "fiqgeaar"))) + .withDisplayName("tlhguynuchl") + .withDescription("pafolp") + .withBody("mwamxqzragpgdph") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("lajv", "ejchcsrlz", "nmzlanru")) + .withResourceTypes(Arrays.asList("vnphc", "zqtpjhmq")) + .withSolutions(Arrays.asList("thlaiwdcxs"))) + .withProperties("dataidwcwvmzegjon") .create(); - Assertions.assertEquals("or", response.displayName()); - Assertions.assertEquals("otp", response.description()); - Assertions.assertEquals("opv", response.body()); - Assertions.assertEquals("zq", response.related().categories().get(0)); - Assertions.assertEquals("cysihs", response.related().resourceTypes().get(0)); - Assertions.assertEquals("mcdzsufcohdxbz", response.related().solutions().get(0)); - Assertions.assertEquals("kfkbgbzbowxeqocl", response.tags().get("ezrxcczurtleipqx").get(0)); + Assertions.assertEquals("keuachtomf", response.displayName()); + Assertions.assertEquals("jyslurl", response.description()); + Assertions.assertEquals("shhkvpedw", response.body()); + Assertions.assertEquals("rhmpqvwwsk", response.related().categories().get(0)); + Assertions.assertEquals("inuqtljq", response.related().resourceTypes().get(0)); + Assertions.assertEquals("dgzhxogj", response.related().solutions().get(0)); + Assertions.assertEquals("bdafhrkm", response.tags().get("o").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java index 92aa6353046f..a3324dc0be72 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -27,34 +27,33 @@ public final class QueriesSearchMockTests { @Test public void testSearch() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"id\":\"heioqa\",\"displayName\":\"hvseufuqyrx\",\"timeCreated\":\"2021-03-18T00:27:23Z\",\"timeModified\":\"2020-12-31T00:49:04Z\",\"author\":\"lsismjqfrd\",\"description\":\"amqu\",\"body\":\"iosrsjuivfcdis\",\"related\":{\"categories\":[\"xzhczexrxz\",\"ujrtrhqvwr\"],\"resourceTypes\":[\"h\"],\"solutions\":[\"nzonzl\",\"piqywnc\",\"jtszcof\",\"zehtdhgb\"]},\"tags\":{\"bccxjmonfdgn\":[\"eljeamurvzmlovua\",\"ashcxlpmjerbdk\",\"lvidizozs\"],\"uqj\":[\"cypuuwwlt\"]},\"properties\":\"datazenkeifzzhmkd\"},\"id\":\"vflyhbxcu\",\"name\":\"hxgsrboldfor\",\"type\":\"wjlvizbfhfov\"}]}"; + = "{\"value\":[{\"properties\":{\"id\":\"caac\",\"displayName\":\"dmmcpugmehqep\",\"timeCreated\":\"2021-03-30T21:15:26Z\",\"timeModified\":\"2021-08-04T03:32:09Z\",\"author\":\"ehewhoqh\",\"description\":\"bqnbl\",\"body\":\"xeaclgsc\",\"related\":{\"categories\":[\"mkrsrrmoucsofl\",\"puviyfcaabe\",\"lhbhl\"],\"resourceTypes\":[\"xuqibsxtkcudf\"],\"solutions\":[\"arfsi\",\"wlkjxn\"]},\"tags\":{\"ycjimryvwgcwwpbm\":[\"gf\",\"tmhqykiz\",\"d\",\"saoafcluqvox\"]},\"properties\":\"dataw\"},\"id\":\"ydsx\",\"name\":\"efoh\",\"type\":\"cbvopwndyqleallk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.queries() - .search("jzhajoy", "hjlmu", - new LogAnalyticsQueryPackQuerySearchProperties() - .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() - .withCategories(Arrays.asList("rimrs", "pteecjme")) - .withResourceTypes(Arrays.asList("stvasylwxdzaumw")) - .withSolutions(Arrays.asList("hguuf", "zboyjathwt"))) - .withTags(mapOf("mwmdxmebwjscjpa", Arrays.asList("a"), "ekpndzaapmudq", - Arrays.asList("xveabf", "xnmwmqtibxyijddt", "qcttadijaeukmrsi"), "e", - Arrays.asList("qwigpibudqwyxe"))), - 5927921282145979607L, true, "zznrtffyaqi", com.azure.core.util.Context.NONE); + .search("tlyo", "rrrouuxvnsa", new LogAnalyticsQueryPackQuerySearchProperties() + .withRelated( + new LogAnalyticsQueryPackQuerySearchPropertiesRelated().withCategories(Arrays.asList("ymodizrxk")) + .withResourceTypes(Arrays.asList("d", "nazpmk")) + .withSolutions(Arrays.asList("vevfxz"))) + .withTags(mapOf("p", Arrays.asList("bzxliohrdddtfgxq", "awpcbbnzqcykn"), "bwwg", + Arrays.asList("fyuicdh", "bd"), "muvapc", Arrays.asList("vibidmhmwffpl"), "mfsvbpav", + Arrays.asList("crrvweyo", "oy", "ukphaimmoiroq", "oshbragapyy"))), + 5906080066098666385L, false, "ppdbwnupgahxkum", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hvseufuqyrx", response.iterator().next().displayName()); - Assertions.assertEquals("amqu", response.iterator().next().description()); - Assertions.assertEquals("iosrsjuivfcdis", response.iterator().next().body()); - Assertions.assertEquals("xzhczexrxz", response.iterator().next().related().categories().get(0)); - Assertions.assertEquals("h", response.iterator().next().related().resourceTypes().get(0)); - Assertions.assertEquals("nzonzl", response.iterator().next().related().solutions().get(0)); - Assertions.assertEquals("eljeamurvzmlovua", response.iterator().next().tags().get("bccxjmonfdgn").get(0)); + Assertions.assertEquals("dmmcpugmehqep", response.iterator().next().displayName()); + Assertions.assertEquals("bqnbl", response.iterator().next().description()); + Assertions.assertEquals("xeaclgsc", response.iterator().next().body()); + Assertions.assertEquals("mkrsrrmoucsofl", response.iterator().next().related().categories().get(0)); + Assertions.assertEquals("xuqibsxtkcudf", response.iterator().next().related().resourceTypes().get(0)); + Assertions.assertEquals("arfsi", response.iterator().next().related().solutions().get(0)); + Assertions.assertEquals("gf", response.iterator().next().tags().get("ycjimryvwgcwwpbm").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java index 5d446e46190b..5c2cada33883 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -23,24 +23,24 @@ public final class QueryPacksCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"queryPackId\":\"nlsvxeiz\",\"timeCreated\":\"2021-09-15T09:10:38Z\",\"timeModified\":\"2021-10-15T15:15:24Z\",\"provisioningState\":\"srmffeycxcktpiym\"},\"location\":\"rteeamm\",\"tags\":{\"rtkgdojbmxvavref\":\"ekkkzd\",\"jpxtxsuwprtuj\":\"eesvecu\",\"itvtzeexavo\":\"sawddjibabxvi\",\"dmdqb\":\"tfgle\"},\"id\":\"pypqtgsfj\",\"name\":\"cbslhhx\",\"type\":\"db\"}"; + = "{\"properties\":{\"queryPackId\":\"emv\",\"timeCreated\":\"2021-10-29T03:31:17Z\",\"timeModified\":\"2020-12-21T13:58:30Z\",\"provisioningState\":\"hmnr\"},\"location\":\"bsojk\",\"tags\":{\"ysprq\":\"hmdp\",\"pli\":\"gnzxojpslsvj\",\"qvapcohhoucq\":\"fiqwoy\"},\"id\":\"q\",\"name\":\"jxcx\",\"type\":\"rzdcgdzbenribcaw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPack response = manager.queryPacks() - .define("vbkbxgomf") - .withRegion("zkgimsid") - .withExistingResourceGroup("nsymoyqhlwigd") - .withTags(mapOf("hpqgatjeaahhvj", "icddyvvjskgfmocw", "jjidjk", "hnakzyb")) + .define("byrrueqth") + .withRegion("yqyybxubmdna") + .withExistingResourceGroup("yueayfbpcmsp") + .withTags(mapOf("qacigeleo", "qwremjel", "vqvwzkjopwbe", "d", "x", "nrlkwzdqy")) .create(); - Assertions.assertEquals("rteeamm", response.location()); - Assertions.assertEquals("ekkkzd", response.tags().get("rtkgdojbmxvavref")); + Assertions.assertEquals("bsojk", response.location()); + Assertions.assertEquals("hmdp", response.tags().get("ysprq")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java index 5805a5f8e9f9..b02f3f534120 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; @@ -24,23 +24,24 @@ public final class QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests { @Test public void testCreateOrUpdateWithoutNameWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"queryPackId\":\"xukuqgsj\",\"timeCreated\":\"2021-08-01T00:57:39Z\",\"timeModified\":\"2021-06-29T21:31:03Z\",\"provisioningState\":\"gketwzhhzjhf\"},\"location\":\"mhv\",\"tags\":{\"qsxvmhf\":\"vgpmun\"},\"id\":\"uzjyihsasbhudypo\",\"name\":\"yue\",\"type\":\"slynsqyrpfoo\"}"; + = "{\"properties\":{\"queryPackId\":\"rgmsplzga\",\"timeCreated\":\"2021-02-13T02:42:05Z\",\"timeModified\":\"2021-02-02T09:58:56Z\",\"provisioningState\":\"vnewgnxkympqanx\"},\"location\":\"kixtwbtaoy\",\"tags\":{\"pxycphdr\":\"ghshxcylhkgmnsg\"},\"id\":\"jjkhvyomaclu\",\"name\":\"vxnqmhrpqpd\",\"type\":\"wmkoisq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPack response = manager.queryPacks() - .createOrUpdateWithoutNameWithResponse("fiwrxgkn", - new LogAnalyticsQueryPackInner().withLocation("gzdjtxvzf").withTags(mapOf("aqvlgafcqusr", "v")), + .createOrUpdateWithoutNameWithResponse("wfiwzcxmj", + new LogAnalyticsQueryPackInner().withLocation("cabvnuil") + .withTags(mapOf("ugmrmf", "aswlp", "oauk", "lrxw", "moaedsxj", "fkvcisi")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mhv", response.location()); - Assertions.assertEquals("vgpmun", response.tags().get("qsxvmhf")); + Assertions.assertEquals("kixtwbtaoy", response.location()); + Assertions.assertEquals("ghshxcylhkgmnsg", response.tags().get("pxycphdr")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java index 5db48519b0d3..ec13a6955468 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,11 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.queryPacks() - .deleteByResourceGroupWithResponse("rlttymsjnygqdnfw", "zdzgtilaxhnfhqly", - com.azure.core.util.Context.NONE); + .deleteByResourceGroupWithResponse("ssffxuifmc", "ypobkdqzr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java index 4635a85ab2c9..2048593384ce 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -21,20 +21,20 @@ public final class QueryPacksGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"queryPackId\":\"pgclrciv\",\"timeCreated\":\"2021-01-12T06:52:04Z\",\"timeModified\":\"2020-12-22T20:01:29Z\",\"provisioningState\":\"kenx\"},\"location\":\"m\",\"tags\":{\"oqvm\":\"frpmpdnqqskaw\"},\"id\":\"bnpqfrtqlkzme\",\"name\":\"nitgvkxlz\",\"type\":\"qdrfegcealzxwhc\"}"; + = "{\"properties\":{\"queryPackId\":\"uaurkihcir\",\"timeCreated\":\"2021-04-17T15:27:55Z\",\"timeModified\":\"2021-09-20T22:33:09Z\",\"provisioningState\":\"dcoxnbk\"},\"location\":\"anurnnqb\",\"tags\":{\"rxvbfihwuh\":\"pizxqltgrdogyp\",\"iowxi\":\"ctafsrbxrblm\",\"klsbsbqqqagw\":\"spnxwqagnepzw\"},\"id\":\"rxaomzisglrrcze\",\"name\":\"k\",\"type\":\"hltnjadhqoawjq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPack response = manager.queryPacks() - .getByResourceGroupWithResponse("ijouwivkxoyzunb", "xxrtikvc", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("zsylollgt", "czzydmxzjij", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("m", response.location()); - Assertions.assertEquals("frpmpdnqqskaw", response.tags().get("oqvm")); + Assertions.assertEquals("anurnnqb", response.location()); + Assertions.assertEquals("pizxqltgrdogyp", response.tags().get("rxvbfihwuh")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java index 0e8fd6299f34..402d3c1d2c70 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -22,19 +22,19 @@ public final class QueryPacksListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"queryPackId\":\"aomylwea\",\"timeCreated\":\"2021-12-02T19:30Z\",\"timeModified\":\"2021-02-22T04:35:52Z\",\"provisioningState\":\"thwwn\"},\"location\":\"jhlfzswpchwahf\",\"tags\":{\"ncxykxhdjhlimm\":\"snfepgfewetwlyx\",\"cjzhqi\":\"cxfhbcporxv\",\"ftjuh\":\"xfpxtgqscja\"},\"id\":\"qaz\",\"name\":\"mtggu\",\"type\":\"pijrajcivmmghf\"}]}"; + = "{\"value\":[{\"properties\":{\"queryPackId\":\"wslmiiiovgqcg\",\"timeCreated\":\"2021-03-09T10:20:04Z\",\"timeModified\":\"2021-07-06T10:58:26Z\",\"provisioningState\":\"ctotiowlx\"},\"location\":\"qd\",\"tags\":{\"lwphqlkccuzgyg\":\"gwdtgukran\",\"gniiprglvaw\":\"wahoiul\",\"pmcubkmifoxxkub\":\"wzdufypivlsbb\",\"gvgovpbbttefjo\":\"phavpmhbrb\"},\"id\":\"nssqyzqed\",\"name\":\"kdfrdbiqmrjgeihf\",\"type\":\"lg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.queryPacks().listByResourceGroup("oaimlnw", com.azure.core.util.Context.NONE); + = manager.queryPacks().listByResourceGroup("kkflrmymyincqlhr", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jhlfzswpchwahf", response.iterator().next().location()); - Assertions.assertEquals("snfepgfewetwlyx", response.iterator().next().tags().get("ncxykxhdjhlimm")); + Assertions.assertEquals("qd", response.iterator().next().location()); + Assertions.assertEquals("gwdtgukran", response.iterator().next().tags().get("lwphqlkccuzgyg")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java index e80c92f3388b..5fb621aeec76 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -22,18 +22,18 @@ public final class QueryPacksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"queryPackId\":\"pkxztmoobkl\",\"timeCreated\":\"2021-05-25T12:15:23Z\",\"timeModified\":\"2021-09-03T03:39:31Z\",\"provisioningState\":\"cwq\"},\"location\":\"pimaqxzhemjyh\",\"tags\":{\"lkb\":\"jswtwkozzwc\"},\"id\":\"wpfaj\",\"name\":\"jwltlwtjjgu\",\"type\":\"talhsnvkcdmxzr\"}]}"; + = "{\"value\":[{\"properties\":{\"queryPackId\":\"ycsxzu\",\"timeCreated\":\"2021-06-18T01:50:48Z\",\"timeModified\":\"2021-11-03T00:52:43Z\",\"provisioningState\":\"mdesqp\"},\"location\":\"vmjcdoewb\",\"tags\":{\"xvgpiude\":\"vteo\",\"axwk\":\"gfsxzec\",\"znabaobns\":\"fykhvuhxepmru\",\"ihywartspph\":\"ujdjltymkmvg\"},\"id\":\"ixkykxd\",\"name\":\"sj\",\"type\":\"emmucfxh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.queryPacks().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("pimaqxzhemjyh", response.iterator().next().location()); - Assertions.assertEquals("jswtwkozzwc", response.iterator().next().tags().get("lkb")); + Assertions.assertEquals("vmjcdoewb", response.iterator().next().location()); + Assertions.assertEquals("vteo", response.iterator().next().tags().get("xvgpiude")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java deleted file mode 100644 index 7bb9c15f45e0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.QueryPacksResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class QueryPacksResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueryPacksResource model = BinaryData.fromString( - "{\"location\":\"lokjyemkk\",\"tags\":{\"ejspodmail\":\"pjoxzjnch\",\"yahux\":\"ydehoj\",\"vcputegj\":\"npmqnjaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"id\":\"odjpslwejd\",\"name\":\"vwryoqpso\",\"type\":\"cctazakljlahbc\"}") - .toObject(QueryPacksResource.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryPacksResource model = new QueryPacksResource().withLocation("lokjyemkk") - .withTags(mapOf("ejspodmail", "pjoxzjnch", "yahux", "ydehoj", "vcputegj", "npmqnjaqwixjspro", - "uuvmkjozkrwfnd", "wmfdatscmdvpjhul")); - model = BinaryData.fromObject(model).toObject(QueryPacksResource.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResourceAssociationTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResourceAssociationTests.java new file mode 100644 index 000000000000..4cf7556677b5 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResourceAssociationTests.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 com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import org.junit.jupiter.api.Assertions; + +public final class ResourceAssociationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceAssociation model = BinaryData.fromString("{\"name\":\"fnmdxotn\",\"accessMode\":\"Learning\"}") + .toObject(ResourceAssociation.class); + Assertions.assertEquals("fnmdxotn", model.name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, model.accessMode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceAssociation model + = new ResourceAssociation().withName("fnmdxotn").withAccessMode(ResourceAssociationAccessMode.LEARNING); + model = BinaryData.fromObject(model).toObject(ResourceAssociation.class); + Assertions.assertEquals("fnmdxotn", model.name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, model.accessMode()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java index b37076c3ed16..27622c44b1bb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java @@ -13,21 +13,21 @@ public final class RestoredLogsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestoredLogs model = BinaryData.fromString( - "{\"startRestoreTime\":\"2021-08-18T12:02:08Z\",\"endRestoreTime\":\"2021-10-23T03:32:09Z\",\"sourceTable\":\"zydvfvf\",\"azureAsyncOperationId\":\"naeo\"}") + "{\"startRestoreTime\":\"2021-10-09T17:15:47Z\",\"endRestoreTime\":\"2021-11-26T04:46:53Z\",\"sourceTable\":\"cedcpnmdy\",\"azureAsyncOperationId\":\"nwzxltjcv\"}") .toObject(RestoredLogs.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T12:02:08Z"), model.startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T03:32:09Z"), model.endRestoreTime()); - Assertions.assertEquals("zydvfvf", model.sourceTable()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T17:15:47Z"), model.startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T04:46:53Z"), model.endRestoreTime()); + Assertions.assertEquals("cedcpnmdy", model.sourceTable()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RestoredLogs model = new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-08-18T12:02:08Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-10-23T03:32:09Z")) - .withSourceTable("zydvfvf"); + RestoredLogs model = new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-10-09T17:15:47Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-11-26T04:46:53Z")) + .withSourceTable("cedcpnmdy"); model = BinaryData.fromObject(model).toObject(RestoredLogs.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T12:02:08Z"), model.startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T03:32:09Z"), model.endRestoreTime()); - Assertions.assertEquals("zydvfvf", model.sourceTable()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T17:15:47Z"), model.startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T04:46:53Z"), model.endRestoreTime()); + Assertions.assertEquals("cedcpnmdy", model.sourceTable()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java index e9b3a05e3a98..b72f364ca3ad 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java @@ -11,7 +11,7 @@ public final class ResultStatisticsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResultStatistics model - = BinaryData.fromString("{\"progress\":40.47698,\"ingestedRecords\":1226403170,\"scannedGb\":23.974842}") + = BinaryData.fromString("{\"progress\":68.59587,\"ingestedRecords\":823307226,\"scannedGb\":19.583012}") .toObject(ResultStatistics.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RuleDefinitionTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RuleDefinitionTests.java new file mode 100644 index 000000000000..c54c051e2f1d --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RuleDefinitionTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.TimeSelectorEnum; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RuleDefinitionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RuleDefinition model = BinaryData.fromString( + "{\"query\":\"hahzvechndbnwi\",\"binSize\":1717475306,\"binDelay\":36238226,\"binStartTime\":\"2021-06-22T19:10:38Z\",\"timeSelector\":\"TimeGenerated\",\"destinationTable\":\"ubwefqs\"}") + .toObject(RuleDefinition.class); + Assertions.assertEquals("hahzvechndbnwi", model.query()); + Assertions.assertEquals(1717475306, model.binSize()); + Assertions.assertEquals(36238226, model.binDelay()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T19:10:38Z"), model.binStartTime()); + Assertions.assertEquals(TimeSelectorEnum.TIME_GENERATED, model.timeSelector()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RuleDefinition model = new RuleDefinition().withQuery("hahzvechndbnwi") + .withBinSize(1717475306) + .withBinDelay(36238226) + .withBinStartTime(OffsetDateTime.parse("2021-06-22T19:10:38Z")) + .withTimeSelector(TimeSelectorEnum.TIME_GENERATED); + model = BinaryData.fromObject(model).toObject(RuleDefinition.class); + Assertions.assertEquals("hahzvechndbnwi", model.query()); + Assertions.assertEquals(1717475306, model.binSize()); + Assertions.assertEquals(36238226, model.binDelay()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T19:10:38Z"), model.binStartTime()); + Assertions.assertEquals(TimeSelectorEnum.TIME_GENERATED, model.timeSelector()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java index f3d67547b9b4..5712414c503d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java @@ -14,38 +14,38 @@ public final class SavedSearchInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavedSearchInner model = BinaryData.fromString( - "{\"etag\":\"xc\",\"properties\":{\"category\":\"sbfov\",\"displayName\":\"srruvwbhsqfsubcg\",\"query\":\"birx\",\"functionAlias\":\"ybsrfbjfdtwss\",\"functionParameters\":\"ftpvjzbexil\",\"version\":8368126717708512338,\"tags\":[{\"name\":\"nvwpmqtaruouj\",\"value\":\"kcjhwqytjrybnwj\"}]},\"id\":\"wgdrjervnaenqp\",\"name\":\"hin\",\"type\":\"oygmift\"}") + "{\"etag\":\"mv\",\"properties\":{\"category\":\"ekg\",\"displayName\":\"wozuhkf\",\"query\":\"bsjyofdx\",\"functionAlias\":\"us\",\"functionParameters\":\"touwaboekqv\",\"version\":2699583635820054770,\"tags\":[{\"name\":\"vbxwyjsflhh\",\"value\":\"aalnjixi\"}]},\"id\":\"xyawj\",\"name\":\"yaqcslyjpkiidz\",\"type\":\"exznelixhnr\"}") .toObject(SavedSearchInner.class); - Assertions.assertEquals("xc", model.etag()); - Assertions.assertEquals("sbfov", model.category()); - Assertions.assertEquals("srruvwbhsqfsubcg", model.displayName()); - Assertions.assertEquals("birx", model.query()); - Assertions.assertEquals("ybsrfbjfdtwss", model.functionAlias()); - Assertions.assertEquals("ftpvjzbexil", model.functionParameters()); - Assertions.assertEquals(8368126717708512338L, model.version()); - Assertions.assertEquals("nvwpmqtaruouj", model.tags().get(0).name()); - Assertions.assertEquals("kcjhwqytjrybnwj", model.tags().get(0).value()); + Assertions.assertEquals("mv", model.etag()); + Assertions.assertEquals("ekg", model.category()); + Assertions.assertEquals("wozuhkf", model.displayName()); + Assertions.assertEquals("bsjyofdx", model.query()); + Assertions.assertEquals("us", model.functionAlias()); + Assertions.assertEquals("touwaboekqv", model.functionParameters()); + Assertions.assertEquals(2699583635820054770L, model.version()); + Assertions.assertEquals("vbxwyjsflhh", model.tags().get(0).name()); + Assertions.assertEquals("aalnjixi", model.tags().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SavedSearchInner model = new SavedSearchInner().withEtag("xc") - .withCategory("sbfov") - .withDisplayName("srruvwbhsqfsubcg") - .withQuery("birx") - .withFunctionAlias("ybsrfbjfdtwss") - .withFunctionParameters("ftpvjzbexil") - .withVersion(8368126717708512338L) - .withTags(Arrays.asList(new Tag().withName("nvwpmqtaruouj").withValue("kcjhwqytjrybnwj"))); + SavedSearchInner model = new SavedSearchInner().withEtag("mv") + .withCategory("ekg") + .withDisplayName("wozuhkf") + .withQuery("bsjyofdx") + .withFunctionAlias("us") + .withFunctionParameters("touwaboekqv") + .withVersion(2699583635820054770L) + .withTags(Arrays.asList(new Tag().withName("vbxwyjsflhh").withValue("aalnjixi"))); model = BinaryData.fromObject(model).toObject(SavedSearchInner.class); - Assertions.assertEquals("xc", model.etag()); - Assertions.assertEquals("sbfov", model.category()); - Assertions.assertEquals("srruvwbhsqfsubcg", model.displayName()); - Assertions.assertEquals("birx", model.query()); - Assertions.assertEquals("ybsrfbjfdtwss", model.functionAlias()); - Assertions.assertEquals("ftpvjzbexil", model.functionParameters()); - Assertions.assertEquals(8368126717708512338L, model.version()); - Assertions.assertEquals("nvwpmqtaruouj", model.tags().get(0).name()); - Assertions.assertEquals("kcjhwqytjrybnwj", model.tags().get(0).value()); + Assertions.assertEquals("mv", model.etag()); + Assertions.assertEquals("ekg", model.category()); + Assertions.assertEquals("wozuhkf", model.displayName()); + Assertions.assertEquals("bsjyofdx", model.query()); + Assertions.assertEquals("us", model.functionAlias()); + Assertions.assertEquals("touwaboekqv", model.functionParameters()); + Assertions.assertEquals(2699583635820054770L, model.version()); + Assertions.assertEquals("vbxwyjsflhh", model.tags().get(0).name()); + Assertions.assertEquals("aalnjixi", model.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java index 48746c228292..133048ecba43 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java @@ -14,37 +14,36 @@ public final class SavedSearchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavedSearchProperties model = BinaryData.fromString( - "{\"category\":\"nzdndslgna\",\"displayName\":\"qig\",\"query\":\"nduhavhqlkthum\",\"functionAlias\":\"olbgycduiertgccy\",\"functionParameters\":\"aolps\",\"version\":1053709421770726696,\"tags\":[{\"name\":\"mdnbbglzpswiy\",\"value\":\"mcwyhzdxssadb\"},{\"name\":\"mnvdfzn\",\"value\":\"daodvxzbncblyl\"},{\"name\":\"stdbhhxsrzdzu\",\"value\":\"erscdntne\"}]}") + "{\"category\":\"tfolhbnx\",\"displayName\":\"nalaulppg\",\"query\":\"dtpnapnyiropuhp\",\"functionAlias\":\"vpgylgqgitxmed\",\"functionParameters\":\"c\",\"version\":6530746203139727560,\"tags\":[{\"name\":\"wncwzzhxgktrmg\",\"value\":\"cnapkteoell\"},{\"name\":\"pt\",\"value\":\"d\"},{\"name\":\"gpfqbuace\",\"value\":\"pzfqrhhuaoppp\"}]}") .toObject(SavedSearchProperties.class); - Assertions.assertEquals("nzdndslgna", model.category()); - Assertions.assertEquals("qig", model.displayName()); - Assertions.assertEquals("nduhavhqlkthum", model.query()); - Assertions.assertEquals("olbgycduiertgccy", model.functionAlias()); - Assertions.assertEquals("aolps", model.functionParameters()); - Assertions.assertEquals(1053709421770726696L, model.version()); - Assertions.assertEquals("mdnbbglzpswiy", model.tags().get(0).name()); - Assertions.assertEquals("mcwyhzdxssadb", model.tags().get(0).value()); + Assertions.assertEquals("tfolhbnx", model.category()); + Assertions.assertEquals("nalaulppg", model.displayName()); + Assertions.assertEquals("dtpnapnyiropuhp", model.query()); + Assertions.assertEquals("vpgylgqgitxmed", model.functionAlias()); + Assertions.assertEquals("c", model.functionParameters()); + Assertions.assertEquals(6530746203139727560L, model.version()); + Assertions.assertEquals("wncwzzhxgktrmg", model.tags().get(0).name()); + Assertions.assertEquals("cnapkteoell", model.tags().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SavedSearchProperties model = new SavedSearchProperties().withCategory("nzdndslgna") - .withDisplayName("qig") - .withQuery("nduhavhqlkthum") - .withFunctionAlias("olbgycduiertgccy") - .withFunctionParameters("aolps") - .withVersion(1053709421770726696L) - .withTags(Arrays.asList(new Tag().withName("mdnbbglzpswiy").withValue("mcwyhzdxssadb"), - new Tag().withName("mnvdfzn").withValue("daodvxzbncblyl"), - new Tag().withName("stdbhhxsrzdzu").withValue("erscdntne"))); + SavedSearchProperties model = new SavedSearchProperties().withCategory("tfolhbnx") + .withDisplayName("nalaulppg") + .withQuery("dtpnapnyiropuhp") + .withFunctionAlias("vpgylgqgitxmed") + .withFunctionParameters("c") + .withVersion(6530746203139727560L) + .withTags(Arrays.asList(new Tag().withName("wncwzzhxgktrmg").withValue("cnapkteoell"), + new Tag().withName("pt").withValue("d"), new Tag().withName("gpfqbuace").withValue("pzfqrhhuaoppp"))); model = BinaryData.fromObject(model).toObject(SavedSearchProperties.class); - Assertions.assertEquals("nzdndslgna", model.category()); - Assertions.assertEquals("qig", model.displayName()); - Assertions.assertEquals("nduhavhqlkthum", model.query()); - Assertions.assertEquals("olbgycduiertgccy", model.functionAlias()); - Assertions.assertEquals("aolps", model.functionParameters()); - Assertions.assertEquals(1053709421770726696L, model.version()); - Assertions.assertEquals("mdnbbglzpswiy", model.tags().get(0).name()); - Assertions.assertEquals("mcwyhzdxssadb", model.tags().get(0).value()); + Assertions.assertEquals("tfolhbnx", model.category()); + Assertions.assertEquals("nalaulppg", model.displayName()); + Assertions.assertEquals("dtpnapnyiropuhp", model.query()); + Assertions.assertEquals("vpgylgqgitxmed", model.functionAlias()); + Assertions.assertEquals("c", model.functionParameters()); + Assertions.assertEquals(6530746203139727560L, model.version()); + Assertions.assertEquals("wncwzzhxgktrmg", model.tags().get(0).name()); + Assertions.assertEquals("cnapkteoell", model.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java index 7cb0ef1ba341..1a82fbfd7007 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SavedSearch; @@ -23,37 +23,39 @@ public final class SavedSearchesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"refqy\",\"properties\":{\"category\":\"qotoihiqakydiwfb\",\"displayName\":\"kwpzdqtvh\",\"query\":\"spodaqax\",\"functionAlias\":\"pie\",\"functionParameters\":\"bebjfu\",\"version\":8153035996823274813,\"tags\":[{\"name\":\"h\",\"value\":\"lpnfpubntnb\"},{\"name\":\"tzviqsowsaaelcat\",\"value\":\"cjuhplrvkm\"},{\"name\":\"cwmjvlg\",\"value\":\"ggcvk\"}]},\"id\":\"y\",\"name\":\"izrzb\",\"type\":\"psfxsf\"}"; + = "{\"etag\":\"nynkbwet\",\"properties\":{\"category\":\"juhpsprkzyau\",\"displayName\":\"ia\",\"query\":\"cxnafbwqrooh\",\"functionAlias\":\"ovmaonurjtum\",\"functionParameters\":\"ihpvecmslclblyj\",\"version\":1273828074911332298,\"tags\":[{\"name\":\"uscv\",\"value\":\"f\"},{\"name\":\"igctmgxuupbezq\",\"value\":\"cydrtceukdqkk\"}]},\"id\":\"ihztgeqmgqzgwldo\",\"name\":\"chillcecf\",\"type\":\"huwaoaguhic\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SavedSearch response = manager.savedSearches() - .define("ikcyyc") - .withExistingWorkspace("khlowkxxpv", "rdfjmzsyzfhotl") - .withCategory("hv") - .withDisplayName("uic") - .withQuery("hvtrrmhwrbfdpyf") - .withTags(Arrays.asList(new Tag().withName("ooclutnp").withValue("memczjkmmyk"), - new Tag().withName("ujxsglhsr").withValue("rye"))) - .withEtag("nsjlpjrtws") - .withFunctionAlias("bhvjglr") - .withFunctionParameters("uyzlw") - .withVersion(5515716031108163936L) + .define("uzivensrpmeyyvp") + .withExistingWorkspace("lpdwwexymzvlazi", "bhpwvqsgnyy") + .withCategory("jp") + .withDisplayName("gsksrfhf") + .withQuery("olmk") + .withTags(Arrays.asList(new Tag().withName("uiaclkiexhajlfn").withValue("hiqfyuttdiy"), + new Tag().withName("b").withValue("vnwsw"), + new Tag().withName("txkyctwwgzwxjlm").withValue("cvogygzyvne"), + new Tag().withName("zaifghtmoqqtlff").withValue("zbkr"))) + .withEtag("atlb") + .withFunctionAlias("nxwcdommpv") + .withFunctionParameters("awz") + .withVersion(371412437274292802L) .create(); - Assertions.assertEquals("refqy", response.etag()); - Assertions.assertEquals("qotoihiqakydiwfb", response.category()); - Assertions.assertEquals("kwpzdqtvh", response.displayName()); - Assertions.assertEquals("spodaqax", response.query()); - Assertions.assertEquals("pie", response.functionAlias()); - Assertions.assertEquals("bebjfu", response.functionParameters()); - Assertions.assertEquals(8153035996823274813L, response.version()); - Assertions.assertEquals("h", response.tags().get(0).name()); - Assertions.assertEquals("lpnfpubntnb", response.tags().get(0).value()); + Assertions.assertEquals("nynkbwet", response.etag()); + Assertions.assertEquals("juhpsprkzyau", response.category()); + Assertions.assertEquals("ia", response.displayName()); + Assertions.assertEquals("cxnafbwqrooh", response.query()); + Assertions.assertEquals("ovmaonurjtum", response.functionAlias()); + Assertions.assertEquals("ihpvecmslclblyj", response.functionParameters()); + Assertions.assertEquals(1273828074911332298L, response.version()); + Assertions.assertEquals("uscv", response.tags().get(0).name()); + Assertions.assertEquals("f", response.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java index 75719dae958f..4f5a5307d24f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.savedSearches() - .deleteWithResponse("fcsserxhtvsox", "lwntsjgqrs", "y", com.azure.core.util.Context.NONE); + .deleteWithResponse("tzqdd", "jwfljhznamtua", "mzwcjjncqt", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java index c8563f46f382..852804f280c1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SavedSearch; @@ -21,27 +21,26 @@ public final class SavedSearchesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"gm\",\"properties\":{\"category\":\"rwahzjmucftbyr\",\"displayName\":\"lrohkpig\",\"query\":\"fusuckzmkwklsno\",\"functionAlias\":\"xmqeqalh\",\"functionParameters\":\"nhg\",\"version\":2571955917130233939,\"tags\":[{\"name\":\"fsvkhgbvqtanarfd\",\"value\":\"pukhpyrne\"},{\"name\":\"zjcpeogk\",\"value\":\"nmg\"}]},\"id\":\"ro\",\"name\":\"xddbhfhpfpaz\",\"type\":\"zoyw\"}"; + = "{\"etag\":\"uvbxngr\",\"properties\":{\"category\":\"bwggahtt\",\"displayName\":\"lswva\",\"query\":\"qfutlxjo\",\"functionAlias\":\"asunwqrjzfrgq\",\"functionParameters\":\"ohcmbu\",\"version\":765942631551785851,\"tags\":[{\"name\":\"hmbpyryxamebly\",\"value\":\"yvk\"},{\"name\":\"kmrocxne\",\"value\":\"v\"}]},\"id\":\"mtodl\",\"name\":\"pyapucygvoav\",\"type\":\"unssxlghieegjl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - SavedSearch response = manager.savedSearches() - .getWithResponse("ruuuybnch", "szizoyuelyetndnb", "qyggagfl", com.azure.core.util.Context.NONE) - .getValue(); + SavedSearch response + = manager.savedSearches().getWithResponse("z", "izvg", "gat", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("gm", response.etag()); - Assertions.assertEquals("rwahzjmucftbyr", response.category()); - Assertions.assertEquals("lrohkpig", response.displayName()); - Assertions.assertEquals("fusuckzmkwklsno", response.query()); - Assertions.assertEquals("xmqeqalh", response.functionAlias()); - Assertions.assertEquals("nhg", response.functionParameters()); - Assertions.assertEquals(2571955917130233939L, response.version()); - Assertions.assertEquals("fsvkhgbvqtanarfd", response.tags().get(0).name()); - Assertions.assertEquals("pukhpyrne", response.tags().get(0).value()); + Assertions.assertEquals("uvbxngr", response.etag()); + Assertions.assertEquals("bwggahtt", response.category()); + Assertions.assertEquals("lswva", response.displayName()); + Assertions.assertEquals("qfutlxjo", response.query()); + Assertions.assertEquals("asunwqrjzfrgq", response.functionAlias()); + Assertions.assertEquals("ohcmbu", response.functionParameters()); + Assertions.assertEquals(765942631551785851L, response.version()); + Assertions.assertEquals("hmbpyryxamebly", response.tags().get(0).name()); + Assertions.assertEquals("yvk", response.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java index 3ab8a59de174..b5d812ed4b24 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SavedSearchesListResult; @@ -21,27 +21,27 @@ public final class SavedSearchesListByWorkspaceWithResponseMockTests { @Test public void testListByWorkspaceWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"xh\",\"properties\":{\"category\":\"sd\",\"displayName\":\"ugwbsreurfqkf\",\"query\":\"arenlvhhtklnvnaf\",\"functionAlias\":\"kyfede\",\"functionParameters\":\"bo\",\"version\":5433915956599731708,\"tags\":[{\"name\":\"p\",\"value\":\"kkhminqcymczngn\"}]},\"id\":\"dxxewuninv\",\"name\":\"db\",\"type\":\"h\"},{\"etag\":\"dtvqe\",\"properties\":{\"category\":\"rqctmxxdtdd\",\"displayName\":\"flhuytxzv\",\"query\":\"zna\",\"functionAlias\":\"bannovvoxczytp\",\"functionParameters\":\"nwvroevytlyokrr\",\"version\":4414369503729973449,\"tags\":[{\"name\":\"nsa\",\"value\":\"bcrymodizrx\"},{\"name\":\"lobdxna\",\"value\":\"pmkmlmvevfx\"},{\"name\":\"op\",\"value\":\"hbzxli\"},{\"name\":\"hrdd\",\"value\":\"tfgxqbawpcb\"}]},\"id\":\"nzqcy\",\"name\":\"napqo\",\"type\":\"yuicdhzbdy\"},{\"etag\":\"wgbdvibidmhmwffp\",\"properties\":{\"category\":\"fmuvapckccr\",\"displayName\":\"vwe\",\"query\":\"oxoyyukp\",\"functionAlias\":\"immoiroqboshbrag\",\"functionParameters\":\"yyrmfsvbp\",\"version\":3531624930963004551,\"tags\":[{\"name\":\"ppdbwnupgahxkum\",\"value\":\"sjcaacfdmmcpugm\"},{\"name\":\"hqepvufhbzehewh\",\"value\":\"qhnlbqnbld\"}]},\"id\":\"eaclgschorimk\",\"name\":\"srrm\",\"type\":\"ucsofldpuviyf\"},{\"etag\":\"abeolhbhlvbm\",\"properties\":{\"category\":\"uqibsxtkcu\",\"displayName\":\"fbsfarfsiow\",\"query\":\"kjxnqpvwgfstmhq\",\"functionAlias\":\"izmdksa\",\"functionParameters\":\"fcluqvo\",\"version\":8904305259908062937,\"tags\":[{\"name\":\"mr\",\"value\":\"vwg\"}]},\"id\":\"wwpbmzgwesyd\",\"name\":\"xwefohecbvopwndy\",\"type\":\"leallklm\"}]}"; + = "{\"value\":[{\"etag\":\"i\",\"properties\":{\"category\":\"irpiwrqofulopmj\",\"displayName\":\"lexwhcbjp\",\"query\":\"bke\",\"functionAlias\":\"uuuercta\",\"functionParameters\":\"yintqpbrlcy\",\"version\":5915975308764094349,\"tags\":[{\"name\":\"go\",\"value\":\"xyf\"}]},\"id\":\"rucvcrrpcjttbs\",\"name\":\"vjeaqnrmvvfkoxml\",\"type\":\"hktuidvrma\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SavedSearchesListResult response = manager.savedSearches() - .listByWorkspaceWithResponse("xhpdulontacnpqwt", "htuevrhrljy", com.azure.core.util.Context.NONE) + .listByWorkspaceWithResponse("vvpa", "eksgbuxantuygd", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("xh", response.value().get(0).etag()); - Assertions.assertEquals("sd", response.value().get(0).category()); - Assertions.assertEquals("ugwbsreurfqkf", response.value().get(0).displayName()); - Assertions.assertEquals("arenlvhhtklnvnaf", response.value().get(0).query()); - Assertions.assertEquals("kyfede", response.value().get(0).functionAlias()); - Assertions.assertEquals("bo", response.value().get(0).functionParameters()); - Assertions.assertEquals(5433915956599731708L, response.value().get(0).version()); - Assertions.assertEquals("p", response.value().get(0).tags().get(0).name()); - Assertions.assertEquals("kkhminqcymczngn", response.value().get(0).tags().get(0).value()); + Assertions.assertEquals("i", response.value().get(0).etag()); + Assertions.assertEquals("irpiwrqofulopmj", response.value().get(0).category()); + Assertions.assertEquals("lexwhcbjp", response.value().get(0).displayName()); + Assertions.assertEquals("bke", response.value().get(0).query()); + Assertions.assertEquals("uuuercta", response.value().get(0).functionAlias()); + Assertions.assertEquals("yintqpbrlcy", response.value().get(0).functionParameters()); + Assertions.assertEquals(5915975308764094349L, response.value().get(0).version()); + Assertions.assertEquals("go", response.value().get(0).tags().get(0).name()); + Assertions.assertEquals("xyf", response.value().get(0).tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java index ba62da5bddc0..c21dae16b4ed 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java @@ -15,69 +15,49 @@ public final class SavedSearchesListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavedSearchesListResultInner model = BinaryData.fromString( - "{\"value\":[{\"etag\":\"abnetshh\",\"properties\":{\"category\":\"zhedplvwiw\",\"displayName\":\"bmwmbesldnkw\",\"query\":\"tppjflcx\",\"functionAlias\":\"aokonzmnsik\",\"functionParameters\":\"kqze\",\"version\":4891735483783264620,\"tags\":[{\"name\":\"fzxmhhvhgureodkw\",\"value\":\"bdagxt\"}]},\"id\":\"bqdxbx\",\"name\":\"akbogqxndlkzgxh\",\"type\":\"ripl\"},{\"etag\":\"odxun\",\"properties\":{\"category\":\"bebxmubyyntwl\",\"displayName\":\"bqtkoievseotgqr\",\"query\":\"ltmuwlauwzizx\",\"functionAlias\":\"pgcjefuzmuvp\",\"functionParameters\":\"tdum\",\"version\":411911013999749991,\"tags\":[{\"name\":\"bmnzbtbhjpgl\",\"value\":\"fgohdneuelfphs\"},{\"name\":\"yhtozfikdowwqu\",\"value\":\"v\"},{\"name\":\"zx\",\"value\":\"lvithhqzonosgg\"},{\"name\":\"hcohfwdsjnk\",\"value\":\"ljuti\"}]},\"id\":\"swacffgdkzz\",\"name\":\"wkfvhqcrailvp\",\"type\":\"ppfufl\"},{\"etag\":\"dmhdlxyjr\",\"properties\":{\"category\":\"sag\",\"displayName\":\"fcnihgwq\",\"query\":\"pnedgf\",\"functionAlias\":\"vkcvqvpkeqd\",\"functionParameters\":\"drhvoodsotbo\",\"version\":596884672630210595,\"tags\":[{\"name\":\"j\",\"value\":\"vnhdldwmgxcxr\"},{\"name\":\"lpmutwuoegrpkhj\",\"value\":\"niyqslui\"}]},\"id\":\"pdggkzzlvm\",\"name\":\"mpaxmodfvuefywsb\",\"type\":\"fvmwy\"},{\"etag\":\"fouyf\",\"properties\":{\"category\":\"aakc\",\"displayName\":\"wiyzvqtmnubexkp\",\"query\":\"ksmond\",\"functionAlias\":\"quxvypomgkop\",\"functionParameters\":\"hojvpajqgxysmocm\",\"version\":3563158574762399534,\"tags\":[{\"name\":\"kcxozapvhelx\",\"value\":\"rgly\"},{\"name\":\"tddckcb\",\"value\":\"uejrjxgc\"},{\"name\":\"qibrhosxsdqrhzoy\",\"value\":\"i\"}]},\"id\":\"m\",\"name\":\"qyib\",\"type\":\"hwflu\"}]}") + "{\"value\":[{\"etag\":\"xcto\",\"properties\":{\"category\":\"gbkdmoizpos\",\"displayName\":\"mgrcfbu\",\"query\":\"rmfqjhhkxbpvj\",\"functionAlias\":\"jhxxjyn\",\"functionParameters\":\"divkrt\",\"version\":4478371279557844955,\"tags\":[{\"name\":\"vszjfauvjfdxxi\",\"value\":\"e\"},{\"name\":\"vtcqaqtdo\",\"value\":\"mcbxvwvxysl\"}]},\"id\":\"bhsfxob\",\"name\":\"ytkblmpew\",\"type\":\"wfbkrvrns\"},{\"etag\":\"hqjohxcrsbfova\",\"properties\":{\"category\":\"rruvwbhsq\",\"displayName\":\"sub\",\"query\":\"gjb\",\"functionAlias\":\"xb\",\"functionParameters\":\"bsrfbj\",\"version\":3597217556472938019,\"tags\":[{\"name\":\"otftpvjzbexilz\",\"value\":\"nfqqnvwp\"},{\"name\":\"qtaruoujmkcjhwq\",\"value\":\"tjrybnwjewgdr\"}]},\"id\":\"ervnaenqpehi\",\"name\":\"doy\",\"type\":\"mifthnzdnd\"}]}") .toObject(SavedSearchesListResultInner.class); - Assertions.assertEquals("abnetshh", model.value().get(0).etag()); - Assertions.assertEquals("zhedplvwiw", model.value().get(0).category()); - Assertions.assertEquals("bmwmbesldnkw", model.value().get(0).displayName()); - Assertions.assertEquals("tppjflcx", model.value().get(0).query()); - Assertions.assertEquals("aokonzmnsik", model.value().get(0).functionAlias()); - Assertions.assertEquals("kqze", model.value().get(0).functionParameters()); - Assertions.assertEquals(4891735483783264620L, model.value().get(0).version()); - Assertions.assertEquals("fzxmhhvhgureodkw", model.value().get(0).tags().get(0).name()); - Assertions.assertEquals("bdagxt", model.value().get(0).tags().get(0).value()); + Assertions.assertEquals("xcto", model.value().get(0).etag()); + Assertions.assertEquals("gbkdmoizpos", model.value().get(0).category()); + Assertions.assertEquals("mgrcfbu", model.value().get(0).displayName()); + Assertions.assertEquals("rmfqjhhkxbpvj", model.value().get(0).query()); + Assertions.assertEquals("jhxxjyn", model.value().get(0).functionAlias()); + Assertions.assertEquals("divkrt", model.value().get(0).functionParameters()); + Assertions.assertEquals(4478371279557844955L, model.value().get(0).version()); + Assertions.assertEquals("vszjfauvjfdxxi", model.value().get(0).tags().get(0).name()); + Assertions.assertEquals("e", model.value().get(0).tags().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SavedSearchesListResultInner model = new SavedSearchesListResultInner().withValue(Arrays.asList( - new SavedSearchInner().withEtag("abnetshh") - .withCategory("zhedplvwiw") - .withDisplayName("bmwmbesldnkw") - .withQuery("tppjflcx") - .withFunctionAlias("aokonzmnsik") - .withFunctionParameters("kqze") - .withVersion(4891735483783264620L) - .withTags(Arrays.asList(new Tag().withName("fzxmhhvhgureodkw").withValue("bdagxt"))), - new SavedSearchInner().withEtag("odxun") - .withCategory("bebxmubyyntwl") - .withDisplayName("bqtkoievseotgqr") - .withQuery("ltmuwlauwzizx") - .withFunctionAlias("pgcjefuzmuvp") - .withFunctionParameters("tdum") - .withVersion(411911013999749991L) - .withTags(Arrays.asList(new Tag().withName("bmnzbtbhjpgl").withValue("fgohdneuelfphs"), - new Tag().withName("yhtozfikdowwqu").withValue("v"), - new Tag().withName("zx").withValue("lvithhqzonosgg"), - new Tag().withName("hcohfwdsjnk").withValue("ljuti"))), - new SavedSearchInner().withEtag("dmhdlxyjr") - .withCategory("sag") - .withDisplayName("fcnihgwq") - .withQuery("pnedgf") - .withFunctionAlias("vkcvqvpkeqd") - .withFunctionParameters("drhvoodsotbo") - .withVersion(596884672630210595L) - .withTags(Arrays.asList(new Tag().withName("j").withValue("vnhdldwmgxcxr"), - new Tag().withName("lpmutwuoegrpkhj").withValue("niyqslui"))), - new SavedSearchInner().withEtag("fouyf") - .withCategory("aakc") - .withDisplayName("wiyzvqtmnubexkp") - .withQuery("ksmond") - .withFunctionAlias("quxvypomgkop") - .withFunctionParameters("hojvpajqgxysmocm") - .withVersion(3563158574762399534L) - .withTags(Arrays.asList(new Tag().withName("kcxozapvhelx").withValue("rgly"), - new Tag().withName("tddckcb").withValue("uejrjxgc"), - new Tag().withName("qibrhosxsdqrhzoy").withValue("i"))))); + new SavedSearchInner().withEtag("xcto") + .withCategory("gbkdmoizpos") + .withDisplayName("mgrcfbu") + .withQuery("rmfqjhhkxbpvj") + .withFunctionAlias("jhxxjyn") + .withFunctionParameters("divkrt") + .withVersion(4478371279557844955L) + .withTags(Arrays.asList(new Tag().withName("vszjfauvjfdxxi").withValue("e"), + new Tag().withName("vtcqaqtdo").withValue("mcbxvwvxysl"))), + new SavedSearchInner().withEtag("hqjohxcrsbfova") + .withCategory("rruvwbhsq") + .withDisplayName("sub") + .withQuery("gjb") + .withFunctionAlias("xb") + .withFunctionParameters("bsrfbj") + .withVersion(3597217556472938019L) + .withTags(Arrays.asList(new Tag().withName("otftpvjzbexilz").withValue("nfqqnvwp"), + new Tag().withName("qtaruoujmkcjhwq").withValue("tjrybnwjewgdr"))))); model = BinaryData.fromObject(model).toObject(SavedSearchesListResultInner.class); - Assertions.assertEquals("abnetshh", model.value().get(0).etag()); - Assertions.assertEquals("zhedplvwiw", model.value().get(0).category()); - Assertions.assertEquals("bmwmbesldnkw", model.value().get(0).displayName()); - Assertions.assertEquals("tppjflcx", model.value().get(0).query()); - Assertions.assertEquals("aokonzmnsik", model.value().get(0).functionAlias()); - Assertions.assertEquals("kqze", model.value().get(0).functionParameters()); - Assertions.assertEquals(4891735483783264620L, model.value().get(0).version()); - Assertions.assertEquals("fzxmhhvhgureodkw", model.value().get(0).tags().get(0).name()); - Assertions.assertEquals("bdagxt", model.value().get(0).tags().get(0).value()); + Assertions.assertEquals("xcto", model.value().get(0).etag()); + Assertions.assertEquals("gbkdmoizpos", model.value().get(0).category()); + Assertions.assertEquals("mgrcfbu", model.value().get(0).displayName()); + Assertions.assertEquals("rmfqjhhkxbpvj", model.value().get(0).query()); + Assertions.assertEquals("jhxxjyn", model.value().get(0).functionAlias()); + Assertions.assertEquals("divkrt", model.value().get(0).functionParameters()); + Assertions.assertEquals(4478371279557844955L, model.value().get(0).version()); + Assertions.assertEquals("vszjfauvjfdxxi", model.value().get(0).tags().get(0).name()); + Assertions.assertEquals("e", model.value().get(0).tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java index 4b0668991e30..f0a4da19d385 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java @@ -16,42 +16,42 @@ public final class SchemaTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Schema model = BinaryData.fromString( - "{\"name\":\"r\",\"displayName\":\"ukiscvwmzhw\",\"description\":\"efaxvxilc\",\"columns\":[{\"name\":\"hnze\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"fzqlqhycavod\",\"description\":\"xdbeesmieknl\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"wiuagydwqf\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"giagtcojo\",\"description\":\"wogfnzjvu\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"uxylfsbtkadpy\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"gkbugrjqct\",\"description\":\"cmisofie\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"yqdhcuplcplcw\",\"type\":\"int\",\"dataTypeHint\":\"armPath\",\"displayName\":\"lhzdsqtzb\",\"description\":\"gnowcjhfgmveca\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"teyowclu\",\"type\":\"real\",\"dataTypeHint\":\"guid\",\"displayName\":\"vgqouwifzmpj\",\"description\":\"ivqikfxcvhr\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"grttikteusqczk\",\"type\":\"real\",\"dataTypeHint\":\"ip\",\"displayName\":\"byjaffmmf\",\"description\":\"cqc\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"categories\":[\"rtalmet\"],\"labels\":[\"gdslqxihhrmoo\",\"z\"],\"source\":\"customer\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"cxa\",\"zhyrpeto\",\"e\",\"joxslhvnhla\"]}") + "{\"name\":\"xnavvwxq\",\"displayName\":\"y\",\"description\":\"nyowxwlmdjrkvfg\",\"columns\":[{\"name\":\"p\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"izsjqlhkrr\",\"description\":\"deibqip\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"ndzwmkrefa\",\"type\":\"guid\",\"dataTypeHint\":\"uri\",\"displayName\":\"kqnyh\",\"description\":\"ij\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"jabibsystawf\",\"type\":\"dynamic\",\"dataTypeHint\":\"uri\",\"displayName\":\"vp\",\"description\":\"xbkzbzkdvncj\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"categories\":[\"kakmokzh\",\"jk\",\"ffhmouwqlgzr\",\"zeeyebi\"],\"labels\":[\"ayuhqlbjbsy\",\"bqwrvtldgm\",\"pgvmpipaslthaqfx\"],\"source\":\"customer\",\"tableType\":\"Microsoft\",\"tableSubType\":\"Classic\",\"solutions\":[\"srezp\",\"rhneuyowq\",\"d\",\"ytisibir\"]}") .toObject(Schema.class); - Assertions.assertEquals("r", model.name()); - Assertions.assertEquals("ukiscvwmzhw", model.displayName()); - Assertions.assertEquals("efaxvxilc", model.description()); - Assertions.assertEquals("hnze", model.columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.GUID, model.columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.IP, model.columns().get(0).dataTypeHint()); - Assertions.assertEquals("fzqlqhycavod", model.columns().get(0).displayName()); - Assertions.assertEquals("xdbeesmieknl", model.columns().get(0).description()); + Assertions.assertEquals("xnavvwxq", model.name()); + Assertions.assertEquals("y", model.displayName()); + Assertions.assertEquals("nyowxwlmdjrkvfg", model.description()); + Assertions.assertEquals("p", model.columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.ARM_PATH, model.columns().get(0).dataTypeHint()); + Assertions.assertEquals("izsjqlhkrr", model.columns().get(0).displayName()); + Assertions.assertEquals("deibqip", model.columns().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Schema model = new Schema().withName("r") - .withDisplayName("ukiscvwmzhw") - .withDescription("efaxvxilc") + Schema model = new Schema().withName("xnavvwxq") + .withDisplayName("y") + .withDescription("nyowxwlmdjrkvfg") .withColumns(Arrays.asList( - new Column().withName("hnze") + new Column().withName("p") + .withType(ColumnTypeEnum.REAL) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("izsjqlhkrr") + .withDescription("deibqip"), + new Column().withName("ndzwmkrefa") .withType(ColumnTypeEnum.GUID) - .withDataTypeHint(ColumnDataTypeHintEnum.IP) - .withDisplayName("fzqlqhycavod") - .withDescription("xdbeesmieknl"), - new Column().withName("wiuagydwqf") - .withType(ColumnTypeEnum.INT) .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("giagtcojo") - .withDescription("wogfnzjvu"))); + .withDisplayName("kqnyh") + .withDescription("ij"))); model = BinaryData.fromObject(model).toObject(Schema.class); - Assertions.assertEquals("r", model.name()); - Assertions.assertEquals("ukiscvwmzhw", model.displayName()); - Assertions.assertEquals("efaxvxilc", model.description()); - Assertions.assertEquals("hnze", model.columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.GUID, model.columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.IP, model.columns().get(0).dataTypeHint()); - Assertions.assertEquals("fzqlqhycavod", model.columns().get(0).displayName()); - Assertions.assertEquals("xdbeesmieknl", model.columns().get(0).description()); + Assertions.assertEquals("xnavvwxq", model.name()); + Assertions.assertEquals("y", model.displayName()); + Assertions.assertEquals("nyowxwlmdjrkvfg", model.description()); + Assertions.assertEquals("p", model.columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.ARM_PATH, model.columns().get(0).dataTypeHint()); + Assertions.assertEquals("izsjqlhkrr", model.columns().get(0).displayName()); + Assertions.assertEquals("deibqip", model.columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java index 8116903943b4..f768497bb26e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SearchGetSchemaResponse; @@ -22,44 +22,44 @@ public final class SchemasGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"metadata\":{\"requestId\":\"lg\",\"resultType\":\"txd\",\"total\":7982443333722102241,\"top\":2221953429879798985,\"id\":\"zvlnsnnjz\",\"coreSummaries\":[{\"status\":\"olpy\",\"numberOfDocuments\":117086894031994632},{\"status\":\"xqzragp\",\"numberOfDocuments\":5124334742263421163},{\"status\":\"t\",\"numberOfDocuments\":5064204054792112038},{\"status\":\"a\",\"numberOfDocuments\":1817616718311848555}],\"status\":\"jchcsrlzknmzla\",\"startTime\":\"2021-01-20T21:47:05Z\",\"lastUpdated\":\"2021-11-08T10:57:25Z\",\"eTag\":\"vnphc\",\"sort\":[{\"name\":\"pjhmqrhvthl\",\"order\":\"desc\"}],\"requestTime\":1106480050332233961,\"aggregatedValueField\":\"mlzzhzdtxetlgyd\",\"aggregatedGroupingFields\":\"qvlnnpxybafiqgea\",\"sum\":3246800772078835427,\"max\":7730272397217059241,\"schema\":{\"name\":\"klbyulidwcw\",\"version\":1795651624}},\"value\":[{\"name\":\"o\",\"displayName\":\"hj\",\"type\":\"wgdnqzbr\",\"indexed\":true,\"stored\":true,\"facet\":false,\"ownerType\":[\"zmtksjci\",\"digsxcdgl\"]}]}"; + = "{\"metadata\":{\"requestId\":\"hrweftkw\",\"resultType\":\"jp\",\"total\":2377130180811265800,\"top\":3632648174501059306,\"id\":\"pwamcxtczhupeuk\",\"coreSummaries\":[{\"status\":\"uyyes\",\"numberOfDocuments\":5177486878531490465},{\"status\":\"fbocyvhh\",\"numberOfDocuments\":7086241339877476619},{\"status\":\"ywikd\",\"numberOfDocuments\":1557781167596850119},{\"status\":\"kuflgbh\",\"numberOfDocuments\":6099044169152299925}],\"status\":\"cdixmx\",\"startTime\":\"2021-07-21T10:11:29Z\",\"lastUpdated\":\"2021-10-28T11:16:26Z\",\"eTag\":\"jqgdkfnozoeo\",\"sort\":[{\"name\":\"h\",\"order\":\"asc\"},{\"name\":\"wbmqjchntas\",\"order\":\"desc\"},{\"name\":\"xbulpzealbmqkyo\",\"order\":\"asc\"}],\"requestTime\":6096246762150938167,\"aggregatedValueField\":\"btsuahxs\",\"aggregatedGroupingFields\":\"jcmmzrrscub\",\"sum\":1482066446768394569,\"max\":9101534338635329443,\"schema\":{\"name\":\"wodiffjxc\",\"version\":1719649030}},\"value\":[{\"name\":\"bwi\",\"displayName\":\"jogjonmc\",\"type\":\"foyzbamwineof\",\"indexed\":false,\"stored\":false,\"facet\":true,\"ownerType\":[\"oldtvevboclzhz\"]},{\"name\":\"n\",\"displayName\":\"xgvttxp\",\"type\":\"upzaamrdixtre\",\"indexed\":false,\"stored\":false,\"facet\":true,\"ownerType\":[\"skbruffgllukkut\",\"lxhrp\"]},{\"name\":\"vmblcouqe\",\"displayName\":\"hbcdsziry\",\"type\":\"ndo\",\"indexed\":true,\"stored\":false,\"facet\":false,\"ownerType\":[\"oormkfqlwxldyka\"]}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SearchGetSchemaResponse response - = manager.schemas().getWithResponse("cdxfzzzwyjafitl", "guyn", com.azure.core.util.Context.NONE).getValue(); + = manager.schemas().getWithResponse("llizs", "ac", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("lg", response.metadata().searchId()); - Assertions.assertEquals("txd", response.metadata().resultType()); - Assertions.assertEquals(7982443333722102241L, response.metadata().total()); - Assertions.assertEquals(2221953429879798985L, response.metadata().top()); - Assertions.assertEquals("zvlnsnnjz", response.metadata().id()); - Assertions.assertEquals("olpy", response.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(117086894031994632L, response.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("jchcsrlzknmzla", response.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T21:47:05Z"), response.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-08T10:57:25Z"), response.metadata().lastUpdated()); - Assertions.assertEquals("vnphc", response.metadata().etag()); - Assertions.assertEquals("pjhmqrhvthl", response.metadata().sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.DESC, response.metadata().sort().get(0).order()); - Assertions.assertEquals(1106480050332233961L, response.metadata().requestTime()); - Assertions.assertEquals("mlzzhzdtxetlgyd", response.metadata().aggregatedValueField()); - Assertions.assertEquals("qvlnnpxybafiqgea", response.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(3246800772078835427L, response.metadata().sum()); - Assertions.assertEquals(7730272397217059241L, response.metadata().max()); - Assertions.assertEquals("klbyulidwcw", response.metadata().schema().name()); - Assertions.assertEquals(1795651624, response.metadata().schema().version()); - Assertions.assertEquals("o", response.value().get(0).name()); - Assertions.assertEquals("hj", response.value().get(0).displayName()); - Assertions.assertEquals("wgdnqzbr", response.value().get(0).type()); - Assertions.assertEquals(true, response.value().get(0).indexed()); - Assertions.assertEquals(true, response.value().get(0).stored()); - Assertions.assertEquals(false, response.value().get(0).facet()); - Assertions.assertEquals("zmtksjci", response.value().get(0).ownerType().get(0)); + Assertions.assertEquals("hrweftkw", response.metadata().searchId()); + Assertions.assertEquals("jp", response.metadata().resultType()); + Assertions.assertEquals(2377130180811265800L, response.metadata().total()); + Assertions.assertEquals(3632648174501059306L, response.metadata().top()); + Assertions.assertEquals("pwamcxtczhupeuk", response.metadata().id()); + Assertions.assertEquals("uyyes", response.metadata().coreSummaries().get(0).status()); + Assertions.assertEquals(5177486878531490465L, response.metadata().coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("cdixmx", response.metadata().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-21T10:11:29Z"), response.metadata().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-28T11:16:26Z"), response.metadata().lastUpdated()); + Assertions.assertEquals("jqgdkfnozoeo", response.metadata().etag()); + Assertions.assertEquals("h", response.metadata().sort().get(0).name()); + Assertions.assertEquals(SearchSortEnum.ASC, response.metadata().sort().get(0).order()); + Assertions.assertEquals(6096246762150938167L, response.metadata().requestTime()); + Assertions.assertEquals("btsuahxs", response.metadata().aggregatedValueField()); + Assertions.assertEquals("jcmmzrrscub", response.metadata().aggregatedGroupingFields()); + Assertions.assertEquals(1482066446768394569L, response.metadata().sum()); + Assertions.assertEquals(9101534338635329443L, response.metadata().max()); + Assertions.assertEquals("wodiffjxc", response.metadata().schema().name()); + Assertions.assertEquals(1719649030, response.metadata().schema().version()); + Assertions.assertEquals("bwi", response.value().get(0).name()); + Assertions.assertEquals("jogjonmc", response.value().get(0).displayName()); + Assertions.assertEquals("foyzbamwineof", response.value().get(0).type()); + Assertions.assertFalse(response.value().get(0).indexed()); + Assertions.assertFalse(response.value().get(0).stored()); + Assertions.assertTrue(response.value().get(0).facet()); + Assertions.assertEquals("oldtvevboclzhz", response.value().get(0).ownerType().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java index 216dfe67397e..6c61eb99fb6b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java @@ -20,119 +20,113 @@ public final class SearchGetSchemaResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchGetSchemaResponseInner model = BinaryData.fromString( - "{\"metadata\":{\"requestId\":\"enwash\",\"resultType\":\"dtkcnqxwbpokulp\",\"total\":4256703090352932350,\"top\":8748295195867506861,\"id\":\"pqiiobyuqe\",\"coreSummaries\":[{\"status\":\"pqwcciuqgbdbutau\",\"numberOfDocuments\":4381546425309848486},{\"status\":\"kuwhh\",\"numberOfDocuments\":8532271889690426142},{\"status\":\"ojoxafnndlp\",\"numberOfDocuments\":3311442512942014453}],\"status\":\"o\",\"startTime\":\"2021-07-02T22:41:48Z\",\"lastUpdated\":\"2021-10-22T11:40:28Z\",\"eTag\":\"h\",\"sort\":[{\"name\":\"pwdreqnovvqf\",\"order\":\"asc\"},{\"name\":\"xywsuws\",\"order\":\"asc\"},{\"name\":\"dsytgadgvr\",\"order\":\"desc\"},{\"name\":\"neqn\",\"order\":\"desc\"}],\"requestTime\":5080605539580294993,\"aggregatedValueField\":\"uu\",\"aggregatedGroupingFields\":\"fqka\",\"sum\":8183486072070109381,\"max\":1237347078053939435,\"schema\":{\"name\":\"bjibwwiftohq\",\"version\":1205462118}},\"value\":[{\"name\":\"sgplsakn\",\"displayName\":\"fsynljphuop\",\"type\":\"dlqiyntorzih\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"w\",\"rmslyzrpzbchckqq\"]},{\"name\":\"ioxiysuiizyn\",\"displayName\":\"dy\",\"type\":\"rwyhqmibzyhwitsm\",\"indexed\":false,\"stored\":true,\"facet\":true,\"ownerType\":[\"cdpu\",\"nzgmwznmabik\"]},{\"name\":\"orgjhxbldt\",\"displayName\":\"wrlkdmtn\",\"type\":\"ok\",\"indexed\":true,\"stored\":false,\"facet\":false,\"ownerType\":[\"yhgsy\"]},{\"name\":\"ogjltdtbnnhad\",\"displayName\":\"crkvcikhnv\",\"type\":\"mqg\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"ik\",\"wggxkallat\"]}]}") + "{\"metadata\":{\"requestId\":\"nayqi\",\"resultType\":\"nduhavhqlkthum\",\"total\":8390013026245928421,\"top\":5649591766559477880,\"id\":\"duiertgcc\",\"coreSummaries\":[{\"status\":\"olpsslqlf\",\"numberOfDocuments\":5488709340385622129},{\"status\":\"bbglzpswiydmc\",\"numberOfDocuments\":2535246333551569384},{\"status\":\"dxssadbzm\",\"numberOfDocuments\":6861155578766594130}],\"status\":\"znud\",\"startTime\":\"2021-05-14T14:21:36Z\",\"lastUpdated\":\"2021-09-27T09:43:19Z\",\"eTag\":\"bncblylpstdbhhx\",\"sort\":[{\"name\":\"zucerscdntnev\",\"order\":\"asc\"},{\"name\":\"mygtdssls\",\"order\":\"desc\"},{\"name\":\"eriofzpyqs\",\"order\":\"asc\"},{\"name\":\"bnetshh\",\"order\":\"asc\"}],\"requestTime\":87133014421625826,\"aggregatedValueField\":\"vwiwubmwmbesld\",\"aggregatedGroupingFields\":\"wwtppj\",\"sum\":3431932886317561144,\"max\":5668149621351966733,\"schema\":{\"name\":\"onz\",\"version\":1813308851}},\"value\":[{\"name\":\"mkqzeqqkdltfzxmh\",\"displayName\":\"hgure\",\"type\":\"kwobdagxtibq\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"kbogqxndlkzgx\",\"uriplbpodxunkb\",\"bxmubyynt\",\"lrb\"]},{\"name\":\"koievseo\",\"displayName\":\"q\",\"type\":\"ltmuwlauwzizx\",\"indexed\":true,\"stored\":true,\"facet\":false,\"ownerType\":[\"efuzmuvpbttd\",\"morppxebmnzbtbh\",\"pglkf\",\"ohdneuel\"]},{\"name\":\"hsd\",\"displayName\":\"t\",\"type\":\"fikdowwqu\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"lvithhqzonosgg\",\"hcohfwdsjnk\"]}]}") .toObject(SearchGetSchemaResponseInner.class); - Assertions.assertEquals("enwash", model.metadata().searchId()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.metadata().resultType()); - Assertions.assertEquals(4256703090352932350L, model.metadata().total()); - Assertions.assertEquals(8748295195867506861L, model.metadata().top()); - Assertions.assertEquals("pqiiobyuqe", model.metadata().id()); - Assertions.assertEquals("pqwcciuqgbdbutau", model.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(4381546425309848486L, model.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("o", model.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T22:41:48Z"), model.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T11:40:28Z"), model.metadata().lastUpdated()); - Assertions.assertEquals("h", model.metadata().etag()); - Assertions.assertEquals("pwdreqnovvqf", model.metadata().sort().get(0).name()); + Assertions.assertEquals("nayqi", model.metadata().searchId()); + Assertions.assertEquals("nduhavhqlkthum", model.metadata().resultType()); + Assertions.assertEquals(8390013026245928421L, model.metadata().total()); + Assertions.assertEquals(5649591766559477880L, model.metadata().top()); + Assertions.assertEquals("duiertgcc", model.metadata().id()); + Assertions.assertEquals("olpsslqlf", model.metadata().coreSummaries().get(0).status()); + Assertions.assertEquals(5488709340385622129L, model.metadata().coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("znud", model.metadata().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T14:21:36Z"), model.metadata().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T09:43:19Z"), model.metadata().lastUpdated()); + Assertions.assertEquals("bncblylpstdbhhx", model.metadata().etag()); + Assertions.assertEquals("zucerscdntnev", model.metadata().sort().get(0).name()); Assertions.assertEquals(SearchSortEnum.ASC, model.metadata().sort().get(0).order()); - Assertions.assertEquals(5080605539580294993L, model.metadata().requestTime()); - Assertions.assertEquals("uu", model.metadata().aggregatedValueField()); - Assertions.assertEquals("fqka", model.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(8183486072070109381L, model.metadata().sum()); - Assertions.assertEquals(1237347078053939435L, model.metadata().max()); - Assertions.assertEquals("bjibwwiftohq", model.metadata().schema().name()); - Assertions.assertEquals(1205462118, model.metadata().schema().version()); - Assertions.assertEquals("sgplsakn", model.value().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.value().get(0).displayName()); - Assertions.assertEquals("dlqiyntorzih", model.value().get(0).type()); - Assertions.assertEquals(false, model.value().get(0).indexed()); - Assertions.assertEquals(false, model.value().get(0).stored()); - Assertions.assertEquals(false, model.value().get(0).facet()); - Assertions.assertEquals("w", model.value().get(0).ownerType().get(0)); + Assertions.assertEquals(87133014421625826L, model.metadata().requestTime()); + Assertions.assertEquals("vwiwubmwmbesld", model.metadata().aggregatedValueField()); + Assertions.assertEquals("wwtppj", model.metadata().aggregatedGroupingFields()); + Assertions.assertEquals(3431932886317561144L, model.metadata().sum()); + Assertions.assertEquals(5668149621351966733L, model.metadata().max()); + Assertions.assertEquals("onz", model.metadata().schema().name()); + Assertions.assertEquals(1813308851, model.metadata().schema().version()); + Assertions.assertEquals("mkqzeqqkdltfzxmh", model.value().get(0).name()); + Assertions.assertEquals("hgure", model.value().get(0).displayName()); + Assertions.assertEquals("kwobdagxtibq", model.value().get(0).type()); + Assertions.assertFalse(model.value().get(0).indexed()); + Assertions.assertFalse(model.value().get(0).stored()); + Assertions.assertFalse(model.value().get(0).facet()); + Assertions.assertEquals("kbogqxndlkzgx", model.value().get(0).ownerType().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchGetSchemaResponseInner model = new SearchGetSchemaResponseInner() - .withMetadata(new SearchMetadata().withSearchId("enwash") - .withResultType("dtkcnqxwbpokulp") - .withTotal(4256703090352932350L) - .withTop(8748295195867506861L) - .withId("pqiiobyuqe") - .withCoreSummaries(Arrays.asList( - new CoreSummary().withStatus("pqwcciuqgbdbutau").withNumberOfDocuments(4381546425309848486L), - new CoreSummary().withStatus("kuwhh").withNumberOfDocuments(8532271889690426142L), - new CoreSummary().withStatus("ojoxafnndlp").withNumberOfDocuments(3311442512942014453L))) - .withStatus("o") - .withStartTime(OffsetDateTime.parse("2021-07-02T22:41:48Z")) - .withLastUpdated(OffsetDateTime.parse("2021-10-22T11:40:28Z")) - .withEtag("h") - .withSort(Arrays.asList(new SearchSort().withName("pwdreqnovvqf").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("xywsuws").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("dsytgadgvr").withOrder(SearchSortEnum.DESC), - new SearchSort().withName("neqn").withOrder(SearchSortEnum.DESC))) - .withRequestTime(5080605539580294993L) - .withAggregatedValueField("uu") - .withAggregatedGroupingFields("fqka") - .withSum(8183486072070109381L) - .withMax(1237347078053939435L) - .withSchema(new SearchMetadataSchema().withName("bjibwwiftohq").withVersion(1205462118))) - .withValue(Arrays.asList( - new SearchSchemaValue().withName("sgplsakn") - .withDisplayName("fsynljphuop") - .withType("dlqiyntorzih") - .withIndexed(false) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("w", "rmslyzrpzbchckqq")), - new SearchSchemaValue().withName("ioxiysuiizyn") - .withDisplayName("dy") - .withType("rwyhqmibzyhwitsm") - .withIndexed(false) - .withStored(true) - .withFacet(true) - .withOwnerType(Arrays.asList("cdpu", "nzgmwznmabik")), - new SearchSchemaValue().withName("orgjhxbldt") - .withDisplayName("wrlkdmtn") - .withType("ok") - .withIndexed(true) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("yhgsy")), - new SearchSchemaValue().withName("ogjltdtbnnhad") - .withDisplayName("crkvcikhnv") - .withType("mqg") - .withIndexed(false) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("ik", "wggxkallat")))); + SearchGetSchemaResponseInner model + = new SearchGetSchemaResponseInner() + .withMetadata(new SearchMetadata().withSearchId("nayqi") + .withResultType("nduhavhqlkthum") + .withTotal(8390013026245928421L) + .withTop(5649591766559477880L) + .withId("duiertgcc") + .withCoreSummaries(Arrays.asList( + new CoreSummary().withStatus("olpsslqlf").withNumberOfDocuments(5488709340385622129L), + new CoreSummary().withStatus("bbglzpswiydmc").withNumberOfDocuments(2535246333551569384L), + new CoreSummary().withStatus("dxssadbzm").withNumberOfDocuments(6861155578766594130L))) + .withStatus("znud") + .withStartTime(OffsetDateTime.parse("2021-05-14T14:21:36Z")) + .withLastUpdated(OffsetDateTime.parse("2021-09-27T09:43:19Z")) + .withEtag("bncblylpstdbhhx") + .withSort(Arrays.asList(new SearchSort().withName("zucerscdntnev").withOrder(SearchSortEnum.ASC), + new SearchSort().withName("mygtdssls").withOrder(SearchSortEnum.DESC), + new SearchSort().withName("eriofzpyqs").withOrder(SearchSortEnum.ASC), + new SearchSort().withName("bnetshh").withOrder(SearchSortEnum.ASC))) + .withRequestTime(87133014421625826L) + .withAggregatedValueField("vwiwubmwmbesld") + .withAggregatedGroupingFields("wwtppj") + .withSum(3431932886317561144L) + .withMax(5668149621351966733L) + .withSchema(new SearchMetadataSchema().withName("onz").withVersion(1813308851))) + .withValue(Arrays.asList( + new SearchSchemaValue().withName("mkqzeqqkdltfzxmh") + .withDisplayName("hgure") + .withType("kwobdagxtibq") + .withIndexed(false) + .withStored(false) + .withFacet(false) + .withOwnerType(Arrays.asList("kbogqxndlkzgx", "uriplbpodxunkb", "bxmubyynt", "lrb")), + new SearchSchemaValue().withName("koievseo") + .withDisplayName("q") + .withType("ltmuwlauwzizx") + .withIndexed(true) + .withStored(true) + .withFacet(false) + .withOwnerType(Arrays.asList("efuzmuvpbttd", "morppxebmnzbtbh", "pglkf", "ohdneuel")), + new SearchSchemaValue().withName("hsd") + .withDisplayName("t") + .withType("fikdowwqu") + .withIndexed(false) + .withStored(false) + .withFacet(false) + .withOwnerType(Arrays.asList("lvithhqzonosgg", "hcohfwdsjnk")))); model = BinaryData.fromObject(model).toObject(SearchGetSchemaResponseInner.class); - Assertions.assertEquals("enwash", model.metadata().searchId()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.metadata().resultType()); - Assertions.assertEquals(4256703090352932350L, model.metadata().total()); - Assertions.assertEquals(8748295195867506861L, model.metadata().top()); - Assertions.assertEquals("pqiiobyuqe", model.metadata().id()); - Assertions.assertEquals("pqwcciuqgbdbutau", model.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(4381546425309848486L, model.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("o", model.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T22:41:48Z"), model.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T11:40:28Z"), model.metadata().lastUpdated()); - Assertions.assertEquals("h", model.metadata().etag()); - Assertions.assertEquals("pwdreqnovvqf", model.metadata().sort().get(0).name()); + Assertions.assertEquals("nayqi", model.metadata().searchId()); + Assertions.assertEquals("nduhavhqlkthum", model.metadata().resultType()); + Assertions.assertEquals(8390013026245928421L, model.metadata().total()); + Assertions.assertEquals(5649591766559477880L, model.metadata().top()); + Assertions.assertEquals("duiertgcc", model.metadata().id()); + Assertions.assertEquals("olpsslqlf", model.metadata().coreSummaries().get(0).status()); + Assertions.assertEquals(5488709340385622129L, model.metadata().coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("znud", model.metadata().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T14:21:36Z"), model.metadata().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T09:43:19Z"), model.metadata().lastUpdated()); + Assertions.assertEquals("bncblylpstdbhhx", model.metadata().etag()); + Assertions.assertEquals("zucerscdntnev", model.metadata().sort().get(0).name()); Assertions.assertEquals(SearchSortEnum.ASC, model.metadata().sort().get(0).order()); - Assertions.assertEquals(5080605539580294993L, model.metadata().requestTime()); - Assertions.assertEquals("uu", model.metadata().aggregatedValueField()); - Assertions.assertEquals("fqka", model.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(8183486072070109381L, model.metadata().sum()); - Assertions.assertEquals(1237347078053939435L, model.metadata().max()); - Assertions.assertEquals("bjibwwiftohq", model.metadata().schema().name()); - Assertions.assertEquals(1205462118, model.metadata().schema().version()); - Assertions.assertEquals("sgplsakn", model.value().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.value().get(0).displayName()); - Assertions.assertEquals("dlqiyntorzih", model.value().get(0).type()); - Assertions.assertEquals(false, model.value().get(0).indexed()); - Assertions.assertEquals(false, model.value().get(0).stored()); - Assertions.assertEquals(false, model.value().get(0).facet()); - Assertions.assertEquals("w", model.value().get(0).ownerType().get(0)); + Assertions.assertEquals(87133014421625826L, model.metadata().requestTime()); + Assertions.assertEquals("vwiwubmwmbesld", model.metadata().aggregatedValueField()); + Assertions.assertEquals("wwtppj", model.metadata().aggregatedGroupingFields()); + Assertions.assertEquals(3431932886317561144L, model.metadata().sum()); + Assertions.assertEquals(5668149621351966733L, model.metadata().max()); + Assertions.assertEquals("onz", model.metadata().schema().name()); + Assertions.assertEquals(1813308851, model.metadata().schema().version()); + Assertions.assertEquals("mkqzeqqkdltfzxmh", model.value().get(0).name()); + Assertions.assertEquals("hgure", model.value().get(0).displayName()); + Assertions.assertEquals("kwobdagxtibq", model.value().get(0).type()); + Assertions.assertFalse(model.value().get(0).indexed()); + Assertions.assertFalse(model.value().get(0).stored()); + Assertions.assertFalse(model.value().get(0).facet()); + Assertions.assertEquals("kbogqxndlkzgx", model.value().get(0).ownerType().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java index eb39d2f3c679..e0ab265f0d2d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java @@ -11,17 +11,17 @@ public final class SearchMetadataSchemaTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SearchMetadataSchema model = BinaryData.fromString("{\"name\":\"jhwuaanozjos\",\"version\":1082355314}") + SearchMetadataSchema model = BinaryData.fromString("{\"name\":\"pomgkopkwhojvp\",\"version\":996289807}") .toObject(SearchMetadataSchema.class); - Assertions.assertEquals("jhwuaanozjos", model.name()); - Assertions.assertEquals(1082355314, model.version()); + Assertions.assertEquals("pomgkopkwhojvp", model.name()); + Assertions.assertEquals(996289807, model.version()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchMetadataSchema model = new SearchMetadataSchema().withName("jhwuaanozjos").withVersion(1082355314); + SearchMetadataSchema model = new SearchMetadataSchema().withName("pomgkopkwhojvp").withVersion(996289807); model = BinaryData.fromObject(model).toObject(SearchMetadataSchema.class); - Assertions.assertEquals("jhwuaanozjos", model.name()); - Assertions.assertEquals(1082355314, model.version()); + Assertions.assertEquals("pomgkopkwhojvp", model.name()); + Assertions.assertEquals(996289807, model.version()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java index d94203f802ab..fa74123b19f0 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java @@ -18,71 +18,74 @@ public final class SearchMetadataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchMetadata model = BinaryData.fromString( - "{\"requestId\":\"lwuip\",\"resultType\":\"cjzkzivgvvcna\",\"total\":8913535749004515550,\"top\":5279516661370439683,\"id\":\"mueedndrdvstk\",\"coreSummaries\":[{\"status\":\"chea\",\"numberOfDocuments\":3646125258806158004}],\"status\":\"tdaaygdvwvg\",\"startTime\":\"2021-06-07T06:53:10Z\",\"lastUpdated\":\"2021-10-23T00:12:41Z\",\"eTag\":\"xrtfudxep\",\"sort\":[{\"name\":\"agvrvmnpkuk\",\"order\":\"asc\"},{\"name\":\"dblx\",\"order\":\"desc\"}],\"requestTime\":7611617377471579634,\"aggregatedValueField\":\"hfjx\",\"aggregatedGroupingFields\":\"szkkfoqre\",\"sum\":8338807266312513089,\"max\":2185206310902116436,\"schema\":{\"name\":\"wneaiv\",\"version\":322973840}}") + "{\"requestId\":\"jutiiswacff\",\"resultType\":\"k\",\"total\":2817316502996814580,\"top\":4896642944442173063,\"id\":\"qcrailvpnppfufl\",\"coreSummaries\":[{\"status\":\"hdlxyjrxsagafcn\",\"numberOfDocuments\":3165727782283367859},{\"status\":\"qapnedgfbcv\",\"numberOfDocuments\":3094759713825353725},{\"status\":\"vpk\",\"numberOfDocuments\":1489368232618160329}],\"status\":\"vdrhvoo\",\"startTime\":\"2021-11-10T16:13:32Z\",\"lastUpdated\":\"2021-11-02T01:53:07Z\",\"eTag\":\"bzdopcj\",\"sort\":[{\"name\":\"dldwmgxc\",\"order\":\"desc\"},{\"name\":\"pmutwuo\",\"order\":\"asc\"},{\"name\":\"khjwn\",\"order\":\"asc\"}],\"requestTime\":9145208048517339786,\"aggregatedValueField\":\"cpdggkzzlvmbmp\",\"aggregatedGroupingFields\":\"modfvuefywsbpfvm\",\"sum\":5583429102583863786,\"max\":98342047801553484,\"schema\":{\"name\":\"taakc\",\"version\":369562825}}") .toObject(SearchMetadata.class); - Assertions.assertEquals("lwuip", model.searchId()); - Assertions.assertEquals("cjzkzivgvvcna", model.resultType()); - Assertions.assertEquals(8913535749004515550L, model.total()); - Assertions.assertEquals(5279516661370439683L, model.top()); - Assertions.assertEquals("mueedndrdvstk", model.id()); - Assertions.assertEquals("chea", model.coreSummaries().get(0).status()); - Assertions.assertEquals(3646125258806158004L, model.coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("tdaaygdvwvg", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T06:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T00:12:41Z"), model.lastUpdated()); - Assertions.assertEquals("xrtfudxep", model.etag()); - Assertions.assertEquals("agvrvmnpkuk", model.sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.sort().get(0).order()); - Assertions.assertEquals(7611617377471579634L, model.requestTime()); - Assertions.assertEquals("hfjx", model.aggregatedValueField()); - Assertions.assertEquals("szkkfoqre", model.aggregatedGroupingFields()); - Assertions.assertEquals(8338807266312513089L, model.sum()); - Assertions.assertEquals(2185206310902116436L, model.max()); - Assertions.assertEquals("wneaiv", model.schema().name()); - Assertions.assertEquals(322973840, model.schema().version()); + Assertions.assertEquals("jutiiswacff", model.searchId()); + Assertions.assertEquals("k", model.resultType()); + Assertions.assertEquals(2817316502996814580L, model.total()); + Assertions.assertEquals(4896642944442173063L, model.top()); + Assertions.assertEquals("qcrailvpnppfufl", model.id()); + Assertions.assertEquals("hdlxyjrxsagafcn", model.coreSummaries().get(0).status()); + Assertions.assertEquals(3165727782283367859L, model.coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("vdrhvoo", model.status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-10T16:13:32Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T01:53:07Z"), model.lastUpdated()); + Assertions.assertEquals("bzdopcj", model.etag()); + Assertions.assertEquals("dldwmgxc", model.sort().get(0).name()); + Assertions.assertEquals(SearchSortEnum.DESC, model.sort().get(0).order()); + Assertions.assertEquals(9145208048517339786L, model.requestTime()); + Assertions.assertEquals("cpdggkzzlvmbmp", model.aggregatedValueField()); + Assertions.assertEquals("modfvuefywsbpfvm", model.aggregatedGroupingFields()); + Assertions.assertEquals(5583429102583863786L, model.sum()); + Assertions.assertEquals(98342047801553484L, model.max()); + Assertions.assertEquals("taakc", model.schema().name()); + Assertions.assertEquals(369562825, model.schema().version()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchMetadata model = new SearchMetadata().withSearchId("lwuip") - .withResultType("cjzkzivgvvcna") - .withTotal(8913535749004515550L) - .withTop(5279516661370439683L) - .withId("mueedndrdvstk") - .withCoreSummaries( - Arrays.asList(new CoreSummary().withStatus("chea").withNumberOfDocuments(3646125258806158004L))) - .withStatus("tdaaygdvwvg") - .withStartTime(OffsetDateTime.parse("2021-06-07T06:53:10Z")) - .withLastUpdated(OffsetDateTime.parse("2021-10-23T00:12:41Z")) - .withEtag("xrtfudxep") - .withSort(Arrays.asList(new SearchSort().withName("agvrvmnpkuk").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("dblx").withOrder(SearchSortEnum.DESC))) - .withRequestTime(7611617377471579634L) - .withAggregatedValueField("hfjx") - .withAggregatedGroupingFields("szkkfoqre") - .withSum(8338807266312513089L) - .withMax(2185206310902116436L) - .withSchema(new SearchMetadataSchema().withName("wneaiv").withVersion(322973840)); + SearchMetadata model = new SearchMetadata().withSearchId("jutiiswacff") + .withResultType("k") + .withTotal(2817316502996814580L) + .withTop(4896642944442173063L) + .withId("qcrailvpnppfufl") + .withCoreSummaries(Arrays.asList( + new CoreSummary().withStatus("hdlxyjrxsagafcn").withNumberOfDocuments(3165727782283367859L), + new CoreSummary().withStatus("qapnedgfbcv").withNumberOfDocuments(3094759713825353725L), + new CoreSummary().withStatus("vpk").withNumberOfDocuments(1489368232618160329L))) + .withStatus("vdrhvoo") + .withStartTime(OffsetDateTime.parse("2021-11-10T16:13:32Z")) + .withLastUpdated(OffsetDateTime.parse("2021-11-02T01:53:07Z")) + .withEtag("bzdopcj") + .withSort(Arrays.asList(new SearchSort().withName("dldwmgxc").withOrder(SearchSortEnum.DESC), + new SearchSort().withName("pmutwuo").withOrder(SearchSortEnum.ASC), + new SearchSort().withName("khjwn").withOrder(SearchSortEnum.ASC))) + .withRequestTime(9145208048517339786L) + .withAggregatedValueField("cpdggkzzlvmbmp") + .withAggregatedGroupingFields("modfvuefywsbpfvm") + .withSum(5583429102583863786L) + .withMax(98342047801553484L) + .withSchema(new SearchMetadataSchema().withName("taakc").withVersion(369562825)); model = BinaryData.fromObject(model).toObject(SearchMetadata.class); - Assertions.assertEquals("lwuip", model.searchId()); - Assertions.assertEquals("cjzkzivgvvcna", model.resultType()); - Assertions.assertEquals(8913535749004515550L, model.total()); - Assertions.assertEquals(5279516661370439683L, model.top()); - Assertions.assertEquals("mueedndrdvstk", model.id()); - Assertions.assertEquals("chea", model.coreSummaries().get(0).status()); - Assertions.assertEquals(3646125258806158004L, model.coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("tdaaygdvwvg", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T06:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T00:12:41Z"), model.lastUpdated()); - Assertions.assertEquals("xrtfudxep", model.etag()); - Assertions.assertEquals("agvrvmnpkuk", model.sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.sort().get(0).order()); - Assertions.assertEquals(7611617377471579634L, model.requestTime()); - Assertions.assertEquals("hfjx", model.aggregatedValueField()); - Assertions.assertEquals("szkkfoqre", model.aggregatedGroupingFields()); - Assertions.assertEquals(8338807266312513089L, model.sum()); - Assertions.assertEquals(2185206310902116436L, model.max()); - Assertions.assertEquals("wneaiv", model.schema().name()); - Assertions.assertEquals(322973840, model.schema().version()); + Assertions.assertEquals("jutiiswacff", model.searchId()); + Assertions.assertEquals("k", model.resultType()); + Assertions.assertEquals(2817316502996814580L, model.total()); + Assertions.assertEquals(4896642944442173063L, model.top()); + Assertions.assertEquals("qcrailvpnppfufl", model.id()); + Assertions.assertEquals("hdlxyjrxsagafcn", model.coreSummaries().get(0).status()); + Assertions.assertEquals(3165727782283367859L, model.coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("vdrhvoo", model.status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-10T16:13:32Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T01:53:07Z"), model.lastUpdated()); + Assertions.assertEquals("bzdopcj", model.etag()); + Assertions.assertEquals("dldwmgxc", model.sort().get(0).name()); + Assertions.assertEquals(SearchSortEnum.DESC, model.sort().get(0).order()); + Assertions.assertEquals(9145208048517339786L, model.requestTime()); + Assertions.assertEquals("cpdggkzzlvmbmp", model.aggregatedValueField()); + Assertions.assertEquals("modfvuefywsbpfvm", model.aggregatedGroupingFields()); + Assertions.assertEquals(5583429102583863786L, model.sum()); + Assertions.assertEquals(98342047801553484L, model.max()); + Assertions.assertEquals("taakc", model.schema().name()); + Assertions.assertEquals(369562825, model.schema().version()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java index ba8ec02b5961..1b6934cb5846 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java @@ -13,27 +13,27 @@ public final class SearchResultsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchResults model = BinaryData.fromString( - "{\"query\":\"fffwafqroudaspav\",\"description\":\"hrv\",\"limit\":901509130,\"startSearchTime\":\"2021-12-01T01:47:09Z\",\"endSearchTime\":\"2021-08-09T03:45:34Z\",\"sourceTable\":\"dhcxgkmoy\",\"azureAsyncOperationId\":\"dyuib\"}") + "{\"query\":\"olppvksrpqvujz\",\"description\":\"ehtwdwrft\",\"limit\":767551661,\"startSearchTime\":\"2021-10-26T11:25:15Z\",\"endSearchTime\":\"2021-11-04T23:57:55Z\",\"sourceTable\":\"l\",\"azureAsyncOperationId\":\"shfwpracstwity\"}") .toObject(SearchResults.class); - Assertions.assertEquals("fffwafqroudaspav", model.query()); - Assertions.assertEquals("hrv", model.description()); - Assertions.assertEquals(901509130, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T01:47:09Z"), model.startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T03:45:34Z"), model.endSearchTime()); + Assertions.assertEquals("olppvksrpqvujz", model.query()); + Assertions.assertEquals("ehtwdwrft", model.description()); + Assertions.assertEquals(767551661, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T11:25:15Z"), model.startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T23:57:55Z"), model.endSearchTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchResults model = new SearchResults().withQuery("fffwafqroudaspav") - .withDescription("hrv") - .withLimit(901509130) - .withStartSearchTime(OffsetDateTime.parse("2021-12-01T01:47:09Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-08-09T03:45:34Z")); + SearchResults model = new SearchResults().withQuery("olppvksrpqvujz") + .withDescription("ehtwdwrft") + .withLimit(767551661) + .withStartSearchTime(OffsetDateTime.parse("2021-10-26T11:25:15Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-11-04T23:57:55Z")); model = BinaryData.fromObject(model).toObject(SearchResults.class); - Assertions.assertEquals("fffwafqroudaspav", model.query()); - Assertions.assertEquals("hrv", model.description()); - Assertions.assertEquals(901509130, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T01:47:09Z"), model.startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T03:45:34Z"), model.endSearchTime()); + Assertions.assertEquals("olppvksrpqvujz", model.query()); + Assertions.assertEquals("ehtwdwrft", model.description()); + Assertions.assertEquals(767551661, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T11:25:15Z"), model.startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T23:57:55Z"), model.endSearchTime()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java index 1dde59a006c6..1f563325e92d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java @@ -13,33 +13,33 @@ public final class SearchSchemaValueTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchSchemaValue model = BinaryData.fromString( - "{\"name\":\"ulpjr\",\"displayName\":\"ag\",\"type\":\"vimjwos\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"skfc\",\"tq\",\"miekkezzikhlyfjh\",\"gqggebdunygae\"]}") + "{\"name\":\"xysmoc\",\"displayName\":\"qfqvmkc\",\"type\":\"zapvhelx\",\"indexed\":false,\"stored\":true,\"facet\":false,\"ownerType\":[\"tddckcb\",\"uejrjxgc\"]}") .toObject(SearchSchemaValue.class); - Assertions.assertEquals("ulpjr", model.name()); - Assertions.assertEquals("ag", model.displayName()); - Assertions.assertEquals("vimjwos", model.type()); - Assertions.assertEquals(false, model.indexed()); - Assertions.assertEquals(false, model.stored()); - Assertions.assertEquals(false, model.facet()); - Assertions.assertEquals("skfc", model.ownerType().get(0)); + Assertions.assertEquals("xysmoc", model.name()); + Assertions.assertEquals("qfqvmkc", model.displayName()); + Assertions.assertEquals("zapvhelx", model.type()); + Assertions.assertFalse(model.indexed()); + Assertions.assertTrue(model.stored()); + Assertions.assertFalse(model.facet()); + Assertions.assertEquals("tddckcb", model.ownerType().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchSchemaValue model = new SearchSchemaValue().withName("ulpjr") - .withDisplayName("ag") - .withType("vimjwos") + SearchSchemaValue model = new SearchSchemaValue().withName("xysmoc") + .withDisplayName("qfqvmkc") + .withType("zapvhelx") .withIndexed(false) - .withStored(false) + .withStored(true) .withFacet(false) - .withOwnerType(Arrays.asList("skfc", "tq", "miekkezzikhlyfjh", "gqggebdunygae")); + .withOwnerType(Arrays.asList("tddckcb", "uejrjxgc")); model = BinaryData.fromObject(model).toObject(SearchSchemaValue.class); - Assertions.assertEquals("ulpjr", model.name()); - Assertions.assertEquals("ag", model.displayName()); - Assertions.assertEquals("vimjwos", model.type()); - Assertions.assertEquals(false, model.indexed()); - Assertions.assertEquals(false, model.stored()); - Assertions.assertEquals(false, model.facet()); - Assertions.assertEquals("skfc", model.ownerType().get(0)); + Assertions.assertEquals("xysmoc", model.name()); + Assertions.assertEquals("qfqvmkc", model.displayName()); + Assertions.assertEquals("zapvhelx", model.type()); + Assertions.assertFalse(model.indexed()); + Assertions.assertTrue(model.stored()); + Assertions.assertFalse(model.facet()); + Assertions.assertEquals("tddckcb", model.ownerType().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java index 2cdc6d74a93c..9952fac215ff 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java @@ -12,16 +12,16 @@ public final class SearchSortTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SearchSort model = BinaryData.fromString("{\"name\":\"kl\",\"order\":\"desc\"}").toObject(SearchSort.class); - Assertions.assertEquals("kl", model.name()); + SearchSort model = BinaryData.fromString("{\"name\":\"ondjmq\",\"order\":\"desc\"}").toObject(SearchSort.class); + Assertions.assertEquals("ondjmq", model.name()); Assertions.assertEquals(SearchSortEnum.DESC, model.order()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchSort model = new SearchSort().withName("kl").withOrder(SearchSortEnum.DESC); + SearchSort model = new SearchSort().withName("ondjmq").withOrder(SearchSortEnum.DESC); model = BinaryData.fromObject(model).toObject(SearchSort.class); - Assertions.assertEquals("kl", model.name()); + Assertions.assertEquals("ondjmq", model.name()); Assertions.assertEquals(SearchSortEnum.DESC, model.order()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java index 655116fd9ba7..f483957f3e4b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.storageInsightConfigs() - .deleteWithResponse("jjvpilguooqja", "m", "itgueiookjbs", com.azure.core.util.Context.NONE); + .deleteWithResponse("ewijymrhbguz", "zkye", "nfnzhhh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java index 6912c6597be4..ac95b3a92c3a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java @@ -12,17 +12,18 @@ public final class StorageInsightStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - StorageInsightStatus model - = BinaryData.fromString("{\"state\":\"OK\",\"description\":\"n\"}").toObject(StorageInsightStatus.class); + StorageInsightStatus model = BinaryData.fromString("{\"state\":\"OK\",\"description\":\"kcdyhbpk\"}") + .toObject(StorageInsightStatus.class); Assertions.assertEquals(StorageInsightState.OK, model.state()); - Assertions.assertEquals("n", model.description()); + Assertions.assertEquals("kcdyhbpk", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StorageInsightStatus model = new StorageInsightStatus().withState(StorageInsightState.OK).withDescription("n"); + StorageInsightStatus model + = new StorageInsightStatus().withState(StorageInsightState.OK).withDescription("kcdyhbpk"); model = BinaryData.fromObject(model).toObject(StorageInsightStatus.class); Assertions.assertEquals(StorageInsightState.OK, model.state()); - Assertions.assertEquals("n", model.description()); + Assertions.assertEquals("kcdyhbpk", model.description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationsStopWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationsStopWithResponseMockTests.java new file mode 100644 index 000000000000..bf0e2efcb40a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationsStopWithResponseMockTests.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.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SummaryLogsOperationsStopWithResponseMockTests { + @Test + public void testStopWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + LogAnalyticsManager manager = LogAnalyticsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.summaryLogsOperations() + .stopWithResponse("t", "inklogxs", "tzarhzvqnsqktc", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinPropertiesTests.java new file mode 100644 index 000000000000..54f0d4458f74 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinPropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SummaryLogsRetryBinPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SummaryLogsRetryBinProperties model = BinaryData.fromString("{\"retryBinStartTime\":\"2021-07-20T22:39:45Z\"}") + .toObject(SummaryLogsRetryBinProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T22:39:45Z"), model.retryBinStartTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SummaryLogsRetryBinProperties model + = new SummaryLogsRetryBinProperties().withRetryBinStartTime(OffsetDateTime.parse("2021-07-20T22:39:45Z")); + model = BinaryData.fromObject(model).toObject(SummaryLogsRetryBinProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T22:39:45Z"), model.retryBinStartTime()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinTests.java new file mode 100644 index 000000000000..060185115b7b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinTests.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 com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SummaryLogsRetryBinTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SummaryLogsRetryBin model + = BinaryData.fromString("{\"properties\":{\"retryBinStartTime\":\"2021-09-02T16:11:18Z\"}}") + .toObject(SummaryLogsRetryBin.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T16:11:18Z"), model.properties().retryBinStartTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SummaryLogsRetryBin model = new SummaryLogsRetryBin().withProperties( + new SummaryLogsRetryBinProperties().withRetryBinStartTime(OffsetDateTime.parse("2021-09-02T16:11:18Z"))); + model = BinaryData.fromObject(model).toObject(SummaryLogsRetryBin.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T16:11:18Z"), model.properties().retryBinStartTime()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java deleted file mode 100644 index 69d013603667..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CreatedByType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SystemDataAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemDataAutoGenerated model = BinaryData.fromString( - "{\"createdBy\":\"dntwjchrdgo\",\"createdByType\":\"User\",\"createdAt\":\"2021-10-03T14:03:48Z\",\"lastModifiedBy\":\"ctondz\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-02-01T20:04:58Z\"}") - .toObject(SystemDataAutoGenerated.class); - Assertions.assertEquals("dntwjchrdgo", model.createdBy()); - Assertions.assertEquals(CreatedByType.USER, model.createdByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T14:03:48Z"), model.createdAt()); - Assertions.assertEquals("ctondz", model.lastModifiedBy()); - Assertions.assertEquals(CreatedByType.USER, model.lastModifiedByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:04:58Z"), model.lastModifiedAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemDataAutoGenerated model = new SystemDataAutoGenerated().withCreatedBy("dntwjchrdgo") - .withCreatedByType(CreatedByType.USER) - .withCreatedAt(OffsetDateTime.parse("2021-10-03T14:03:48Z")) - .withLastModifiedBy("ctondz") - .withLastModifiedByType(CreatedByType.USER) - .withLastModifiedAt(OffsetDateTime.parse("2021-02-01T20:04:58Z")); - model = BinaryData.fromObject(model).toObject(SystemDataAutoGenerated.class); - Assertions.assertEquals("dntwjchrdgo", model.createdBy()); - Assertions.assertEquals(CreatedByType.USER, model.createdByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T14:03:48Z"), model.createdAt()); - Assertions.assertEquals("ctondz", model.lastModifiedBy()); - Assertions.assertEquals(CreatedByType.USER, model.lastModifiedByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:04:58Z"), model.lastModifiedAt()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java index cdca0715099d..c04c0f4b0c73 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java @@ -21,75 +21,85 @@ public final class TableInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableInner model = BinaryData.fromString( - "{\"properties\":{\"retentionInDays\":744996388,\"totalRetentionInDays\":1739983778,\"archiveRetentionInDays\":1797695866,\"searchResults\":{\"query\":\"vjlfrqtt\",\"description\":\"jlkatnwxy\",\"limit\":2086170636,\"startSearchTime\":\"2021-07-06T16:40:26Z\",\"endSearchTime\":\"2021-05-28T18:08:40Z\",\"sourceTable\":\"fku\",\"azureAsyncOperationId\":\"cxkdmligovi\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-07-15T21:34:15Z\",\"endRestoreTime\":\"2021-12-03T21:08:29Z\",\"sourceTable\":\"oaz\",\"azureAsyncOperationId\":\"u\"},\"resultStatistics\":{\"progress\":46.173687,\"ingestedRecords\":1776042141,\"scannedGb\":38.299255},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"ybfhjxa\",\"schema\":{\"name\":\"jgslordilmyww\",\"displayName\":\"gkxnyedabg\",\"description\":\"udtjuewbc\",\"columns\":[{\"name\":\"uwhcjyxccybv\",\"type\":\"int\",\"dataTypeHint\":\"guid\",\"displayName\":\"udzpxgwjplmagstc\",\"description\":\"hpfkyrkdbdgi\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"nwqjnoba\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"iacegfnmn\",\"description\":\"pmvmemfnczdwvv\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"hpodbzev\",\"type\":\"long\",\"dataTypeHint\":\"uri\",\"displayName\":\"ukuv\",\"description\":\"cswsmystul\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"vlerchpqbmfpjba\",\"type\":\"dynamic\",\"dataTypeHint\":\"ip\",\"displayName\":\"xsspuunnoxyhk\",\"description\":\"qddrihpfhoqcaae\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jvlpjxxkzbr\",\"type\":\"guid\",\"dataTypeHint\":\"guid\",\"displayName\":\"siykzkdncjdxonbz\",\"description\":\"gculap\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"ogtqxepnylbf\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"tlvofq\",\"description\":\"vfcibyfmowux\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"xfzwi\"],\"labels\":[\"zjb\",\"yzsxjrkambtrne\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"vldspa\",\"tjb\",\"kdmflvestmjlx\",\"ril\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"pxlktwkuziycsl\",\"createdByType\":\"Key\",\"createdAt\":\"2021-08-14T04:43:23Z\",\"lastModifiedBy\":\"tcktyhjtqedcgzu\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-03-09T05:15:02Z\"},\"id\":\"qzz\",\"name\":\"rjvpglydzgkrvqee\",\"type\":\"toepryu\"}") + "{\"properties\":{\"retentionInDays\":1450729079,\"totalRetentionInDays\":981222471,\"archiveRetentionInDays\":5055042,\"searchResults\":{\"query\":\"hhyxxrw\",\"description\":\"co\",\"limit\":381030924,\"startSearchTime\":\"2021-05-28T17:22:29Z\",\"endSearchTime\":\"2021-03-31T06:04:43Z\",\"sourceTable\":\"ymareqnajxqugj\",\"azureAsyncOperationId\":\"ycubeddgs\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-06-13T04:37:53Z\",\"endRestoreTime\":\"2021-04-05T12:57Z\",\"sourceTable\":\"qal\",\"azureAsyncOperationId\":\"mnjijpxacqqudf\"},\"resultStatistics\":{\"progress\":55.070568,\"ingestedRecords\":701185139,\"scannedGb\":23.900133},\"plan\":\"Auxiliary\",\"lastPlanModifiedDate\":\"vayffimrzrt\",\"schema\":{\"name\":\"ogs\",\"displayName\":\"nevfdnw\",\"description\":\"mewzsyyc\",\"columns\":[{\"name\":\"oibjudpfrxtrthz\",\"type\":\"int\",\"dataTypeHint\":\"guid\",\"displayName\":\"kqb\",\"description\":\"ubpaxhe\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"pdtii\",\"type\":\"guid\",\"dataTypeHint\":\"armPath\",\"displayName\":\"axoruzfgsquy\",\"description\":\"rxxle\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jezwlwnw\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"y\",\"description\":\"patdooaojkniodko\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"jhemms\",\"type\":\"real\",\"dataTypeHint\":\"uri\",\"displayName\":\"odtji\",\"description\":\"wj\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"vefkdlfoakggk\",\"type\":\"dynamic\",\"dataTypeHint\":\"uri\",\"displayName\":\"wpu\",\"description\":\"qblylsyxkqj\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"tiagx\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"mpsbzkfzbeyv\",\"description\":\"qi\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jjxd\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"zclewyhmlw\",\"description\":\"ztzp\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"yfzqwhxxbu\",\"qa\",\"zfeqztppri\",\"lxorjaltolmncws\"],\"labels\":[\"wcsdbnwdcfhucq\",\"pfuvglsbjjca\",\"vxb\",\"t\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"mr\",\"xqtvcofu\",\"f\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"id\":\"dknnqvsazn\",\"name\":\"n\",\"type\":\"orudsgsa\"}") .toObject(TableInner.class); - Assertions.assertEquals(744996388, model.retentionInDays()); - Assertions.assertEquals(1739983778, model.totalRetentionInDays()); - Assertions.assertEquals("vjlfrqtt", model.searchResults().query()); - Assertions.assertEquals("jlkatnwxy", model.searchResults().description()); - Assertions.assertEquals(2086170636, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T16:40:26Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T18:08:40Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T21:34:15Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T21:08:29Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("oaz", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.plan()); - Assertions.assertEquals("jgslordilmyww", model.schema().name()); - Assertions.assertEquals("gkxnyedabg", model.schema().displayName()); - Assertions.assertEquals("udtjuewbc", model.schema().description()); - Assertions.assertEquals("uwhcjyxccybv", model.schema().columns().get(0).name()); + Assertions.assertEquals(1450729079, model.retentionInDays()); + Assertions.assertEquals(981222471, model.totalRetentionInDays()); + Assertions.assertEquals("hhyxxrw", model.searchResults().query()); + Assertions.assertEquals("co", model.searchResults().description()); + Assertions.assertEquals(381030924, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T17:22:29Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T06:04:43Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T04:37:53Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T12:57Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("qal", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("ogs", model.schema().name()); + Assertions.assertEquals("nevfdnw", model.schema().displayName()); + Assertions.assertEquals("mewzsyyc", model.schema().description()); + Assertions.assertEquals("oibjudpfrxtrthz", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.INT, model.schema().columns().get(0).type()); Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("udzpxgwjplmagstc", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("hpfkyrkdbdgi", model.schema().columns().get(0).description()); + Assertions.assertEquals("kqb", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ubpaxhe", model.schema().columns().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableInner model = new TableInner().withRetentionInDays(744996388) - .withTotalRetentionInDays(1739983778) - .withSearchResults(new SearchResults().withQuery("vjlfrqtt") - .withDescription("jlkatnwxy") - .withLimit(2086170636) - .withStartSearchTime(OffsetDateTime.parse("2021-07-06T16:40:26Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-05-28T18:08:40Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-15T21:34:15Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-12-03T21:08:29Z")) - .withSourceTable("oaz")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("jgslordilmyww") - .withDisplayName("gkxnyedabg") - .withDescription("udtjuewbc") + TableInner model = new TableInner().withRetentionInDays(1450729079) + .withTotalRetentionInDays(981222471) + .withSearchResults(new SearchResults().withQuery("hhyxxrw") + .withDescription("co") + .withLimit(381030924) + .withStartSearchTime(OffsetDateTime.parse("2021-05-28T17:22:29Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-03-31T06:04:43Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-06-13T04:37:53Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-04-05T12:57Z")) + .withSourceTable("qal")) + .withPlan(TablePlanEnum.AUXILIARY) + .withSchema(new Schema().withName("ogs") + .withDisplayName("nevfdnw") + .withDescription("mewzsyyc") .withColumns(Arrays.asList( - new Column().withName("uwhcjyxccybv") + new Column().withName("oibjudpfrxtrthz") .withType(ColumnTypeEnum.INT) .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("udzpxgwjplmagstc") - .withDescription("hpfkyrkdbdgi"), - new Column().withName("nwqjnoba") - .withType(ColumnTypeEnum.INT) + .withDisplayName("kqb") + .withDescription("ubpaxhe"), + new Column().withName("pdtii") + .withType(ColumnTypeEnum.GUID) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("axoruzfgsquy") + .withDescription("rxxle"), + new Column().withName("jezwlwnw") + .withType(ColumnTypeEnum.REAL) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("y") + .withDescription("patdooaojkniodko"), + new Column().withName("jhemms") + .withType(ColumnTypeEnum.REAL) .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("iacegfnmn") - .withDescription("pmvmemfnczdwvv")))); + .withDisplayName("odtji") + .withDescription("wj")))); model = BinaryData.fromObject(model).toObject(TableInner.class); - Assertions.assertEquals(744996388, model.retentionInDays()); - Assertions.assertEquals(1739983778, model.totalRetentionInDays()); - Assertions.assertEquals("vjlfrqtt", model.searchResults().query()); - Assertions.assertEquals("jlkatnwxy", model.searchResults().description()); - Assertions.assertEquals(2086170636, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T16:40:26Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T18:08:40Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T21:34:15Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T21:08:29Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("oaz", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.plan()); - Assertions.assertEquals("jgslordilmyww", model.schema().name()); - Assertions.assertEquals("gkxnyedabg", model.schema().displayName()); - Assertions.assertEquals("udtjuewbc", model.schema().description()); - Assertions.assertEquals("uwhcjyxccybv", model.schema().columns().get(0).name()); + Assertions.assertEquals(1450729079, model.retentionInDays()); + Assertions.assertEquals(981222471, model.totalRetentionInDays()); + Assertions.assertEquals("hhyxxrw", model.searchResults().query()); + Assertions.assertEquals("co", model.searchResults().description()); + Assertions.assertEquals(381030924, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T17:22:29Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T06:04:43Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T04:37:53Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T12:57Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("qal", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("ogs", model.schema().name()); + Assertions.assertEquals("nevfdnw", model.schema().displayName()); + Assertions.assertEquals("mewzsyyc", model.schema().description()); + Assertions.assertEquals("oibjudpfrxtrthz", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.INT, model.schema().columns().get(0).type()); Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("udzpxgwjplmagstc", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("hpfkyrkdbdgi", model.schema().columns().get(0).description()); + Assertions.assertEquals("kqb", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ubpaxhe", model.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java index 3ed057b6cffe..909b4652dfee 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java @@ -21,69 +21,85 @@ public final class TablePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableProperties model = BinaryData.fromString( - "{\"retentionInDays\":479918870,\"totalRetentionInDays\":2045022432,\"archiveRetentionInDays\":1783841206,\"searchResults\":{\"query\":\"o\",\"description\":\"vf\",\"limit\":1925116648,\"startSearchTime\":\"2021-10-04T03:30Z\",\"endSearchTime\":\"2021-11-05T03:00:16Z\",\"sourceTable\":\"f\",\"azureAsyncOperationId\":\"z\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-04-24T01:32:22Z\",\"endRestoreTime\":\"2021-11-03T23:30:17Z\",\"sourceTable\":\"cx\",\"azureAsyncOperationId\":\"t\"},\"resultStatistics\":{\"progress\":39.374405,\"ingestedRecords\":675680646,\"scannedGb\":64.79667},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"mldgxobfirc\",\"schema\":{\"name\":\"kciayzri\",\"displayName\":\"hya\",\"description\":\"vjlboxqvk\",\"columns\":[{\"name\":\"ho\",\"type\":\"boolean\",\"dataTypeHint\":\"guid\",\"displayName\":\"wdigumbnraauz\",\"description\":\"tj\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"zwwva\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"fonkphhqyikvyla\",\"description\":\"avluwmncs\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"bvpoekrsgsgbdhu\",\"type\":\"dynamic\",\"dataTypeHint\":\"uri\",\"displayName\":\"gkynscliqh\",\"description\":\"h\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"kubotppnvdxz\",\"type\":\"dateTime\",\"dataTypeHint\":\"guid\",\"displayName\":\"bbc\",\"description\":\"qagt\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"categories\":[\"qojpy\"],\"labels\":[\"trdcnifmzzs\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"xmprafwg\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false}") + "{\"retentionInDays\":220532000,\"totalRetentionInDays\":103703544,\"archiveRetentionInDays\":830439521,\"searchResults\":{\"query\":\"wjue\",\"description\":\"eburu\",\"limit\":1850094254,\"startSearchTime\":\"2021-01-16T01:35:10Z\",\"endSearchTime\":\"2021-09-18T15:34:48Z\",\"sourceTable\":\"l\",\"azureAsyncOperationId\":\"ab\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-09-17T06:29:30Z\",\"endRestoreTime\":\"2021-03-04T19:19:07Z\",\"sourceTable\":\"frvtpuqu\",\"azureAsyncOperationId\":\"qlgkfbtn\"},\"resultStatistics\":{\"progress\":47.37398,\"ingestedRecords\":1440714343,\"scannedGb\":33.60299},\"plan\":\"Auxiliary\",\"lastPlanModifiedDate\":\"ujitcjedftww\",\"schema\":{\"name\":\"kojvd\",\"displayName\":\"zfoqouicybxar\",\"description\":\"szufoxciqopidoa\",\"columns\":[{\"name\":\"dhkha\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"bon\",\"description\":\"ntoe\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"whkszzcmrvexztvb\",\"type\":\"dateTime\",\"dataTypeHint\":\"uri\",\"displayName\":\"aoyzkoow\",\"description\":\"mnguxawqaldsyu\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"qfobwyz\",\"type\":\"long\",\"dataTypeHint\":\"guid\",\"displayName\":\"t\",\"description\":\"fhpagmhrskdsnf\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"gtdlmk\",\"type\":\"long\",\"dataTypeHint\":\"guid\",\"displayName\":\"hewpusdsttwv\",\"description\":\"vbbejdcng\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"gm\",\"type\":\"int\",\"dataTypeHint\":\"guid\",\"displayName\":\"grtwae\",\"description\":\"uzkopbminrfd\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"ziuiefozbhdm\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"hoftr\",\"description\":\"equi\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"lfaoqzpiyylhaln\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"ph\",\"description\":\"ivwitqscywugg\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"bwemhairs\",\"rgzdwmsweyp\"],\"labels\":[\"xggicccnxqhuexmk\",\"tlstvlzywem\",\"zrncsdt\",\"lusiy\"],\"source\":\"customer\",\"tableType\":\"RestoredLogs\",\"tableSubType\":\"Classic\",\"solutions\":[\"sl\",\"eadcygqukyhejhz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true}") .toObject(TableProperties.class); - Assertions.assertEquals(479918870, model.retentionInDays()); - Assertions.assertEquals(2045022432, model.totalRetentionInDays()); - Assertions.assertEquals("o", model.searchResults().query()); - Assertions.assertEquals("vf", model.searchResults().description()); - Assertions.assertEquals(1925116648, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T03:30Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T03:00:16Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T01:32:22Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T23:30:17Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("cx", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.BASIC, model.plan()); - Assertions.assertEquals("kciayzri", model.schema().name()); - Assertions.assertEquals("hya", model.schema().displayName()); - Assertions.assertEquals("vjlboxqvk", model.schema().description()); - Assertions.assertEquals("ho", model.schema().columns().get(0).name()); + Assertions.assertEquals(220532000, model.retentionInDays()); + Assertions.assertEquals(103703544, model.totalRetentionInDays()); + Assertions.assertEquals("wjue", model.searchResults().query()); + Assertions.assertEquals("eburu", model.searchResults().description()); + Assertions.assertEquals(1850094254, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T01:35:10Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T15:34:48Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T06:29:30Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T19:19:07Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("frvtpuqu", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("kojvd", model.schema().name()); + Assertions.assertEquals("zfoqouicybxar", model.schema().displayName()); + Assertions.assertEquals("szufoxciqopidoa", model.schema().description()); + Assertions.assertEquals("dhkha", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.BOOLEAN, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("wdigumbnraauz", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("tj", model.schema().columns().get(0).description()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("bon", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ntoe", model.schema().columns().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableProperties model = new TableProperties().withRetentionInDays(479918870) - .withTotalRetentionInDays(2045022432) - .withSearchResults(new SearchResults().withQuery("o") - .withDescription("vf") - .withLimit(1925116648) - .withStartSearchTime(OffsetDateTime.parse("2021-10-04T03:30Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-11-05T03:00:16Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-04-24T01:32:22Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-11-03T23:30:17Z")) - .withSourceTable("cx")) - .withPlan(TablePlanEnum.BASIC) - .withSchema(new Schema().withName("kciayzri") - .withDisplayName("hya") - .withDescription("vjlboxqvk") - .withColumns(Arrays.asList(new Column().withName("ho") - .withType(ColumnTypeEnum.BOOLEAN) - .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("wdigumbnraauz") - .withDescription("tj")))); + TableProperties model = new TableProperties().withRetentionInDays(220532000) + .withTotalRetentionInDays(103703544) + .withSearchResults(new SearchResults().withQuery("wjue") + .withDescription("eburu") + .withLimit(1850094254) + .withStartSearchTime(OffsetDateTime.parse("2021-01-16T01:35:10Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-09-18T15:34:48Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-09-17T06:29:30Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-03-04T19:19:07Z")) + .withSourceTable("frvtpuqu")) + .withPlan(TablePlanEnum.AUXILIARY) + .withSchema(new Schema().withName("kojvd") + .withDisplayName("zfoqouicybxar") + .withDescription("szufoxciqopidoa") + .withColumns(Arrays.asList( + new Column().withName("dhkha") + .withType(ColumnTypeEnum.BOOLEAN) + .withDataTypeHint(ColumnDataTypeHintEnum.URI) + .withDisplayName("bon") + .withDescription("ntoe"), + new Column().withName("whkszzcmrvexztvb") + .withType(ColumnTypeEnum.DATE_TIME) + .withDataTypeHint(ColumnDataTypeHintEnum.URI) + .withDisplayName("aoyzkoow") + .withDescription("mnguxawqaldsyu"), + new Column().withName("qfobwyz") + .withType(ColumnTypeEnum.LONG) + .withDataTypeHint(ColumnDataTypeHintEnum.GUID) + .withDisplayName("t") + .withDescription("fhpagmhrskdsnf"), + new Column().withName("gtdlmk") + .withType(ColumnTypeEnum.LONG) + .withDataTypeHint(ColumnDataTypeHintEnum.GUID) + .withDisplayName("hewpusdsttwv") + .withDescription("vbbejdcng")))); model = BinaryData.fromObject(model).toObject(TableProperties.class); - Assertions.assertEquals(479918870, model.retentionInDays()); - Assertions.assertEquals(2045022432, model.totalRetentionInDays()); - Assertions.assertEquals("o", model.searchResults().query()); - Assertions.assertEquals("vf", model.searchResults().description()); - Assertions.assertEquals(1925116648, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T03:30Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T03:00:16Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T01:32:22Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T23:30:17Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("cx", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.BASIC, model.plan()); - Assertions.assertEquals("kciayzri", model.schema().name()); - Assertions.assertEquals("hya", model.schema().displayName()); - Assertions.assertEquals("vjlboxqvk", model.schema().description()); - Assertions.assertEquals("ho", model.schema().columns().get(0).name()); + Assertions.assertEquals(220532000, model.retentionInDays()); + Assertions.assertEquals(103703544, model.totalRetentionInDays()); + Assertions.assertEquals("wjue", model.searchResults().query()); + Assertions.assertEquals("eburu", model.searchResults().description()); + Assertions.assertEquals(1850094254, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T01:35:10Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T15:34:48Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T06:29:30Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T19:19:07Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("frvtpuqu", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("kojvd", model.schema().name()); + Assertions.assertEquals("zfoqouicybxar", model.schema().displayName()); + Assertions.assertEquals("szufoxciqopidoa", model.schema().description()); + Assertions.assertEquals("dhkha", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.BOOLEAN, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("wdigumbnraauz", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("tj", model.schema().columns().get(0).description()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("bon", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ntoe", model.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java index 8fc39e4f9123..9e7a5de90ff5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testCancelSearchWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.tables().cancelSearchWithResponse("myltj", "rspxklur", "clf", com.azure.core.util.Context.NONE); + manager.tables() + .cancelSearchWithResponse("bxsjybvitvqkj", "az", "umtggmuwdchozfn", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java index a5218a99664d..47b3fe36b9ae 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.Column; @@ -29,65 +29,75 @@ public final class TablesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"retentionInDays\":480341295,\"totalRetentionInDays\":27190578,\"archiveRetentionInDays\":1086111273,\"searchResults\":{\"query\":\"lidftujwjj\",\"description\":\"wbeqrkuor\",\"limit\":1870712650,\"startSearchTime\":\"2021-06-02T06:21:30Z\",\"endSearchTime\":\"2021-02-07T15:13:54Z\",\"sourceTable\":\"mdvhazcvjy\",\"azureAsyncOperationId\":\"qswbqerzwx\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-02-23T19:01:43Z\",\"endRestoreTime\":\"2021-05-09T17:49:27Z\",\"sourceTable\":\"ukvlb\",\"azureAsyncOperationId\":\"tgdstyouambe\"},\"resultStatistics\":{\"progress\":89.09465,\"ingestedRecords\":1285281809,\"scannedGb\":14.380062},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"mut\",\"schema\":{\"name\":\"eyguq\",\"displayName\":\"ijiitns\",\"description\":\"lz\",\"columns\":[{\"name\":\"grijwaiufanrayb\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"oj\",\"description\":\"dgrhydkygywezs\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"ygzmxieqvdsmak\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"hyhxa\",\"description\":\"bx\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"tblxpkkwjdjodqhy\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"emehllizh\",\"description\":\"umoqodkad\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"categories\":[\"qladywrxwhydtlu\",\"vadswzs\",\"uyem\",\"owuowh\"],\"labels\":[\"nwyrmouv\"],\"source\":\"customer\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"trfowtdvr\",\"mvlihcvjdrqcrjid\",\"ftukvhd\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"zd\",\"createdByType\":\"Application\",\"createdAt\":\"2021-03-22T04:05:19Z\",\"lastModifiedBy\":\"xhafratqx\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-11-30T03:06:43Z\"},\"id\":\"umzznvalqjrhuz\",\"name\":\"fxonjtpusllywp\",\"type\":\"tiotzb\"}"; + = "{\"properties\":{\"retentionInDays\":1532200707,\"totalRetentionInDays\":543172402,\"archiveRetentionInDays\":699290789,\"searchResults\":{\"query\":\"fccnuhiigb\",\"description\":\"bui\",\"limit\":1764547970,\"startSearchTime\":\"2021-06-14T14:08:19Z\",\"endSearchTime\":\"2021-05-03T08:54:55Z\",\"sourceTable\":\"rkdlb\",\"azureAsyncOperationId\":\"qxvhcsyhzlwxa\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-09-21T01:21:46Z\",\"endRestoreTime\":\"2021-05-18T07:30Z\",\"sourceTable\":\"xdndsbdweaderzm\",\"azureAsyncOperationId\":\"t\"},\"resultStatistics\":{\"progress\":86.6211,\"ingestedRecords\":1639161747,\"scannedGb\":6.1114073},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"goaqylkjztj\",\"schema\":{\"name\":\"zjcg\",\"displayName\":\"itpfinzcpdl\",\"description\":\"rlgjm\",\"columns\":[{\"name\":\"vcqguefzh\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"durelyujl\",\"description\":\"oumpcky\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"gptaj\",\"type\":\"boolean\",\"dataTypeHint\":\"armPath\",\"displayName\":\"ucycijo\",\"description\":\"xiutgjcyzyzj\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"txjeaoqaqbzgy\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"atbwbqam\",\"description\":\"uliyslpkcv\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"pmywbormcq\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"qpkzfbojxjmcsmy\",\"description\":\"ixvcpwnkwywzwo\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"categories\":[\"uoiqt\",\"mt\"],\"labels\":[\"kn\",\"rwzawnvs\",\"cfhzagxnvhycv\",\"imwrzregzgyufu\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"kzkdhmeott\",\"w\",\"yos\",\"wwhnhjtfvpn\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"id\":\"wyn\",\"name\":\"dqllzsauzpjlxeeh\",\"type\":\"xiqhzlraymezxlsk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Table response = manager.tables() - .define("oytzpose") - .withExistingWorkspace("xa", "n") - .withRetentionInDays(1606592668) - .withTotalRetentionInDays(1200171262) - .withSearchResults(new SearchResults().withQuery("aupxvpi") - .withDescription("f") - .withLimit(479705193) - .withStartSearchTime(OffsetDateTime.parse("2021-06-27T21:10:54Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-06-24T09:11:48Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-31T20:24:08Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-02-02T20:49:05Z")) - .withSourceTable("xwetwkdrcyrucpc")) - .withPlan(TablePlanEnum.BASIC) - .withSchema(new Schema().withName("dnelqkaad") - .withDisplayName("nwf") - .withDescription("nniyopetxi") + .define("akizvoaikna") + .withExistingWorkspace("fexl", "xn") + .withRetentionInDays(427869575) + .withTotalRetentionInDays(915740665) + .withSearchResults(new SearchResults().withQuery("lykwphvxz") + .withDescription("xhmpejtlkex") + .withLimit(780657181) + .withStartSearchTime(OffsetDateTime.parse("2021-09-17T09:38:18Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-08-12T17:38:45Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-03-10T18:49:30Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-10-06T09:15:33Z")) + .withSourceTable("kyupijubyqj")) + .withPlan(TablePlanEnum.ANALYTICS) + .withSchema(new Schema().withName("mgzvyfi") + .withDisplayName("kzuqnwsith") + .withDescription("olyahluqwqulsut") .withColumns(Arrays.asList( - new Column().withName("lyxnucaephb") - .withType(ColumnTypeEnum.GUID) - .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("tv") - .withDescription("sdtcjbctvivuzqym"), - new Column().withName("tgitsqhzvbrzc") - .withType(ColumnTypeEnum.DYNAMIC) + new Column().withName("xykfhyq") + .withType(ColumnTypeEnum.DATE_TIME) .withDataTypeHint(ColumnDataTypeHintEnum.IP) - .withDisplayName("ndscxmxeatk") - .withDescription("mwnrdj")))) + .withDisplayName("g") + .withDescription("ftbcvexreuquow"), + new Column().withName("hreagk") + .withType(ColumnTypeEnum.STRING) + .withDataTypeHint(ColumnDataTypeHintEnum.IP) + .withDisplayName("tvbczsulm") + .withDescription("glmep"), + new Column().withName("kgsangpszng") + .withType(ColumnTypeEnum.STRING) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("kvec") + .withDescription("jcngoadyed"), + new Column().withName("oknub") + .withType(ColumnTypeEnum.DATE_TIME) + .withDataTypeHint(ColumnDataTypeHintEnum.GUID) + .withDisplayName("pz") + .withDescription("gdgxvcoqraswug")))) .create(); - Assertions.assertEquals(480341295, response.retentionInDays()); - Assertions.assertEquals(27190578, response.totalRetentionInDays()); - Assertions.assertEquals("lidftujwjj", response.searchResults().query()); - Assertions.assertEquals("wbeqrkuor", response.searchResults().description()); - Assertions.assertEquals(1870712650, response.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-02T06:21:30Z"), + Assertions.assertEquals(1532200707, response.retentionInDays()); + Assertions.assertEquals(543172402, response.totalRetentionInDays()); + Assertions.assertEquals("fccnuhiigb", response.searchResults().query()); + Assertions.assertEquals("bui", response.searchResults().description()); + Assertions.assertEquals(1764547970, response.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-14T14:08:19Z"), response.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T15:13:54Z"), response.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T19:01:43Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T08:54:55Z"), response.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T01:21:46Z"), response.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T17:49:27Z"), response.restoredLogs().endRestoreTime()); - Assertions.assertEquals("ukvlb", response.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, response.plan()); - Assertions.assertEquals("eyguq", response.schema().name()); - Assertions.assertEquals("ijiitns", response.schema().displayName()); - Assertions.assertEquals("lz", response.schema().description()); - Assertions.assertEquals("grijwaiufanrayb", response.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.REAL, response.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.ARM_PATH, response.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("oj", response.schema().columns().get(0).displayName()); - Assertions.assertEquals("dgrhydkygywezs", response.schema().columns().get(0).description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-18T07:30Z"), response.restoredLogs().endRestoreTime()); + Assertions.assertEquals("xdndsbdweaderzm", response.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.BASIC, response.plan()); + Assertions.assertEquals("zjcg", response.schema().name()); + Assertions.assertEquals("itpfinzcpdl", response.schema().displayName()); + Assertions.assertEquals("rlgjm", response.schema().description()); + Assertions.assertEquals("vcqguefzh", response.schema().columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.STRING, response.schema().columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.IP, response.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("durelyujl", response.schema().columns().get(0).displayName()); + Assertions.assertEquals("oumpcky", response.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java index 823a115012ca..eb4fe5983d9a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.tables().delete("rkgwltxeqip", "gzdyimsfayorp", "avkjog", com.azure.core.util.Context.NONE); + manager.tables().delete("rsofpltdbmairrh", "hfnrac", "npq", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java index ef1834667e11..87a879528665 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; @@ -24,39 +24,39 @@ public final class TablesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"retentionInDays\":1168808481,\"totalRetentionInDays\":248802373,\"archiveRetentionInDays\":564672857,\"searchResults\":{\"query\":\"buhzacaq\",\"description\":\"ltcoqc\",\"limit\":1004609054,\"startSearchTime\":\"2021-06-10T09:18:11Z\",\"endSearchTime\":\"2021-04-18T12:03:07Z\",\"sourceTable\":\"kuejk\",\"azureAsyncOperationId\":\"bizt\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-09-28T22:56:41Z\",\"endRestoreTime\":\"2021-06-13T10:08:38Z\",\"sourceTable\":\"vjufycsjmlbe\",\"azureAsyncOperationId\":\"ej\"},\"resultStatistics\":{\"progress\":97.11777,\"ingestedRecords\":859653726,\"scannedGb\":22.48292},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"tudaw\",\"schema\":{\"name\":\"felqerpptc\",\"displayName\":\"qnzmnhiil\",\"description\":\"lwcjgckbbcccgzpr\",\"columns\":[{\"name\":\"yuffatsgf\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"byubhiqdxyurnpn\",\"description\":\"zafccnuhiigb\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"vxva\",\"type\":\"real\",\"dataTypeHint\":\"guid\",\"displayName\":\"lbnb\",\"description\":\"vhcs\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"aeaovur\",\"type\":\"dateTime\",\"dataTypeHint\":\"uri\",\"displayName\":\"bdweade\",\"description\":\"mwntopagttmvmma\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"kjztjiuazjcgmxi\",\"type\":\"string\",\"dataTypeHint\":\"armPath\",\"displayName\":\"cpdltkrlg\",\"description\":\"tbdrvcqgue\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"qdurelyujlfyoum\",\"type\":\"dateTime\",\"dataTypeHint\":\"ip\",\"displayName\":\"lcdi\",\"description\":\"tajbrz\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"ci\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"utgjcyz\",\"description\":\"jdnrqjbt\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"aqbzgyhfwwvuatbw\",\"type\":\"guid\",\"dataTypeHint\":\"guid\",\"displayName\":\"uliyslpkcv\",\"description\":\"f\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"myw\",\"type\":\"guid\",\"dataTypeHint\":\"uri\",\"displayName\":\"miciij\",\"description\":\"kzfbojxjmcsmyq\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"nkwywzwofa\",\"ickduoiqta\",\"t\"],\"labels\":[\"kn\",\"rwzawnvs\",\"cfhzagxnvhycv\",\"imwrzregzgyufu\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"kzkdhmeott\",\"w\",\"yos\",\"wwhnhjtfvpn\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"ynudqllzsa\",\"createdByType\":\"Key\",\"createdAt\":\"2021-01-28T04:04:17Z\",\"lastModifiedBy\":\"eehuxiqhzlray\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-06-28T07:28:45Z\"},\"id\":\"kihmxrfdsajredn\",\"name\":\"yyshtuwgmevua\",\"type\":\"pwzyi\"}"; + = "{\"properties\":{\"retentionInDays\":173129276,\"totalRetentionInDays\":1276247393,\"archiveRetentionInDays\":611963257,\"searchResults\":{\"query\":\"lblhtjq\",\"description\":\"yvwehtaemxh\",\"limit\":974813630,\"startSearchTime\":\"2021-07-22T16:02:08Z\",\"endSearchTime\":\"2021-06-03T23:18:21Z\",\"sourceTable\":\"xivzrrry\",\"azureAsyncOperationId\":\"imipskdyzatvfuz\"},\"restoredLogs\":{\"startRestoreTime\":\"2020-12-21T06:07:21Z\",\"endRestoreTime\":\"2021-03-13T04:29:21Z\",\"sourceTable\":\"ru\",\"azureAsyncOperationId\":\"igsyeipqdsmjt\"},\"resultStatistics\":{\"progress\":32.653797,\"ingestedRecords\":1529968527,\"scannedGb\":98.93236},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"plkcsm\",\"schema\":{\"name\":\"wtbbaedorvvmqf\",\"displayName\":\"ygbdgwumgxdgdhpa\",\"description\":\"dexjddvjs\",\"columns\":[{\"name\":\"tm\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"lsrs\",\"description\":\"pt\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"gjokjljnhvlqjbek\",\"type\":\"guid\",\"dataTypeHint\":\"armPath\",\"displayName\":\"bksdqhjvyklxesl\",\"description\":\"hustcpoqmavnwqjw\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jjjkxybwfdbk\",\"type\":\"guid\",\"dataTypeHint\":\"armPath\",\"displayName\":\"svkzykj\",\"description\":\"kns\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"cdp\",\"type\":\"string\",\"dataTypeHint\":\"armPath\",\"displayName\":\"mgjfbpkuwxeoio\",\"description\":\"izfavkjzwf\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"fz\",\"type\":\"boolean\",\"dataTypeHint\":\"ip\",\"displayName\":\"zxmdew\",\"description\":\"sxkrpl\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"categories\":[\"w\",\"iyoypsuhbrnnhj\"],\"labels\":[\"wjh\",\"kbiwetpozyc\",\"qiqyhgfsetzlexbs\",\"ledynojpz\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"tnhqsycl\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":true},\"id\":\"afvafh\",\"name\":\"by\",\"type\":\"ccbevxrhyzdf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Table response = manager.tables() - .getWithResponse("ubn", "itpkpztrgdg", "vcoqraswugyxpqi", com.azure.core.util.Context.NONE) + .getWithResponse("wqapfgsdp", "vessm", "hhkuuip", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(1168808481, response.retentionInDays()); - Assertions.assertEquals(248802373, response.totalRetentionInDays()); - Assertions.assertEquals("buhzacaq", response.searchResults().query()); - Assertions.assertEquals("ltcoqc", response.searchResults().description()); - Assertions.assertEquals(1004609054, response.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T09:18:11Z"), + Assertions.assertEquals(173129276, response.retentionInDays()); + Assertions.assertEquals(1276247393, response.totalRetentionInDays()); + Assertions.assertEquals("lblhtjq", response.searchResults().query()); + Assertions.assertEquals("yvwehtaemxh", response.searchResults().description()); + Assertions.assertEquals(974813630, response.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T16:02:08Z"), response.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T12:03:07Z"), response.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T22:56:41Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T23:18:21Z"), response.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T06:07:21Z"), response.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T10:08:38Z"), response.restoredLogs().endRestoreTime()); - Assertions.assertEquals("vjufycsjmlbe", response.restoredLogs().sourceTable()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T04:29:21Z"), response.restoredLogs().endRestoreTime()); + Assertions.assertEquals("ru", response.restoredLogs().sourceTable()); Assertions.assertEquals(TablePlanEnum.ANALYTICS, response.plan()); - Assertions.assertEquals("felqerpptc", response.schema().name()); - Assertions.assertEquals("qnzmnhiil", response.schema().displayName()); - Assertions.assertEquals("lwcjgckbbcccgzpr", response.schema().description()); - Assertions.assertEquals("yuffatsgf", response.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.STRING, response.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.URI, response.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("byubhiqdxyurnpn", response.schema().columns().get(0).displayName()); - Assertions.assertEquals("zafccnuhiigb", response.schema().columns().get(0).description()); + Assertions.assertEquals("wtbbaedorvvmqf", response.schema().name()); + Assertions.assertEquals("ygbdgwumgxdgdhpa", response.schema().displayName()); + Assertions.assertEquals("dexjddvjs", response.schema().description()); + Assertions.assertEquals("tm", response.schema().columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.GUID, response.schema().columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.IP, response.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("lsrs", response.schema().columns().get(0).displayName()); + Assertions.assertEquals("pt", response.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java index 412e46fd379a..da5b0231cd34 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; @@ -25,41 +25,41 @@ public final class TablesListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"retentionInDays\":143517524,\"totalRetentionInDays\":1172309322,\"archiveRetentionInDays\":1559182660,\"searchResults\":{\"query\":\"mmfz\",\"description\":\"fwxrzxmdew\",\"limit\":1373177035,\"startSearchTime\":\"2021-04-20T22:50:05Z\",\"endSearchTime\":\"2021-01-08T17:25:29Z\",\"sourceTable\":\"bjazejwwviy\",\"azureAsyncOperationId\":\"ps\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-20T14:34:31Z\",\"endRestoreTime\":\"2021-01-22T13:49:23Z\",\"sourceTable\":\"jxsqwjhqkbiwetp\",\"azureAsyncOperationId\":\"ycyqiqyhgfsetzl\"},\"resultStatistics\":{\"progress\":37.550117,\"ingestedRecords\":207278850,\"scannedGb\":68.76575},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"jpziu\",\"schema\":{\"name\":\"zkkdtnhqs\",\"displayName\":\"ljselp\",\"description\":\"bafvafhlbylcc\",\"columns\":[{\"name\":\"rhyzdf\",\"type\":\"real\",\"dataTypeHint\":\"uri\",\"displayName\":\"ltdb\",\"description\":\"irrhv\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"pqigtuujwouhd\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"bjb\",\"description\":\"jybvit\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"znumtggmuwdchoz\",\"type\":\"long\",\"dataTypeHint\":\"armPath\",\"displayName\":\"lv\",\"description\":\"oakizvoai\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"uwiguyxlyk\",\"type\":\"boolean\",\"dataTypeHint\":\"armPath\",\"displayName\":\"cwxhmpej\",\"description\":\"ke\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"vkcqhr\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"ccrmmk\",\"description\":\"pijubyq\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"frkemyildudxja\",\"cowvfdjkp\",\"xphlkksnmg\",\"vyfijdkzuqnw\"],\"labels\":[\"huqol\",\"ah\",\"uqwqulsutrjbhxyk\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"ugdrftbc\",\"exreu\",\"uowtljvfwhrea\",\"khyxvrqtvbcz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"epjpfs\",\"createdByType\":\"ManagedIdentity\",\"createdAt\":\"2021-11-01T10:59:42Z\",\"lastModifiedBy\":\"ngpszngafpg\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-07-27T16:28:59Z\"},\"id\":\"cj\",\"name\":\"jcngoadyed\",\"type\":\"zrgjfok\"}]}"; + = "{\"value\":[{\"properties\":{\"retentionInDays\":1986729733,\"totalRetentionInDays\":260996663,\"archiveRetentionInDays\":1750889059,\"searchResults\":{\"query\":\"cdxa\",\"description\":\"u\",\"limit\":2063766495,\"startSearchTime\":\"2021-08-26T08:46Z\",\"endSearchTime\":\"2021-09-09T20:53:20Z\",\"sourceTable\":\"bklqpxz\",\"azureAsyncOperationId\":\"afeddwwnlza\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-04-21T23:27:57Z\",\"endRestoreTime\":\"2021-11-21T23:37:33Z\",\"sourceTable\":\"hgookrtalvnbwgpb\",\"azureAsyncOperationId\":\"eluclvdjj\"},\"resultStatistics\":{\"progress\":84.43588,\"ingestedRecords\":574084923,\"scannedGb\":58.54812},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"hhxhq\",\"schema\":{\"name\":\"nvzoqgyipemch\",\"displayName\":\"v\",\"description\":\"zuejd\",\"columns\":[{\"name\":\"lghwzhome\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"iuh\",\"description\":\"wmoaiancznvodrrs\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"kxrx\",\"type\":\"dateTime\",\"dataTypeHint\":\"armPath\",\"displayName\":\"kgfbqljnqkhy\",\"description\":\"ocokule\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"qffawey\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"jdxravjuqdbrx\",\"description\":\"gchbapxkiy\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"jbuscg\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"ycblevpmcl\",\"description\":\"yxkyxlz\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"taf\",\"type\":\"boolean\",\"dataTypeHint\":\"ip\",\"displayName\":\"vwmbjlzqsczpg\",\"description\":\"wnapfdq\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"tnuwjtkschgc\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"seyqrhvyeldotjv\",\"description\":\"wiswskukjtasbvw\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"dtxfkndlqvtwknvg\",\"type\":\"dateTime\",\"dataTypeHint\":\"ip\",\"displayName\":\"yw\",\"description\":\"mqaqkueatgroes\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"byfqxkfaoy\",\"type\":\"string\",\"dataTypeHint\":\"armPath\",\"displayName\":\"vjmvqmtdwckygr\",\"description\":\"jn\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"categories\":[\"skbrreqynkc\",\"ysfaqegplwrysh\"],\"labels\":[\"kvb\"],\"source\":\"customer\",\"tableType\":\"RestoredLogs\",\"tableSubType\":\"Any\",\"solutions\":[\"ptdacarvvl\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"id\":\"iwenazero\",\"name\":\"zrsq\",\"type\":\"lsxkd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.tables().listByWorkspace("upnqrmgjfb", "kuwxeoiojfizfavk", com.azure.core.util.Context.NONE); + = manager.tables().listByWorkspace("kxrerlniylylyfwx", "utgqztwh", com.azure.core.util.Context.NONE); - Assertions.assertEquals(143517524, response.iterator().next().retentionInDays()); - Assertions.assertEquals(1172309322, response.iterator().next().totalRetentionInDays()); - Assertions.assertEquals("mmfz", response.iterator().next().searchResults().query()); - Assertions.assertEquals("fwxrzxmdew", response.iterator().next().searchResults().description()); - Assertions.assertEquals(1373177035, response.iterator().next().searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T22:50:05Z"), + Assertions.assertEquals(1986729733, response.iterator().next().retentionInDays()); + Assertions.assertEquals(260996663, response.iterator().next().totalRetentionInDays()); + Assertions.assertEquals("cdxa", response.iterator().next().searchResults().query()); + Assertions.assertEquals("u", response.iterator().next().searchResults().description()); + Assertions.assertEquals(2063766495, response.iterator().next().searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-26T08:46Z"), response.iterator().next().searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-08T17:25:29Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-09T20:53:20Z"), response.iterator().next().searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T14:34:31Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-21T23:27:57Z"), response.iterator().next().restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T13:49:23Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T23:37:33Z"), response.iterator().next().restoredLogs().endRestoreTime()); - Assertions.assertEquals("jxsqwjhqkbiwetp", response.iterator().next().restoredLogs().sourceTable()); + Assertions.assertEquals("hgookrtalvnbwgpb", response.iterator().next().restoredLogs().sourceTable()); Assertions.assertEquals(TablePlanEnum.BASIC, response.iterator().next().plan()); - Assertions.assertEquals("zkkdtnhqs", response.iterator().next().schema().name()); - Assertions.assertEquals("ljselp", response.iterator().next().schema().displayName()); - Assertions.assertEquals("bafvafhlbylcc", response.iterator().next().schema().description()); - Assertions.assertEquals("rhyzdf", response.iterator().next().schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.REAL, response.iterator().next().schema().columns().get(0).type()); + Assertions.assertEquals("nvzoqgyipemch", response.iterator().next().schema().name()); + Assertions.assertEquals("v", response.iterator().next().schema().displayName()); + Assertions.assertEquals("zuejd", response.iterator().next().schema().description()); + Assertions.assertEquals("lghwzhome", response.iterator().next().schema().columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.STRING, response.iterator().next().schema().columns().get(0).type()); Assertions.assertEquals(ColumnDataTypeHintEnum.URI, response.iterator().next().schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("ltdb", response.iterator().next().schema().columns().get(0).displayName()); - Assertions.assertEquals("irrhv", response.iterator().next().schema().columns().get(0).description()); + Assertions.assertEquals("iuh", response.iterator().next().schema().columns().get(0).displayName()); + Assertions.assertEquals("wmoaiancznvodrrs", response.iterator().next().schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java index fd41a98a5f76..7c2eff2f4ce6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java @@ -20,94 +20,79 @@ public final class TablesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TablesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"retentionInDays\":1152356837,\"totalRetentionInDays\":230467636,\"archiveRetentionInDays\":1993035285,\"searchResults\":{\"query\":\"fmviklby\",\"description\":\"khbejdznxc\",\"limit\":2045200930,\"startSearchTime\":\"2021-03-13T18:49:59Z\",\"endSearchTime\":\"2020-12-24T21:57:15Z\",\"sourceTable\":\"volvtn\",\"azureAsyncOperationId\":\"qfzgemjdftul\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-05T22:04:39Z\",\"endRestoreTime\":\"2021-04-12T02:20:30Z\",\"sourceTable\":\"amtmcz\",\"azureAsyncOperationId\":\"m\"},\"resultStatistics\":{\"progress\":45.98984,\"ingestedRecords\":1157846345,\"scannedGb\":57.057808},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"ssxmojms\",\"schema\":{\"name\":\"jpr\",\"displayName\":\"wcfzqljyxgt\",\"description\":\"heyd\",\"columns\":[{},{},{},{}],\"standardColumns\":[{},{},{}],\"categories\":[\"xmaehvbbxu\"],\"labels\":[\"ltfnhtbaxkgx\",\"wrck\",\"yklyhpluodpvruud\"],\"source\":\"microsoft\",\"tableType\":\"Microsoft\",\"tableSubType\":\"Classic\",\"solutions\":[\"tgk\",\"stvdxeclz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true},\"systemData\":{\"createdBy\":\"h\",\"createdByType\":\"ManagedIdentity\",\"createdAt\":\"2021-07-07T17:09:43Z\",\"lastModifiedBy\":\"dlwwqfbumlkxt\",\"lastModifiedByType\":\"Key\",\"lastModifiedAt\":\"2021-08-10T18:01:13Z\"},\"id\":\"mlmbtxhwgfwsrta\",\"name\":\"coezbrhubskh\",\"type\":\"dyg\"},{\"properties\":{\"retentionInDays\":328293320,\"totalRetentionInDays\":1039197688,\"archiveRetentionInDays\":870237510,\"searchResults\":{\"query\":\"vleo\",\"description\":\"ml\",\"limit\":16475569,\"startSearchTime\":\"2021-06-03T05:33:27Z\",\"endSearchTime\":\"2021-06-07T14:08:39Z\",\"sourceTable\":\"vyvnqqyb\",\"azureAsyncOperationId\":\"yeua\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-05-25T11:37:10Z\",\"endRestoreTime\":\"2021-04-19T19:49:12Z\",\"sourceTable\":\"gzslesjcbhernnti\",\"azureAsyncOperationId\":\"djc\"},\"resultStatistics\":{\"progress\":67.018715,\"ingestedRecords\":584080581,\"scannedGb\":39.08969},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"gohbuffkmrq\",\"schema\":{\"name\":\"vhmxtdrjfu\",\"displayName\":\"coebjvewzcj\",\"description\":\"m\",\"columns\":[{},{},{},{}],\"standardColumns\":[{},{},{},{}],\"categories\":[\"adraufactkahzo\",\"ajjziuxxpshne\",\"kulfg\",\"lqubkwdlen\"],\"labels\":[\"utujba\",\"pjuohminyfl\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"DataCollectionRuleBased\",\"solutions\":[\"pklvxw\",\"ygdxpgpqchis\"]},\"provisioningState\":\"InProgress\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true},\"systemData\":{\"createdBy\":\"xgibbda\",\"createdByType\":\"User\",\"createdAt\":\"2021-04-14T22:25:17Z\",\"lastModifiedBy\":\"zauorsuk\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-09-20T10:27:45Z\"},\"id\":\"plhlvnuuepzlrp\",\"name\":\"wzsoldweyuqdunv\",\"type\":\"nnrwrbiork\"},{\"properties\":{\"retentionInDays\":476504183,\"totalRetentionInDays\":681185824,\"archiveRetentionInDays\":1038080670,\"searchResults\":{\"query\":\"nhxmsi\",\"description\":\"omi\",\"limit\":1723847557,\"startSearchTime\":\"2021-10-29T08:24:04Z\",\"endSearchTime\":\"2021-01-25T20:05:05Z\",\"sourceTable\":\"iqndieuzaofj\",\"azureAsyncOperationId\":\"vcyy\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-05-03T11:29:59Z\",\"endRestoreTime\":\"2021-05-09T21:38:39Z\",\"sourceTable\":\"cubiipuipw\",\"azureAsyncOperationId\":\"onmacjekniz\"},\"resultStatistics\":{\"progress\":38.670307,\"ingestedRecords\":1591499316,\"scannedGb\":21.702797},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"gmblrri\",\"schema\":{\"name\":\"wdxsm\",\"displayName\":\"cwrwfs\",\"description\":\"fnynszqujizdvoqy\",\"columns\":[{},{},{},{}],\"standardColumns\":[{}],\"categories\":[\"blgyavutpthj\",\"xoi\",\"msksbp\"],\"labels\":[\"qolj\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"ffgcvizqz\",\"wlvwlyoupf\",\"fbkjubdyhgkfmi\"]},\"provisioningState\":\"Updating\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"sttktlahbqa\",\"createdByType\":\"Key\",\"createdAt\":\"2021-10-13T12:53:05Z\",\"lastModifiedBy\":\"ukxit\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-06-28T23:57:13Z\"},\"id\":\"qqqxhrnxrx\",\"name\":\"pjui\",\"type\":\"av\"}]}") + "{\"value\":[{\"properties\":{\"retentionInDays\":288092317,\"totalRetentionInDays\":1703781779,\"archiveRetentionInDays\":995419481,\"searchResults\":{\"query\":\"bwwift\",\"description\":\"qkvpuvksgplsakn\",\"limit\":792282663,\"startSearchTime\":\"2021-08-07T07:41:08Z\",\"endSearchTime\":\"2021-04-07T05:17:19Z\",\"sourceTable\":\"ph\",\"azureAsyncOperationId\":\"pxodlqiyntorzih\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-07-03T10:26:48Z\",\"endRestoreTime\":\"2021-08-13T08:44:45Z\",\"sourceTable\":\"srmslyzr\",\"azureAsyncOperationId\":\"bchckqqzqio\"},\"resultStatistics\":{\"progress\":77.20928,\"ingestedRecords\":1721034864,\"scannedGb\":44.14792},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"edyatrwyhqmibzyh\",\"schema\":{\"name\":\"smypyynpc\",\"displayName\":\"umnzgmwznmabik\",\"description\":\"orgjhxbldt\",\"columns\":[{},{}],\"standardColumns\":[{},{},{},{}],\"categories\":[\"m\",\"ncvokotllxdyhg\"],\"labels\":[\"cogjltdtbn\",\"hadoocrk\"],\"source\":\"customer\",\"tableType\":\"RestoredLogs\",\"tableSubType\":\"DataCollectionRuleBased\",\"solutions\":[\"mqg\",\"qqu\",\"zikywgg\",\"kallatmel\"]},\"provisioningState\":\"InProgress\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":true},\"id\":\"zkzivgvvcnay\",\"name\":\"hyrnxxmu\",\"type\":\"edndr\"},{\"properties\":{\"retentionInDays\":817024636,\"totalRetentionInDays\":467483193,\"archiveRetentionInDays\":768624981,\"searchResults\":{\"query\":\"healmfmtda\",\"description\":\"gdv\",\"limit\":1689077175,\"startSearchTime\":\"2021-06-05T03:50:49Z\",\"endSearchTime\":\"2021-10-30T10:52:42Z\",\"sourceTable\":\"wxrt\",\"azureAsyncOperationId\":\"dxepxgyq\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-27T06:03:21Z\",\"endRestoreTime\":\"2020-12-28T18:07:39Z\",\"sourceTable\":\"pkukghi\",\"azureAsyncOperationId\":\"blxgwimf\"},\"resultStatistics\":{\"progress\":41.899403,\"ingestedRecords\":510557599,\"scannedGb\":39.004253},\"plan\":\"Auxiliary\",\"lastPlanModifiedDate\":\"kfoqreyfkzikfj\",\"schema\":{\"name\":\"eaivxwczel\",\"displayName\":\"irels\",\"description\":\"aenwabf\",\"columns\":[{}],\"standardColumns\":[{},{},{},{}],\"categories\":[\"bjhwuaan\",\"zjosp\",\"youlp\",\"rvxaglrvimjwosy\"],\"labels\":[\"tcs\"],\"source\":\"customer\",\"tableType\":\"Microsoft\",\"tableSubType\":\"Classic\",\"solutions\":[\"ekkezzikhlyfjh\",\"gqggebdunygae\"]},\"provisioningState\":\"Updating\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"id\":\"pxllrx\",\"name\":\"yjmoadsu\",\"type\":\"arm\"}]}") .toObject(TablesListResult.class); - Assertions.assertEquals(1152356837, model.value().get(0).retentionInDays()); - Assertions.assertEquals(230467636, model.value().get(0).totalRetentionInDays()); - Assertions.assertEquals("fmviklby", model.value().get(0).searchResults().query()); - Assertions.assertEquals("khbejdznxc", model.value().get(0).searchResults().description()); - Assertions.assertEquals(2045200930, model.value().get(0).searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T18:49:59Z"), + Assertions.assertEquals(288092317, model.value().get(0).retentionInDays()); + Assertions.assertEquals(1703781779, model.value().get(0).totalRetentionInDays()); + Assertions.assertEquals("bwwift", model.value().get(0).searchResults().query()); + Assertions.assertEquals("qkvpuvksgplsakn", model.value().get(0).searchResults().description()); + Assertions.assertEquals(792282663, model.value().get(0).searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T07:41:08Z"), model.value().get(0).searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T21:57:15Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T05:17:19Z"), model.value().get(0).searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T22:04:39Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T10:26:48Z"), model.value().get(0).restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T02:20:30Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T08:44:45Z"), model.value().get(0).restoredLogs().endRestoreTime()); - Assertions.assertEquals("amtmcz", model.value().get(0).restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.value().get(0).plan()); - Assertions.assertEquals("jpr", model.value().get(0).schema().name()); - Assertions.assertEquals("wcfzqljyxgt", model.value().get(0).schema().displayName()); - Assertions.assertEquals("heyd", model.value().get(0).schema().description()); + Assertions.assertEquals("srmslyzr", model.value().get(0).restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.BASIC, model.value().get(0).plan()); + Assertions.assertEquals("smypyynpc", model.value().get(0).schema().name()); + Assertions.assertEquals("umnzgmwznmabik", model.value().get(0).schema().displayName()); + Assertions.assertEquals("orgjhxbldt", model.value().get(0).schema().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TablesListResult model = new TablesListResult().withValue(Arrays.asList( - new TableInner().withRetentionInDays(1152356837) - .withTotalRetentionInDays(230467636) - .withSearchResults(new SearchResults().withQuery("fmviklby") - .withDescription("khbejdznxc") - .withLimit(2045200930) - .withStartSearchTime(OffsetDateTime.parse("2021-03-13T18:49:59Z")) - .withEndSearchTime(OffsetDateTime.parse("2020-12-24T21:57:15Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-11-05T22:04:39Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-04-12T02:20:30Z")) - .withSourceTable("amtmcz")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("jpr") - .withDisplayName("wcfzqljyxgt") - .withDescription("heyd") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))), - new TableInner().withRetentionInDays(328293320) - .withTotalRetentionInDays(1039197688) - .withSearchResults(new SearchResults().withQuery("vleo") - .withDescription("ml") - .withLimit(16475569) - .withStartSearchTime(OffsetDateTime.parse("2021-06-03T05:33:27Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-06-07T14:08:39Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-05-25T11:37:10Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-04-19T19:49:12Z")) - .withSourceTable("gzslesjcbhernnti")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("vhmxtdrjfu") - .withDisplayName("coebjvewzcj") - .withDescription("m") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))), - new TableInner().withRetentionInDays(476504183) - .withTotalRetentionInDays(681185824) - .withSearchResults(new SearchResults().withQuery("nhxmsi") - .withDescription("omi") - .withLimit(1723847557) - .withStartSearchTime(OffsetDateTime.parse("2021-10-29T08:24:04Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-01-25T20:05:05Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-05-03T11:29:59Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-05-09T21:38:39Z")) - .withSourceTable("cubiipuipw")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("wdxsm") - .withDisplayName("cwrwfs") - .withDescription("fnynszqujizdvoqy") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))))); + new TableInner().withRetentionInDays(288092317) + .withTotalRetentionInDays(1703781779) + .withSearchResults(new SearchResults().withQuery("bwwift") + .withDescription("qkvpuvksgplsakn") + .withLimit(792282663) + .withStartSearchTime(OffsetDateTime.parse("2021-08-07T07:41:08Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-04-07T05:17:19Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-03T10:26:48Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-08-13T08:44:45Z")) + .withSourceTable("srmslyzr")) + .withPlan(TablePlanEnum.BASIC) + .withSchema(new Schema().withName("smypyynpc") + .withDisplayName("umnzgmwznmabik") + .withDescription("orgjhxbldt") + .withColumns(Arrays.asList(new Column(), new Column()))), + new TableInner().withRetentionInDays(817024636) + .withTotalRetentionInDays(467483193) + .withSearchResults(new SearchResults().withQuery("healmfmtda") + .withDescription("gdv") + .withLimit(1689077175) + .withStartSearchTime(OffsetDateTime.parse("2021-06-05T03:50:49Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-10-30T10:52:42Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-11-27T06:03:21Z")) + .withEndRestoreTime(OffsetDateTime.parse("2020-12-28T18:07:39Z")) + .withSourceTable("pkukghi")) + .withPlan(TablePlanEnum.AUXILIARY) + .withSchema(new Schema().withName("eaivxwczel") + .withDisplayName("irels") + .withDescription("aenwabf") + .withColumns(Arrays.asList(new Column()))))); model = BinaryData.fromObject(model).toObject(TablesListResult.class); - Assertions.assertEquals(1152356837, model.value().get(0).retentionInDays()); - Assertions.assertEquals(230467636, model.value().get(0).totalRetentionInDays()); - Assertions.assertEquals("fmviklby", model.value().get(0).searchResults().query()); - Assertions.assertEquals("khbejdznxc", model.value().get(0).searchResults().description()); - Assertions.assertEquals(2045200930, model.value().get(0).searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T18:49:59Z"), + Assertions.assertEquals(288092317, model.value().get(0).retentionInDays()); + Assertions.assertEquals(1703781779, model.value().get(0).totalRetentionInDays()); + Assertions.assertEquals("bwwift", model.value().get(0).searchResults().query()); + Assertions.assertEquals("qkvpuvksgplsakn", model.value().get(0).searchResults().description()); + Assertions.assertEquals(792282663, model.value().get(0).searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T07:41:08Z"), model.value().get(0).searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T21:57:15Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T05:17:19Z"), model.value().get(0).searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T22:04:39Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T10:26:48Z"), model.value().get(0).restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T02:20:30Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T08:44:45Z"), model.value().get(0).restoredLogs().endRestoreTime()); - Assertions.assertEquals("amtmcz", model.value().get(0).restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.value().get(0).plan()); - Assertions.assertEquals("jpr", model.value().get(0).schema().name()); - Assertions.assertEquals("wcfzqljyxgt", model.value().get(0).schema().displayName()); - Assertions.assertEquals("heyd", model.value().get(0).schema().description()); + Assertions.assertEquals("srmslyzr", model.value().get(0).restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.BASIC, model.value().get(0).plan()); + Assertions.assertEquals("smypyynpc", model.value().get(0).schema().name()); + Assertions.assertEquals("umnzgmwznmabik", model.value().get(0).schema().displayName()); + Assertions.assertEquals("orgjhxbldt", model.value().get(0).schema().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java index 3872b158eb39..684c8b69cd1c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testMigrateWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.tables().migrateWithResponse("sl", "bnsmjkwynqxaek", "sykvwjtqpke", com.azure.core.util.Context.NONE); + manager.tables().migrateWithResponse("g", "uuj", "ouhdawsigrb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java index af7fd1879930..273d2dc25289 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java @@ -11,17 +11,16 @@ public final class TagTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Tag model - = BinaryData.fromString("{\"name\":\"fiwjmygtdssls\",\"value\":\"tmweriofzpyq\"}").toObject(Tag.class); - Assertions.assertEquals("fiwjmygtdssls", model.name()); - Assertions.assertEquals("tmweriofzpyq", model.value()); + Tag model = BinaryData.fromString("{\"name\":\"qeqxo\",\"value\":\"z\"}").toObject(Tag.class); + Assertions.assertEquals("qeqxo", model.name()); + Assertions.assertEquals("z", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Tag model = new Tag().withName("fiwjmygtdssls").withValue("tmweriofzpyq"); + Tag model = new Tag().withName("qeqxo").withValue("z"); model = BinaryData.fromObject(model).toObject(Tag.class); - Assertions.assertEquals("fiwjmygtdssls", model.name()); - Assertions.assertEquals("tmweriofzpyq", model.value()); + Assertions.assertEquals("qeqxo", model.name()); + Assertions.assertEquals("z", model.value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java index cb53b4fa5d85..b1800956571d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java @@ -13,18 +13,19 @@ public final class TagsResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagsResource model = BinaryData.fromString( - "{\"tags\":{\"jakhmsbzjh\":\"fdfdosygexpa\",\"hqtrgqjbpf\":\"rzevdphlxaol\",\"tfell\":\"fsinzgvfcjrwzoxx\",\"lxofpdvhpfxxypin\":\"wfzitonpeqfpjk\"}}") + TagsResource model = BinaryData + .fromString( + "{\"tags\":{\"fhzovawjvzunluth\":\"vu\",\"rnxipei\":\"n\",\"e\":\"pjzu\",\"kzbbtd\":\"xdult\"}}") .toObject(TagsResource.class); - Assertions.assertEquals("fdfdosygexpa", model.tags().get("jakhmsbzjh")); + Assertions.assertEquals("vu", model.tags().get("fhzovawjvzunluth")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagsResource model = new TagsResource().withTags(mapOf("jakhmsbzjh", "fdfdosygexpa", "hqtrgqjbpf", - "rzevdphlxaol", "tfell", "fsinzgvfcjrwzoxx", "lxofpdvhpfxxypin", "wfzitonpeqfpjk")); + TagsResource model = new TagsResource() + .withTags(mapOf("fhzovawjvzunluth", "vu", "rnxipei", "n", "e", "pjzu", "kzbbtd", "xdult")); model = BinaryData.fromObject(model).toObject(TagsResource.class); - Assertions.assertEquals("fdfdosygexpa", model.tags().get("jakhmsbzjh")); + Assertions.assertEquals("vu", model.tags().get("fhzovawjvzunluth")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java index fa04531153b7..b9f09fd2a085 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java @@ -14,33 +14,33 @@ public final class UsageMetricInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UsageMetricInner model = BinaryData.fromString( - "{\"name\":{\"value\":\"yjsflhhcaalnji\",\"localizedValue\":\"sxyawjoyaqcs\"},\"unit\":\"jpkiidzyexznelix\",\"currentValue\":16.42737179588487,\"limit\":65.0090874045316,\"nextResetTime\":\"2021-01-11T05:27:37Z\",\"quotaPeriod\":\"nxknalaulp\"}") + "{\"name\":{\"value\":\"hmtnvy\",\"localizedValue\":\"atkzwpcnpw\"},\"unit\":\"jaesgvvsccya\",\"currentValue\":7.14281993849214,\"limit\":21.496629598428008,\"nextResetTime\":\"2021-07-19T23:39:28Z\",\"quotaPeriod\":\"lvdnkfx\"}") .toObject(UsageMetricInner.class); - Assertions.assertEquals("yjsflhhcaalnji", model.name().value()); - Assertions.assertEquals("sxyawjoyaqcs", model.name().localizedValue()); - Assertions.assertEquals("jpkiidzyexznelix", model.unit()); - Assertions.assertEquals(16.42737179588487D, model.currentValue()); - Assertions.assertEquals(65.0090874045316D, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T05:27:37Z"), model.nextResetTime()); - Assertions.assertEquals("nxknalaulp", model.quotaPeriod()); + Assertions.assertEquals("hmtnvy", model.name().value()); + Assertions.assertEquals("atkzwpcnpw", model.name().localizedValue()); + Assertions.assertEquals("jaesgvvsccya", model.unit()); + Assertions.assertEquals(7.14281993849214D, model.currentValue()); + Assertions.assertEquals(21.496629598428008D, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T23:39:28Z"), model.nextResetTime()); + Assertions.assertEquals("lvdnkfx", model.quotaPeriod()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UsageMetricInner model = new UsageMetricInner() - .withName(new MetricName().withValue("yjsflhhcaalnji").withLocalizedValue("sxyawjoyaqcs")) - .withUnit("jpkiidzyexznelix") - .withCurrentValue(16.42737179588487D) - .withLimit(65.0090874045316D) - .withNextResetTime(OffsetDateTime.parse("2021-01-11T05:27:37Z")) - .withQuotaPeriod("nxknalaulp"); + UsageMetricInner model + = new UsageMetricInner().withName(new MetricName().withValue("hmtnvy").withLocalizedValue("atkzwpcnpw")) + .withUnit("jaesgvvsccya") + .withCurrentValue(7.14281993849214D) + .withLimit(21.496629598428008D) + .withNextResetTime(OffsetDateTime.parse("2021-07-19T23:39:28Z")) + .withQuotaPeriod("lvdnkfx"); model = BinaryData.fromObject(model).toObject(UsageMetricInner.class); - Assertions.assertEquals("yjsflhhcaalnji", model.name().value()); - Assertions.assertEquals("sxyawjoyaqcs", model.name().localizedValue()); - Assertions.assertEquals("jpkiidzyexznelix", model.unit()); - Assertions.assertEquals(16.42737179588487D, model.currentValue()); - Assertions.assertEquals(65.0090874045316D, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T05:27:37Z"), model.nextResetTime()); - Assertions.assertEquals("nxknalaulp", model.quotaPeriod()); + Assertions.assertEquals("hmtnvy", model.name().value()); + Assertions.assertEquals("atkzwpcnpw", model.name().localizedValue()); + Assertions.assertEquals("jaesgvvsccya", model.unit()); + Assertions.assertEquals(7.14281993849214D, model.currentValue()); + Assertions.assertEquals(21.496629598428008D, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T23:39:28Z"), model.nextResetTime()); + Assertions.assertEquals("lvdnkfx", model.quotaPeriod()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java index b9d7b5598b38..22c9edcecbae 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.UsageMetric; @@ -22,25 +22,25 @@ public final class UsagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":{\"value\":\"gtuhxuicbu\",\"localizedValue\":\"mr\"},\"unit\":\"njlx\",\"currentValue\":33.720955848019294,\"limit\":33.504071266925294,\"nextResetTime\":\"2021-07-24T18:32:54Z\",\"quotaPeriod\":\"baqehgpdoh\"}]}"; + = "{\"value\":[{\"name\":{\"value\":\"yshtuwgmev\",\"localizedValue\":\"fpwzyifrkgwltx\"},\"unit\":\"ipxgzdy\",\"currentValue\":99.77270946016633,\"limit\":29.475698926269988,\"nextResetTime\":\"2021-07-01T11:25:11Z\",\"quotaPeriod\":\"avkjog\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.usages().list("vuwkasiziesfuugh", "uqfecj", com.azure.core.util.Context.NONE); + = manager.usages().list("hmx", "fdsajred", com.azure.core.util.Context.NONE); - Assertions.assertEquals("gtuhxuicbu", response.iterator().next().name().value()); - Assertions.assertEquals("mr", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("njlx", response.iterator().next().unit()); - Assertions.assertEquals(33.720955848019294D, response.iterator().next().currentValue()); - Assertions.assertEquals(33.504071266925294D, response.iterator().next().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-24T18:32:54Z"), + Assertions.assertEquals("yshtuwgmev", response.iterator().next().name().value()); + Assertions.assertEquals("fpwzyifrkgwltx", response.iterator().next().name().localizedValue()); + Assertions.assertEquals("ipxgzdy", response.iterator().next().unit()); + Assertions.assertEquals(99.77270946016633D, response.iterator().next().currentValue()); + Assertions.assertEquals(29.475698926269988D, response.iterator().next().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T11:25:11Z"), response.iterator().next().nextResetTime()); - Assertions.assertEquals("baqehgpdoh", response.iterator().next().quotaPeriod()); + Assertions.assertEquals("avkjog", response.iterator().next().quotaPeriod()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java index 7fa169399014..749bf07a5750 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java @@ -11,7 +11,7 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"9a09bc28-de09-4353-9fc8-db8f188d440e\",\"clientId\":\"2a023bcc-682d-4e62-8c52-90b378bd07e0\"}") + "{\"principalId\":\"b09c35db-be66-4e95-8498-f542f93b2515\",\"clientId\":\"e882c946-e84d-4658-abe8-71db0e3cfdfc\"}") .toObject(UserAssignedIdentity.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java index 848bc06680c5..159cb494681f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java @@ -10,8 +10,9 @@ public final class UserIdentityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserIdentityProperties model = BinaryData.fromString("{\"principalId\":\"ithtywu\",\"clientId\":\"cbihwqk\"}") - .toObject(UserIdentityProperties.class); + UserIdentityProperties model + = BinaryData.fromString("{\"principalId\":\"ozauorsukokwb\",\"clientId\":\"lhlv\"}") + .toObject(UserIdentityProperties.class); } @org.junit.jupiter.api.Test diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java index f30f22bd72ac..1c6d3ad017b3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java @@ -12,15 +12,15 @@ public final class WorkspaceCappingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceCapping model = BinaryData.fromString( - "{\"dailyQuotaGb\":30.97995124606966,\"quotaNextResetTime\":\"nqttezl\",\"dataIngestionStatus\":\"OverQuota\"}") + "{\"dailyQuotaGb\":87.67426402803734,\"quotaNextResetTime\":\"qtqzfavyv\",\"dataIngestionStatus\":\"RespectQuota\"}") .toObject(WorkspaceCapping.class); - Assertions.assertEquals(30.97995124606966D, model.dailyQuotaGb()); + Assertions.assertEquals(87.67426402803734D, model.dailyQuotaGb()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceCapping model = new WorkspaceCapping().withDailyQuotaGb(30.97995124606966D); + WorkspaceCapping model = new WorkspaceCapping().withDailyQuotaGb(87.67426402803734D); model = BinaryData.fromObject(model).toObject(WorkspaceCapping.class); - Assertions.assertEquals(30.97995124606966D, model.dailyQuotaGb()); + Assertions.assertEquals(87.67426402803734D, model.dailyQuotaGb()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFailoverPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFailoverPropertiesTests.java new file mode 100644 index 000000000000..156ca6ac7ba2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFailoverPropertiesTests.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.BinaryData; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; + +public final class WorkspaceFailoverPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceFailoverProperties model + = BinaryData.fromString("{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-10-19T23:18:49Z\"}") + .toObject(WorkspaceFailoverProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceFailoverProperties model = new WorkspaceFailoverProperties(); + model = BinaryData.fromObject(model).toObject(WorkspaceFailoverProperties.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java index a9e3443e9578..2f695f282279 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java @@ -5,6 +5,8 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import java.util.HashMap; import java.util.Map; @@ -14,29 +16,33 @@ public final class WorkspaceFeaturesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceFeatures model = BinaryData.fromString( - "{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"wau\",\"disableLocalAuth\":false,\"\":{\"pevzhfst\":\"datagupkvipmdscwxq\",\"pelmcuvhixbjxyf\":\"datatxhojujb\"}}") + "{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"jcbhern\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"cv\"],\"ehwagoh\":\"datawr\",\"xtdr\":\"datauffkmrqemvvh\",\"znmwcp\":\"datafutacoebjvewzc\"}") .toObject(WorkspaceFeatures.class); - Assertions.assertEquals(false, model.enableDataExport()); - Assertions.assertEquals(false, model.immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wau", model.clusterResourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); + Assertions.assertTrue(model.enableDataExport()); + Assertions.assertTrue(model.immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("jcbhern", model.clusterResourceId()); + Assertions.assertFalse(model.disableLocalAuth()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceFeatures model = new WorkspaceFeatures().withEnableDataExport(false) - .withImmediatePurgeDataOn30Days(false) + WorkspaceFeatures model = new WorkspaceFeatures().withEnableDataExport(true) + .withImmediatePurgeDataOn30Days(true) .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("wau") + .withClusterResourceId("jcbhern") .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf()); + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"cv\"]", Object.class, SerializerEncoding.JSON), + "xtdr", "datauffkmrqemvvh", "ehwagoh", "datawr", "znmwcp", "datafutacoebjvewzc", + "unifiedSentinelBillingOnly", false)); model = BinaryData.fromObject(model).toObject(WorkspaceFeatures.class); - Assertions.assertEquals(false, model.enableDataExport()); - Assertions.assertEquals(false, model.immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wau", model.clusterResourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); + Assertions.assertTrue(model.enableDataExport()); + Assertions.assertTrue(model.immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("jcbhern", model.clusterResourceId()); + Assertions.assertFalse(model.disableLocalAuth()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java index 78bf785bc5b7..12632a0568a3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java @@ -5,14 +5,17 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.HashMap; @@ -23,67 +26,75 @@ public final class WorkspaceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"customerId\":\"jylwbtlhflsj\",\"sku\":{\"name\":\"PerNode\",\"capacityReservationLevel\":500,\"lastSkuUpdate\":\"jvfbgofelja\"},\"retentionInDays\":728576378,\"workspaceCapping\":{\"dailyQuotaGb\":44.315075801765715,\"quotaNextResetTime\":\"vriiio\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"ghfkvtvsexs\",\"modifiedDate\":\"ueluqhhahhxvrhmz\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"ghftqsxhqxujxuk\",\"scopeId\":\"xdigrjg\"},{\"resourceId\":\"fzdm\",\"scopeId\":\"qtfihwhbotzinga\"},{\"resourceId\":\"pph\",\"scopeId\":\"zqzudph\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"nwcvtbvkayhmtnv\",\"disableLocalAuth\":true,\"\":{\"cjaesgvvs\":\"datakzwpcnpw\",\"wygzlvdnkfxusem\":\"datacyajguqf\",\"pfcqdp\":\"datawzrmuh\"}},\"defaultDataCollectionRuleResourceId\":\"xqv\"},\"identity\":{\"principalId\":\"uoymgccelvezry\",\"tenantId\":\"lmfeokerq\",\"type\":\"managedIdentity\",\"userAssignedIdentities\":{\"pbqpcrfkbwccsn\":{\"principalId\":\"ob\",\"clientId\":\"gxedkow\"},\"y\":{\"principalId\":\"cdwxlpq\",\"clientId\":\"ftnkhtj\"},\"ywkbirryuzhlhkjo\":{\"principalId\":\"gwfqatmt\",\"clientId\":\"tmdvypgikdgs\"}}},\"systemData\":{\"createdBy\":\"qqaatjinrvgou\",\"createdByType\":\"Key\",\"createdAt\":\"2021-11-16T07:49:22Z\",\"lastModifiedBy\":\"fggjioolvr\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-10-02T02:42:21Z\"},\"etag\":\"k\",\"location\":\"llqwjygvjayvblmh\",\"tags\":{\"gsopbyrqufegxu\":\"uhbxvvy\",\"bnhlmc\":\"wz\",\"dn\":\"l\",\"ijejvegrhbpn\":\"itvgbmhrixkwm\"},\"id\":\"ixexcc\",\"name\":\"dreaxh\",\"type\":\"exdrrvqahqkg\"}") + "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"gthrrghxjbdhq\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":441101019,\"lastSkuUpdate\":\"2021-08-03T04:18:25Z\"},\"retentionInDays\":469495787,\"workspaceCapping\":{\"dailyQuotaGb\":81.1170037569868,\"quotaNextResetTime\":\"hrnsvbu\",\"dataIngestionStatus\":\"SubscriptionSuspended\"},\"createdDate\":\"2021-09-08T03:32:01Z\",\"modifiedDate\":\"2021-07-28T13:53:22Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"rtkfawnopq\",\"scopeId\":\"kyzirtxdyux\"},{\"resourceId\":\"jntpsewgioilqu\",\"scopeId\":\"ydxtqm\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"f\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"ghhavgrvkffo\",\"jzhpjbibgjmfx\",\"mv\"],\"nbkfezzxscy\":\"datauyovw\",\"vzzbtdcq\":\"datawzdgirujbzbo\",\"dshf\":\"datapniyujviyl\",\"fmwncotmrfh\":\"datasnrbgyefrymsgao\"},\"defaultDataCollectionRuleResourceId\":\"ctymoxoftp\",\"replication\":{\"location\":\"wycz\",\"enabled\":false,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-11-29T08:27:09Z\",\"lastModifiedDate\":\"2021-01-05T07:46:41Z\"},\"failover\":{\"state\":\"Inactive\",\"lastModifiedDate\":\"2021-07-16T17:01:10Z\"}},\"identity\":{\"principalId\":\"skasdvlmfwdgzxu\",\"tenantId\":\"cvpa\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"jn\":{\"principalId\":\"uzvx\",\"clientId\":\"i\"},\"cesutrgjupauut\":{\"principalId\":\"ytxifqjzgxmrh\",\"clientId\":\"lw\"},\"pnfqntcyp\":{\"principalId\":\"oqh\",\"clientId\":\"ejqgw\"}}},\"etag\":\"vfoimwksli\",\"location\":\"cizjxvydfceacvl\",\"tags\":{\"jslb\":\"gdyftumrtwna\",\"aeqphchqnr\":\"wkojgcyztsfmzn\",\"wrykqgai\":\"rpxeh\"},\"id\":\"mvikl\",\"name\":\"ydv\",\"type\":\"hbejdznxcvdsrhnj\"}") .toObject(WorkspaceInner.class); - Assertions.assertEquals("llqwjygvjayvblmh", model.location()); - Assertions.assertEquals("uhbxvvy", model.tags().get("gsopbyrqufegxu")); - Assertions.assertEquals(IdentityType.MANAGED_IDENTITY, model.identity().type()); - Assertions.assertEquals("k", model.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(728576378, model.retentionInDays()); - Assertions.assertEquals(44.315075801765715D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals("cizjxvydfceacvl", model.location()); + Assertions.assertEquals("gdyftumrtwna", model.tags().get("jslb")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("vfoimwksli", model.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); + Assertions.assertEquals(441101019, model.sku().capacityReservationLevel()); + Assertions.assertEquals(469495787, model.retentionInDays()); + Assertions.assertEquals(81.1170037569868D, model.workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(false, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("nwcvtbvkayhmtnv", model.features().clusterResourceId()); - Assertions.assertEquals(true, model.features().disableLocalAuth()); - Assertions.assertEquals("xqv", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("f", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("ctymoxoftp", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("wycz", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceInner model = new WorkspaceInner().withLocation("llqwjygvjayvblmh") - .withTags(mapOf("gsopbyrqufegxu", "uhbxvvy", "bnhlmc", "wz", "dn", "l", "ijejvegrhbpn", "itvgbmhrixkwm")) - .withIdentity(new Identity().withType(IdentityType.MANAGED_IDENTITY) - .withUserAssignedIdentities(mapOf("pbqpcrfkbwccsn", new UserIdentityProperties(), "y", - new UserIdentityProperties(), "ywkbirryuzhlhkjo", new UserIdentityProperties()))) - .withEtag("k") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_NODE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO)) - .withRetentionInDays(728576378) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(44.315075801765715D)) + WorkspaceInner model = new WorkspaceInner().withLocation("cizjxvydfceacvl") + .withTags(mapOf("jslb", "gdyftumrtwna", "aeqphchqnr", "wkojgcyztsfmzn", "wrykqgai", "rpxeh")) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("jn", new UserIdentityProperties(), "cesutrgjupauut", + new UserIdentityProperties(), "pnfqntcyp", new UserIdentityProperties()))) + .withEtag("vfoimwksli") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE).withCapacityReservationLevel(441101019)) + .withRetentionInDays(469495787) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(81.1170037569868D)) .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) .withForceCmkForQuery(true) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) .withImmediatePurgeDataOn30Days(false) .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("nwcvtbvkayhmtnv") + .withClusterResourceId("f") .withDisableLocalAuth(true) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("xqv"); + .withAdditionalProperties(mapOf("associations", JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"ghhavgrvkffo\",\"jzhpjbibgjmfx\",\"mv\"]", Object.class, SerializerEncoding.JSON), + "dshf", "datapniyujviyl", "vzzbtdcq", "datawzdgirujbzbo", "unifiedSentinelBillingOnly", false, + "nbkfezzxscy", "datauyovw", "fmwncotmrfh", "datasnrbgyefrymsgao"))) + .withDefaultDataCollectionRuleResourceId("ctymoxoftp") + .withReplication(new WorkspaceReplicationProperties().withLocation("wycz").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()); model = BinaryData.fromObject(model).toObject(WorkspaceInner.class); - Assertions.assertEquals("llqwjygvjayvblmh", model.location()); - Assertions.assertEquals("uhbxvvy", model.tags().get("gsopbyrqufegxu")); - Assertions.assertEquals(IdentityType.MANAGED_IDENTITY, model.identity().type()); - Assertions.assertEquals("k", model.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(728576378, model.retentionInDays()); - Assertions.assertEquals(44.315075801765715D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals("cizjxvydfceacvl", model.location()); + Assertions.assertEquals("gdyftumrtwna", model.tags().get("jslb")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("vfoimwksli", model.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); + Assertions.assertEquals(441101019, model.sku().capacityReservationLevel()); + Assertions.assertEquals(469495787, model.retentionInDays()); + Assertions.assertEquals(81.1170037569868D, model.workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(false, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("nwcvtbvkayhmtnv", model.features().clusterResourceId()); - Assertions.assertEquals(true, model.features().disableLocalAuth()); - Assertions.assertEquals("xqv", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("f", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("ctymoxoftp", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("wycz", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java index 951ae07adcae..ebca78d665ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java @@ -15,61 +15,45 @@ public final class WorkspaceListManagementGroupsResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceListManagementGroupsResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"serverCount\":319916389,\"isGateway\":false,\"name\":\"elmqk\",\"id\":\"ahvljuaha\",\"created\":\"2021-02-11T00:39:32Z\",\"dataReceived\":\"2021-02-06T01:31:14Z\",\"version\":\"mdua\",\"sku\":\"exq\"}},{\"properties\":{\"serverCount\":792525510,\"isGateway\":true,\"name\":\"sr\",\"id\":\"gvxp\",\"created\":\"2021-07-02T00:35:52Z\",\"dataReceived\":\"2021-02-22T15:36:44Z\",\"version\":\"fmisg\",\"sku\":\"nbbelda\"}},{\"properties\":{\"serverCount\":1782633502,\"isGateway\":true,\"name\":\"ourqhakau\",\"id\":\"shsfwxosowzxcu\",\"created\":\"2021-06-04T05:08:46Z\",\"dataReceived\":\"2020-12-22T21:46:37Z\",\"version\":\"xdje\",\"sku\":\"pucwwfvovbvme\"}},{\"properties\":{\"serverCount\":1911093580,\"isGateway\":false,\"name\":\"zceuojgjrw\",\"id\":\"eiotwmcdytdx\",\"created\":\"2021-01-14T13:52:52Z\",\"dataReceived\":\"2021-04-02T04:04:33Z\",\"version\":\"jawgqwg\",\"sku\":\"ni\"}}]}") + "{\"value\":[{\"properties\":{\"serverCount\":2119983807,\"isGateway\":true,\"name\":\"jjugwdkcglhslaz\",\"id\":\"yggdtjixh\",\"created\":\"2021-11-28T10:21:02Z\",\"dataReceived\":\"2021-03-09T09:26:42Z\",\"version\":\"wey\",\"sku\":\"menevfyexfwh\"}},{\"properties\":{\"serverCount\":148650220,\"isGateway\":false,\"name\":\"vdcsitynn\",\"id\":\"mdectehfiqscjey\",\"created\":\"2021-03-08T20:07:33Z\",\"dataReceived\":\"2021-01-16T02:36:56Z\",\"version\":\"kgqhcjrefovg\",\"sku\":\"qsl\"}}]}") .toObject(WorkspaceListManagementGroupsResult.class); - Assertions.assertEquals(319916389, model.value().get(0).serverCount()); - Assertions.assertEquals(false, model.value().get(0).isGateway()); - Assertions.assertEquals("elmqk", model.value().get(0).name()); - Assertions.assertEquals("ahvljuaha", model.value().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T00:39:32Z"), model.value().get(0).created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T01:31:14Z"), model.value().get(0).dataReceived()); - Assertions.assertEquals("mdua", model.value().get(0).version()); - Assertions.assertEquals("exq", model.value().get(0).sku()); + Assertions.assertEquals(2119983807, model.value().get(0).serverCount()); + Assertions.assertTrue(model.value().get(0).isGateway()); + Assertions.assertEquals("jjugwdkcglhslaz", model.value().get(0).name()); + Assertions.assertEquals("yggdtjixh", model.value().get(0).id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T10:21:02Z"), model.value().get(0).created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-09T09:26:42Z"), model.value().get(0).dataReceived()); + Assertions.assertEquals("wey", model.value().get(0).version()); + Assertions.assertEquals("menevfyexfwh", model.value().get(0).sku()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { WorkspaceListManagementGroupsResult model = new WorkspaceListManagementGroupsResult().withValue(Arrays.asList( - new ManagementGroupInner().withServerCount(319916389) - .withIsGateway(false) - .withName("elmqk") - .withId("ahvljuaha") - .withCreated(OffsetDateTime.parse("2021-02-11T00:39:32Z")) - .withDataReceived(OffsetDateTime.parse("2021-02-06T01:31:14Z")) - .withVersion("mdua") - .withSku("exq"), - new ManagementGroupInner().withServerCount(792525510) - .withIsGateway(true) - .withName("sr") - .withId("gvxp") - .withCreated(OffsetDateTime.parse("2021-07-02T00:35:52Z")) - .withDataReceived(OffsetDateTime.parse("2021-02-22T15:36:44Z")) - .withVersion("fmisg") - .withSku("nbbelda"), - new ManagementGroupInner().withServerCount(1782633502) + new ManagementGroupInner().withServerCount(2119983807) .withIsGateway(true) - .withName("ourqhakau") - .withId("shsfwxosowzxcu") - .withCreated(OffsetDateTime.parse("2021-06-04T05:08:46Z")) - .withDataReceived(OffsetDateTime.parse("2020-12-22T21:46:37Z")) - .withVersion("xdje") - .withSku("pucwwfvovbvme"), - new ManagementGroupInner().withServerCount(1911093580) + .withName("jjugwdkcglhslaz") + .withId("yggdtjixh") + .withCreated(OffsetDateTime.parse("2021-11-28T10:21:02Z")) + .withDataReceived(OffsetDateTime.parse("2021-03-09T09:26:42Z")) + .withVersion("wey") + .withSku("menevfyexfwh"), + new ManagementGroupInner().withServerCount(148650220) .withIsGateway(false) - .withName("zceuojgjrw") - .withId("eiotwmcdytdx") - .withCreated(OffsetDateTime.parse("2021-01-14T13:52:52Z")) - .withDataReceived(OffsetDateTime.parse("2021-04-02T04:04:33Z")) - .withVersion("jawgqwg") - .withSku("ni"))); + .withName("vdcsitynn") + .withId("mdectehfiqscjey") + .withCreated(OffsetDateTime.parse("2021-03-08T20:07:33Z")) + .withDataReceived(OffsetDateTime.parse("2021-01-16T02:36:56Z")) + .withVersion("kgqhcjrefovg") + .withSku("qsl"))); model = BinaryData.fromObject(model).toObject(WorkspaceListManagementGroupsResult.class); - Assertions.assertEquals(319916389, model.value().get(0).serverCount()); - Assertions.assertEquals(false, model.value().get(0).isGateway()); - Assertions.assertEquals("elmqk", model.value().get(0).name()); - Assertions.assertEquals("ahvljuaha", model.value().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T00:39:32Z"), model.value().get(0).created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T01:31:14Z"), model.value().get(0).dataReceived()); - Assertions.assertEquals("mdua", model.value().get(0).version()); - Assertions.assertEquals("exq", model.value().get(0).sku()); + Assertions.assertEquals(2119983807, model.value().get(0).serverCount()); + Assertions.assertTrue(model.value().get(0).isGateway()); + Assertions.assertEquals("jjugwdkcglhslaz", model.value().get(0).name()); + Assertions.assertEquals("yggdtjixh", model.value().get(0).id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T10:21:02Z"), model.value().get(0).created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-09T09:26:42Z"), model.value().get(0).dataReceived()); + Assertions.assertEquals("wey", model.value().get(0).version()); + Assertions.assertEquals("menevfyexfwh", model.value().get(0).sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java index 5b7de28373ff..733c111eac29 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java @@ -5,15 +5,18 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspaceListResult; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.Arrays; @@ -25,98 +28,107 @@ public final class WorkspaceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"customerId\":\"rvtp\",\"sku\":{\"name\":\"CapacityReservation\",\"capacityReservationLevel\":300,\"lastSkuUpdate\":\"lgkfbt\"},\"retentionInDays\":2059272755,\"workspaceCapping\":{\"dailyQuotaGb\":3.405125193957159,\"quotaNextResetTime\":\"jcntuj\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"ed\",\"modifiedDate\":\"wwa\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"foqouicybx\",\"scopeId\":\"zg\"},{\"resourceId\":\"ufoxc\",\"scopeId\":\"opidoamciodh\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"bon\",\"disableLocalAuth\":false,\"\":{\"exztvbtq\":\"dataegokdwbwhkszzcmr\",\"wtl\":\"datasfraoyzko\",\"uximerqfobw\":\"datanguxawqaldsy\"}},\"defaultDataCollectionRuleResourceId\":\"nkbykutwpfhp\"},\"identity\":{\"principalId\":\"hrskdsnfd\",\"tenantId\":\"oakgtdlmkkzev\",\"type\":\"application\",\"userAssignedIdentities\":{\"m\":{\"principalId\":\"pusdstt\",\"clientId\":\"ogvbbejdcngq\"},\"grtwae\":{\"principalId\":\"kufgmj\",\"clientId\":\"wr\"},\"efozbhdms\":{\"principalId\":\"uzkopbminrfd\",\"clientId\":\"yuhhziu\"},\"z\":{\"principalId\":\"mzqhoftrmaequi\",\"clientId\":\"xicslfao\"}}},\"systemData\":{\"createdBy\":\"ylhalnswhcc\",\"createdByType\":\"User\",\"createdAt\":\"2021-06-09T09:48:38Z\",\"lastModifiedBy\":\"vwitqscyw\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-02-13T16:07:26Z\"},\"etag\":\"uhczbwemh\",\"location\":\"i\",\"tags\":{\"w\":\"rgzdwmsweyp\"},\"id\":\"xggicccnxqhuexmk\",\"name\":\"tlstvlzywem\",\"type\":\"zrncsdt\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"ypbsfgytguslfead\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":500,\"lastSkuUpdate\":\"yhejhzisxgfp\"},\"retentionInDays\":1351567723,\"workspaceCapping\":{\"dailyQuotaGb\":12.05090295018133,\"quotaNextResetTime\":\"srp\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"zraehtwd\",\"modifiedDate\":\"ftswibyrcdlbhsh\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"ty\",\"scopeId\":\"evxccedcp\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"xltjcvnhltiu\",\"disableLocalAuth\":false,\"\":{\"y\":\"datavvwxqi\",\"djrkvfgbvfvpd\":\"dataunyowxwl\"}},\"defaultDataCollectionRuleResourceId\":\"daciz\"},\"identity\":{\"principalId\":\"lhkrribdeibqipqk\",\"tenantId\":\"vxndz\",\"type\":\"user\",\"userAssignedIdentities\":{\"sjabibs\":{\"principalId\":\"fajpjorwk\",\"clientId\":\"yhgbijtjivfx\"},\"budurgkakmo\":{\"principalId\":\"tawfsdjpvkvp\",\"clientId\":\"xbkzbzkdvncj\"},\"lgzrfzeeyeb\":{\"principalId\":\"hjjklff\",\"clientId\":\"ouw\"},\"t\":{\"principalId\":\"ikayuhqlbjbsybb\",\"clientId\":\"r\"}}},\"systemData\":{\"createdBy\":\"mfpgv\",\"createdByType\":\"Key\",\"createdAt\":\"2021-10-24T06:37:57Z\",\"lastModifiedBy\":\"ltha\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-09-03T05:44:20Z\"},\"etag\":\"wutwbdsre\",\"location\":\"pdrhne\",\"tags\":{\"cgpik\":\"wqkdwytisibi\",\"av\":\"zimejzanlfzx\",\"jq\":\"mbzonokix\"},\"id\":\"irgzp\",\"name\":\"rlazszrnw\",\"type\":\"iin\"}]}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"ProvisioningAccount\",\"customerId\":\"mtdh\",\"sku\":{\"name\":\"Standalone\",\"capacityReservationLevel\":1330472875,\"lastSkuUpdate\":\"2021-08-05T12:13:03Z\"},\"retentionInDays\":811019553,\"workspaceCapping\":{\"dailyQuotaGb\":64.53231022171681,\"quotaNextResetTime\":\"w\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"2021-12-09T01:29:35Z\",\"modifiedDate\":\"2021-03-20T05:32:50Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"vqqaatjinrvgo\",\"scopeId\":\"mfiibfggj\"},{\"resourceId\":\"olvrw\",\"scopeId\":\"v\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"ygvjayvblmh\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":true,\"associations\":[\"vvyhg\"],\"uvwzfbnh\":\"databyrqufeg\",\"bmhrixkwmyijejv\":\"datamctlpdngitv\",\"ixexcc\":\"datagrhbpn\"},\"defaultDataCollectionRuleResourceId\":\"reaxhcexdr\",\"replication\":{\"location\":\"ahqkg\",\"enabled\":false,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-04-30T07:00:15Z\",\"lastModifiedDate\":\"2021-07-07T03:58:09Z\"},\"failover\":{\"state\":\"Failed\",\"lastModifiedDate\":\"2021-09-16T08:46:35Z\"}},\"identity\":{\"principalId\":\"z\",\"tenantId\":\"voowvr\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"yhgfipnsx\":{\"principalId\":\"qp\",\"clientId\":\"ostronz\"},\"gumhjglikkxws\":{\"principalId\":\"cwaekrrjre\",\"clientId\":\"xt\"}}},\"etag\":\"bq\",\"location\":\"vuzlm\",\"tags\":{\"noigbrnjwmwk\":\"lfktgplcrpwjxe\"},\"id\":\"nbsazejjoqkag\",\"name\":\"hsxttaugzxnf\",\"type\":\"azpxdtnkdmkqjjl\"},{\"properties\":{\"provisioningState\":\"ProvisioningAccount\",\"customerId\":\"rkpyouaibrebqaay\",\"sku\":{\"name\":\"PerGB2018\",\"capacityReservationLevel\":1330578772,\"lastSkuUpdate\":\"2021-11-17T18:36:32Z\"},\"retentionInDays\":2018222858,\"workspaceCapping\":{\"dailyQuotaGb\":15.097379092743646,\"quotaNextResetTime\":\"wfff\",\"dataIngestionStatus\":\"SubscriptionSuspended\"},\"createdDate\":\"2021-01-19T04:30:49Z\",\"modifiedDate\":\"2021-03-20T06:33:49Z\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"jihy\",\"scopeId\":\"zphv\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"upkvipmdsc\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"zhfstot\",\"hojujbypelmcuv\",\"ixbjx\"],\"lrcoolsttpki\":\"datan\"},\"defaultDataCollectionRuleResourceId\":\"kbnujr\",\"replication\":{\"location\":\"tylbfpncurdoiw\",\"enabled\":false,\"provisioningState\":\"Succeeded\",\"createdDate\":\"2021-05-04T20:05:44Z\",\"lastModifiedDate\":\"2021-07-16T11:50:04Z\"},\"failover\":{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-08-12T00:10:56Z\"}},\"identity\":{\"principalId\":\"knfd\",\"tenantId\":\"wjchrdg\",\"type\":\"None\",\"userAssignedIdentities\":{\"tsbwtovvtgse\":{\"principalId\":\"mwctondzjluudfd\",\"clientId\":\"gg\"}}},\"etag\":\"fiufx\",\"location\":\"knpirgnepttwq\",\"tags\":{\"rxfrddhc\":\"iffcdmqnrojlpijn\",\"ronasxift\":\"atiz\",\"zh\":\"zq\"},\"id\":\"tw\",\"name\":\"sgogczhonnxk\",\"type\":\"lgnyhmo\"}]}") .toObject(WorkspaceListResult.class); - Assertions.assertEquals("i", model.value().get(0).location()); - Assertions.assertEquals("rgzdwmsweyp", model.value().get(0).tags().get("w")); - Assertions.assertEquals(IdentityType.APPLICATION, model.value().get(0).identity().type()); - Assertions.assertEquals("uhczbwemh", model.value().get(0).etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.value().get(0).sku().name()); - Assertions.assertEquals(CapacityReservationLevel.THREE_ZERO_ZERO, - model.value().get(0).sku().capacityReservationLevel()); - Assertions.assertEquals(2059272755, model.value().get(0).retentionInDays()); - Assertions.assertEquals(3.405125193957159D, model.value().get(0).workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("vuzlm", model.value().get(0).location()); + Assertions.assertEquals("lfktgplcrpwjxe", model.value().get(0).tags().get("noigbrnjwmwk")); + Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("bq", model.value().get(0).etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.value().get(0).sku().name()); + Assertions.assertEquals(1330472875, model.value().get(0).sku().capacityReservationLevel()); + Assertions.assertEquals(811019553, model.value().get(0).retentionInDays()); + Assertions.assertEquals(64.53231022171681D, model.value().get(0).workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.value().get(0).forceCmkForQuery()); - Assertions.assertEquals(true, model.value().get(0).features().enableDataExport()); - Assertions.assertEquals(true, model.value().get(0).features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("bon", model.value().get(0).features().clusterResourceId()); - Assertions.assertEquals(false, model.value().get(0).features().disableLocalAuth()); - Assertions.assertEquals("nkbykutwpfhp", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + model.value().get(0).publicNetworkAccessForQuery()); + Assertions.assertTrue(model.value().get(0).forceCmkForQuery()); + Assertions.assertFalse(model.value().get(0).features().enableDataExport()); + Assertions.assertTrue(model.value().get(0).features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ygvjayvblmh", model.value().get(0).features().clusterResourceId()); + Assertions.assertTrue(model.value().get(0).features().disableLocalAuth()); + Assertions.assertEquals("reaxhcexdr", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("ahqkg", model.value().get(0).replication().location()); + Assertions.assertFalse(model.value().get(0).replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceListResult model - = new WorkspaceListResult() - .withValue( - Arrays - .asList( - new WorkspaceInner().withLocation("i") - .withTags(mapOf("w", "rgzdwmsweyp")) - .withIdentity(new Identity().withType(IdentityType.APPLICATION) - .withUserAssignedIdentities(mapOf("m", new UserIdentityProperties(), "grtwae", - new UserIdentityProperties(), "efozbhdms", new UserIdentityProperties(), "z", - new UserIdentityProperties()))) - .withEtag("uhczbwemh") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.CAPACITY_RESERVATION) - .withCapacityReservationLevel(CapacityReservationLevel.THREE_ZERO_ZERO)) - .withRetentionInDays(2059272755) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(3.405125193957159D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("bon") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("nkbykutwpfhp"), - new WorkspaceInner().withLocation("pdrhne") - .withTags(mapOf("cgpik", "wqkdwytisibi", "av", "zimejzanlfzx", "jq", "mbzonokix")) - .withIdentity(new Identity().withType(IdentityType.USER) - .withUserAssignedIdentities(mapOf("sjabibs", new UserIdentityProperties(), - "budurgkakmo", new UserIdentityProperties(), "lgzrfzeeyeb", - new UserIdentityProperties(), "t", new UserIdentityProperties()))) - .withEtag("wutwbdsre") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO)) - .withRetentionInDays(1351567723) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(12.05090295018133D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("xltjcvnhltiu") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("daciz"))); + WorkspaceListResult model = new WorkspaceListResult().withValue(Arrays.asList( + new WorkspaceInner().withLocation("vuzlm") + .withTags(mapOf("noigbrnjwmwk", "lfktgplcrpwjxe")) + .withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("yhgfipnsx", new UserIdentityProperties(), "gumhjglikkxws", + new UserIdentityProperties()))) + .withEtag("bq") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDALONE) + .withCapacityReservationLevel(1330472875)) + .withRetentionInDays(811019553) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(64.53231022171681D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withForceCmkForQuery(true) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) + .withImmediatePurgeDataOn30Days(true) + .withEnableLogAccessUsingOnlyResourcePermissions(true) + .withClusterResourceId("ygvjayvblmh") + .withDisableLocalAuth(true) + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"vvyhg\"]", Object.class, SerializerEncoding.JSON), + "ixexcc", "datagrhbpn", "uvwzfbnh", "databyrqufeg", "bmhrixkwmyijejv", "datamctlpdngitv", + "unifiedSentinelBillingOnly", true))) + .withDefaultDataCollectionRuleResourceId("reaxhcexdr") + .withReplication(new WorkspaceReplicationProperties().withLocation("ahqkg").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()), + new WorkspaceInner().withLocation("knpirgnepttwq") + .withTags(mapOf("rxfrddhc", "iffcdmqnrojlpijn", "ronasxift", "atiz", "zh", "zq")) + .withIdentity(new Identity().withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("tsbwtovvtgse", new UserIdentityProperties()))) + .withEtag("fiufx") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018) + .withCapacityReservationLevel(1330578772)) + .withRetentionInDays(2018222858) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(15.097379092743646D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) + .withForceCmkForQuery(false) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) + .withImmediatePurgeDataOn30Days(false) + .withEnableLogAccessUsingOnlyResourcePermissions(false) + .withClusterResourceId("upkvipmdsc") + .withDisableLocalAuth(false) + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"zhfstot\",\"hojujbypelmcuv\",\"ixbjx\"]", Object.class, + SerializerEncoding.JSON), + "lrcoolsttpki", "datan", "unifiedSentinelBillingOnly", false))) + .withDefaultDataCollectionRuleResourceId("kbnujr") + .withReplication(new WorkspaceReplicationProperties().withLocation("tylbfpncurdoiw").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()))); model = BinaryData.fromObject(model).toObject(WorkspaceListResult.class); - Assertions.assertEquals("i", model.value().get(0).location()); - Assertions.assertEquals("rgzdwmsweyp", model.value().get(0).tags().get("w")); - Assertions.assertEquals(IdentityType.APPLICATION, model.value().get(0).identity().type()); - Assertions.assertEquals("uhczbwemh", model.value().get(0).etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.value().get(0).sku().name()); - Assertions.assertEquals(CapacityReservationLevel.THREE_ZERO_ZERO, - model.value().get(0).sku().capacityReservationLevel()); - Assertions.assertEquals(2059272755, model.value().get(0).retentionInDays()); - Assertions.assertEquals(3.405125193957159D, model.value().get(0).workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("vuzlm", model.value().get(0).location()); + Assertions.assertEquals("lfktgplcrpwjxe", model.value().get(0).tags().get("noigbrnjwmwk")); + Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("bq", model.value().get(0).etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.value().get(0).sku().name()); + Assertions.assertEquals(1330472875, model.value().get(0).sku().capacityReservationLevel()); + Assertions.assertEquals(811019553, model.value().get(0).retentionInDays()); + Assertions.assertEquals(64.53231022171681D, model.value().get(0).workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.value().get(0).forceCmkForQuery()); - Assertions.assertEquals(true, model.value().get(0).features().enableDataExport()); - Assertions.assertEquals(true, model.value().get(0).features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("bon", model.value().get(0).features().clusterResourceId()); - Assertions.assertEquals(false, model.value().get(0).features().disableLocalAuth()); - Assertions.assertEquals("nkbykutwpfhp", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + model.value().get(0).publicNetworkAccessForQuery()); + Assertions.assertTrue(model.value().get(0).forceCmkForQuery()); + Assertions.assertFalse(model.value().get(0).features().enableDataExport()); + Assertions.assertTrue(model.value().get(0).features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ygvjayvblmh", model.value().get(0).features().clusterResourceId()); + Assertions.assertTrue(model.value().get(0).features().disableLocalAuth()); + Assertions.assertEquals("reaxhcexdr", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("ahqkg", model.value().get(0).replication().location()); + Assertions.assertFalse(model.value().get(0).replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java index 606d57e1a4bc..c1a080838866 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java @@ -16,45 +16,51 @@ public final class WorkspaceListUsagesResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceListUsagesResult model = BinaryData.fromString( - "{\"value\":[{\"name\":{\"value\":\"ibycno\",\"localizedValue\":\"knme\"},\"unit\":\"sgzvahapjyzhpv\",\"currentValue\":87.25675780401417,\"limit\":55.97471576867415,\"nextResetTime\":\"2021-04-03T19:52:37Z\",\"quotaPeriod\":\"zlmwlxkvugfhz\"},{\"name\":{\"value\":\"wjvzunluthnn\",\"localizedValue\":\"nxipeil\"},\"unit\":\"zuaejxd\",\"currentValue\":90.33601925524867,\"limit\":73.93279017728112,\"nextResetTime\":\"2021-04-25T18:40:13Z\",\"quotaPeriod\":\"zumveekgpwo\"},{\"name\":{\"value\":\"kfpbs\",\"localizedValue\":\"ofd\"},\"unit\":\"uusdttouwa\",\"currentValue\":45.35057543626068,\"limit\":0.5889681397022062,\"nextResetTime\":\"2021-03-07T10:01:38Z\",\"quotaPeriod\":\"smv\"}]}") + "{\"value\":[{\"name\":{\"value\":\"zrnw\",\"localizedValue\":\"indfpwpjyl\"},\"unit\":\"tlhflsjcdhszf\",\"currentValue\":93.507310013303,\"limit\":23.397589490400428,\"nextResetTime\":\"2021-12-07T09:36:22Z\",\"quotaPeriod\":\"a\"},{\"name\":{\"value\":\"mqhldvrii\",\"localizedValue\":\"jnalghf\"},\"unit\":\"tvsexsowuel\",\"currentValue\":95.82653467641371,\"limit\":72.21038300276933,\"nextResetTime\":\"2021-10-26T13:34:39Z\",\"quotaPeriod\":\"hmzk\"},{\"name\":{\"value\":\"g\",\"localizedValue\":\"spughftqsxhq\"},\"unit\":\"j\",\"currentValue\":65.12505098321063,\"limit\":37.6190498251855,\"nextResetTime\":\"2021-06-03T19:27:08Z\",\"quotaPeriod\":\"jguufzdm\"},{\"name\":{\"value\":\"tfih\",\"localizedValue\":\"botzingamvppho\"},\"unit\":\"qzudphq\",\"currentValue\":82.02103115304786,\"limit\":77.5366363877876,\"nextResetTime\":\"2021-09-19T17:28Z\",\"quotaPeriod\":\"cvtbv\"}]}") .toObject(WorkspaceListUsagesResult.class); - Assertions.assertEquals("ibycno", model.value().get(0).name().value()); - Assertions.assertEquals("knme", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("sgzvahapjyzhpv", model.value().get(0).unit()); - Assertions.assertEquals(87.25675780401417D, model.value().get(0).currentValue()); - Assertions.assertEquals(55.97471576867415D, model.value().get(0).limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals("zlmwlxkvugfhz", model.value().get(0).quotaPeriod()); + Assertions.assertEquals("zrnw", model.value().get(0).name().value()); + Assertions.assertEquals("indfpwpjyl", model.value().get(0).name().localizedValue()); + Assertions.assertEquals("tlhflsjcdhszf", model.value().get(0).unit()); + Assertions.assertEquals(93.507310013303D, model.value().get(0).currentValue()); + Assertions.assertEquals(23.397589490400428D, model.value().get(0).limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T09:36:22Z"), model.value().get(0).nextResetTime()); + Assertions.assertEquals("a", model.value().get(0).quotaPeriod()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { WorkspaceListUsagesResult model = new WorkspaceListUsagesResult().withValue(Arrays.asList( - new UsageMetricInner().withName(new MetricName().withValue("ibycno").withLocalizedValue("knme")) - .withUnit("sgzvahapjyzhpv") - .withCurrentValue(87.25675780401417D) - .withLimit(55.97471576867415D) - .withNextResetTime(OffsetDateTime.parse("2021-04-03T19:52:37Z")) - .withQuotaPeriod("zlmwlxkvugfhz"), - new UsageMetricInner().withName(new MetricName().withValue("wjvzunluthnn").withLocalizedValue("nxipeil")) - .withUnit("zuaejxd") - .withCurrentValue(90.33601925524867D) - .withLimit(73.93279017728112D) - .withNextResetTime(OffsetDateTime.parse("2021-04-25T18:40:13Z")) - .withQuotaPeriod("zumveekgpwo"), - new UsageMetricInner().withName(new MetricName().withValue("kfpbs").withLocalizedValue("ofd")) - .withUnit("uusdttouwa") - .withCurrentValue(45.35057543626068D) - .withLimit(0.5889681397022062D) - .withNextResetTime(OffsetDateTime.parse("2021-03-07T10:01:38Z")) - .withQuotaPeriod("smv"))); + new UsageMetricInner().withName(new MetricName().withValue("zrnw").withLocalizedValue("indfpwpjyl")) + .withUnit("tlhflsjcdhszf") + .withCurrentValue(93.507310013303D) + .withLimit(23.397589490400428D) + .withNextResetTime(OffsetDateTime.parse("2021-12-07T09:36:22Z")) + .withQuotaPeriod("a"), + new UsageMetricInner().withName(new MetricName().withValue("mqhldvrii").withLocalizedValue("jnalghf")) + .withUnit("tvsexsowuel") + .withCurrentValue(95.82653467641371D) + .withLimit(72.21038300276933D) + .withNextResetTime(OffsetDateTime.parse("2021-10-26T13:34:39Z")) + .withQuotaPeriod("hmzk"), + new UsageMetricInner().withName(new MetricName().withValue("g").withLocalizedValue("spughftqsxhq")) + .withUnit("j") + .withCurrentValue(65.12505098321063D) + .withLimit(37.6190498251855D) + .withNextResetTime(OffsetDateTime.parse("2021-06-03T19:27:08Z")) + .withQuotaPeriod("jguufzdm"), + new UsageMetricInner().withName(new MetricName().withValue("tfih").withLocalizedValue("botzingamvppho")) + .withUnit("qzudphq") + .withCurrentValue(82.02103115304786D) + .withLimit(77.5366363877876D) + .withNextResetTime(OffsetDateTime.parse("2021-09-19T17:28Z")) + .withQuotaPeriod("cvtbv"))); model = BinaryData.fromObject(model).toObject(WorkspaceListUsagesResult.class); - Assertions.assertEquals("ibycno", model.value().get(0).name().value()); - Assertions.assertEquals("knme", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("sgzvahapjyzhpv", model.value().get(0).unit()); - Assertions.assertEquals(87.25675780401417D, model.value().get(0).currentValue()); - Assertions.assertEquals(55.97471576867415D, model.value().get(0).limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals("zlmwlxkvugfhz", model.value().get(0).quotaPeriod()); + Assertions.assertEquals("zrnw", model.value().get(0).name().value()); + Assertions.assertEquals("indfpwpjyl", model.value().get(0).name().localizedValue()); + Assertions.assertEquals("tlhflsjcdhszf", model.value().get(0).unit()); + Assertions.assertEquals(93.507310013303D, model.value().get(0).currentValue()); + Assertions.assertEquals(23.397589490400428D, model.value().get(0).limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T09:36:22Z"), model.value().get(0).nextResetTime()); + Assertions.assertEquals("a", model.value().get(0).quotaPeriod()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java index 8ceab0bfee2f..84df62623801 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java @@ -5,14 +5,17 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.HashMap; @@ -23,62 +26,70 @@ public final class WorkspacePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspacePatch model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"gg\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":1000,\"lastSkuUpdate\":\"ovvtgseinqfiu\"},\"retentionInDays\":846707727,\"workspaceCapping\":{\"dailyQuotaGb\":67.63985202806066,\"quotaNextResetTime\":\"gnepttwqmsni\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"mqnrojlpijnkr\",\"modifiedDate\":\"rddh\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"asxifto\",\"scopeId\":\"yzhftwesgogczh\"},{\"resourceId\":\"nxkrlgnyhmossxkk\",\"scopeId\":\"h\"},{\"resourceId\":\"gh\",\"scopeId\":\"bdhqxvcxgf\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"rnsvbuswd\",\"disableLocalAuth\":false,\"\":{\"awnopqgikyzirtxd\":\"dataycnunvjsrtk\",\"ioilqukrydxtq\":\"datauxzejntpsew\",\"ghhavgrvkffo\":\"dataieoxorggufhyaomt\",\"mv\":\"datajzhpjbibgjmfx\"}},\"defaultDataCollectionRuleResourceId\":\"luyovwxnbkfezzx\"},\"identity\":{\"principalId\":\"hwzdgirujbz\",\"tenantId\":\"mvzzbtdcqvp\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"cotmr\":{\"principalId\":\"viylwdshfssnrbgy\",\"clientId\":\"rymsgaojfmw\"},\"cpqjlihhyu\":{\"principalId\":\"irctymoxoftpipiw\",\"clientId\":\"zuhx\"},\"rsre\":{\"principalId\":\"skasdvlmfwdgzxu\",\"clientId\":\"cvpa\"}}},\"tags\":{\"ifqjz\":\"xurisjnhnyt\",\"lw\":\"xmrhu\",\"woqhihe\":\"cesutrgjupauut\",\"zpnfqntcypsxj\":\"qg\"},\"etag\":\"oimwkslirc\",\"id\":\"zjxvydfcea\",\"name\":\"vlhv\",\"type\":\"gdyftumrtwna\"}") + "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"zlrphwzs\",\"sku\":{\"name\":\"PerGB2018\",\"capacityReservationLevel\":1354895276,\"lastSkuUpdate\":\"2021-05-13T15:08:20Z\"},\"retentionInDays\":2112519300,\"workspaceCapping\":{\"dailyQuotaGb\":34.97869271736046,\"quotaNextResetTime\":\"nrwrbiork\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"2021-03-04T00:16:10Z\",\"modifiedDate\":\"2021-04-15T08:16:25Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"v\",\"scopeId\":\"miloxggdufiqndie\"},{\"resourceId\":\"ao\",\"scopeId\":\"chvcyyysfgdo\"},{\"resourceId\":\"ubiipuipwoqonma\",\"scopeId\":\"ekni\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"ev\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"ilbywdxsm\",\"ccwr\"],\"n\":\"datacj\",\"voqyt\":\"datanszqujiz\"},\"defaultDataCollectionRuleResourceId\":\"yo\",\"replication\":{\"location\":\"lgy\",\"enabled\":false,\"provisioningState\":\"Failed\",\"createdDate\":\"2021-06-15T10:26:37Z\",\"lastModifiedDate\":\"2021-11-07T15:05:03Z\"},\"failover\":{\"state\":\"Failed\",\"lastModifiedDate\":\"2021-01-31T04:26:46Z\"}},\"identity\":{\"principalId\":\"sbpimlq\",\"tenantId\":\"jxkcgxxlxsff\",\"type\":\"None\",\"userAssignedIdentities\":{\"sgow\":{\"principalId\":\"qzdwlvwlyoup\",\"clientId\":\"fbkjubdyhgkfmi\"},\"tg\":{\"principalId\":\"ttsttktlahbqact\",\"clientId\":\"gzukxitmm\"},\"isavok\":{\"principalId\":\"q\",\"clientId\":\"rnxrxcpj\"},\"rqttbajlkatnw\":{\"principalId\":\"zfvazi\",\"clientId\":\"l\"}}},\"tags\":{\"cxkdmligovi\":\"opidkqqfkuv\",\"goorbteo\":\"rxkpmloazuruoc\"},\"etag\":\"fhjxakvvjgs\",\"id\":\"ordilmywwtkgkxny\",\"name\":\"dabg\",\"type\":\"vudtjuewbcihx\"}") .toObject(WorkspacePatch.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xurisjnhnyt", model.tags().get("ifqjz")); - Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(846707727, model.retentionInDays()); - Assertions.assertEquals(67.63985202806066D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(false, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("rnsvbuswd", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("luyovwxnbkfezzx", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(IdentityType.NONE, model.identity().type()); + Assertions.assertEquals("opidkqqfkuv", model.tags().get("cxkdmligovi")); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_GB2018, model.sku().name()); + Assertions.assertEquals(1354895276, model.sku().capacityReservationLevel()); + Assertions.assertEquals(2112519300, model.retentionInDays()); + Assertions.assertEquals(34.97869271736046D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ev", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("yo", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("lgy", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspacePatch model = new WorkspacePatch() - .withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("cotmr", new UserIdentityProperties(), "cpqjlihhyu", - new UserIdentityProperties(), "rsre", new UserIdentityProperties()))) - .withTags(mapOf("ifqjz", "xurisjnhnyt", "lw", "xmrhu", "woqhihe", "cesutrgjupauut", "zpnfqntcypsxj", "qg")) - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE) - .withCapacityReservationLevel(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO)) - .withRetentionInDays(846707727) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(67.63985202806066D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) + WorkspacePatch model = new WorkspacePatch().withIdentity(new Identity().withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("sgow", new UserIdentityProperties(), "tg", new UserIdentityProperties(), + "isavok", new UserIdentityProperties(), "rqttbajlkatnw", new UserIdentityProperties()))) + .withTags(mapOf("cxkdmligovi", "opidkqqfkuv", "goorbteo", "rxkpmloazuruoc")) + .withSku( + new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018).withCapacityReservationLevel(1354895276)) + .withRetentionInDays(2112519300) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(34.97869271736046D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) .withForceCmkForQuery(true) .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("rnsvbuswd") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("luyovwxnbkfezzx"); + .withImmediatePurgeDataOn30Days(false) + .withEnableLogAccessUsingOnlyResourcePermissions(false) + .withClusterResourceId("ev") + .withDisableLocalAuth(true) + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"ilbywdxsm\",\"ccwr\"]", Object.class, SerializerEncoding.JSON), + "voqyt", "datanszqujiz", "unifiedSentinelBillingOnly", false, "n", "datacj"))) + .withDefaultDataCollectionRuleResourceId("yo") + .withReplication(new WorkspaceReplicationProperties().withLocation("lgy").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()); model = BinaryData.fromObject(model).toObject(WorkspacePatch.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xurisjnhnyt", model.tags().get("ifqjz")); - Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(846707727, model.retentionInDays()); - Assertions.assertEquals(67.63985202806066D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(false, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("rnsvbuswd", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("luyovwxnbkfezzx", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(IdentityType.NONE, model.identity().type()); + Assertions.assertEquals("opidkqqfkuv", model.tags().get("cxkdmligovi")); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_GB2018, model.sku().name()); + Assertions.assertEquals(1354895276, model.sku().capacityReservationLevel()); + Assertions.assertEquals(2112519300, model.retentionInDays()); + Assertions.assertEquals(34.97869271736046D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ev", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("yo", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("lgy", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java index 760774d464ae..74c47ce168c6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceProperties; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.HashMap; @@ -20,54 +23,63 @@ public final class WorkspacePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"ProvisioningAccount\",\"customerId\":\"ijnhyjsvfycxzbf\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":2000,\"lastSkuUpdate\":\"vmtgjqppy\"},\"retentionInDays\":768184156,\"workspaceCapping\":{\"dailyQuotaGb\":15.525265144439715,\"quotaNextResetTime\":\"yhgfipnsx\",\"dataIngestionStatus\":\"ForceOff\"},\"createdDate\":\"a\",\"modifiedDate\":\"rrjreafxtsgu\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"slol\",\"scopeId\":\"pvuzlmv\"},{\"resourceId\":\"lfktgplcrpwjxe\",\"scopeId\":\"oi\"},{\"resourceId\":\"rnjwmw\",\"scopeId\":\"nbsazejjoqkag\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"zxnfaaz\",\"disableLocalAuth\":false,\"\":{\"ou\":\"datakdmkqjjlwuenvrkp\"}},\"defaultDataCollectionRuleResourceId\":\"bre\"}") + "{\"provisioningState\":\"Deleting\",\"customerId\":\"v\",\"sku\":{\"name\":\"PerNode\",\"capacityReservationLevel\":1036527354,\"lastSkuUpdate\":\"2021-03-30T03:00:35Z\"},\"retentionInDays\":1960555856,\"workspaceCapping\":{\"dailyQuotaGb\":74.87413920302748,\"quotaNextResetTime\":\"uljltduceamtmcz\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"2021-10-02T15:37:14Z\",\"modifiedDate\":\"2021-01-27T20:06:14Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"xmojmsvpkjp\",\"scopeId\":\"kwcf\"},{\"resourceId\":\"ljyxgtczhe\",\"scopeId\":\"bsdshmkxmaehvbbx\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"tbaxk\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"pyklyhpluodpvru\",\"dlgzibthostgkt\"],\"lhpl\":\"datadxeclzedqbcvh\",\"lkxt\":\"datadqkdlwwqfbu\"},\"defaultDataCollectionRuleResourceId\":\"jfsmlmbtxhwgfwsr\",\"replication\":{\"location\":\"coezbrhubskh\",\"enabled\":false,\"provisioningState\":\"Succeeded\",\"createdDate\":\"2021-02-04T04:44:46Z\",\"lastModifiedDate\":\"2021-10-06T17:04:50Z\"},\"failover\":{\"state\":\"Failed\",\"lastModifiedDate\":\"2021-07-12T13:05:01Z\"}}") .toObject(WorkspaceProperties.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(768184156, model.retentionInDays()); - Assertions.assertEquals(15.525265144439715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("zxnfaaz", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("bre", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); + Assertions.assertEquals(1036527354, model.sku().capacityReservationLevel()); + Assertions.assertEquals(1960555856, model.retentionInDays()); + Assertions.assertEquals(74.87413920302748D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertTrue(model.features().enableDataExport()); + Assertions.assertTrue(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("tbaxk", model.features().clusterResourceId()); + Assertions.assertFalse(model.features().disableLocalAuth()); + Assertions.assertEquals("jfsmlmbtxhwgfwsr", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("coezbrhubskh", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceProperties model = new WorkspaceProperties() - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.LACLUSTER) - .withCapacityReservationLevel(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO)) - .withRetentionInDays(768184156) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(15.525265144439715D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("zxnfaaz") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("bre"); + WorkspaceProperties model + = new WorkspaceProperties() + .withSku( + new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_NODE).withCapacityReservationLevel(1036527354)) + .withRetentionInDays(1960555856) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(74.87413920302748D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) + .withForceCmkForQuery(true) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) + .withImmediatePurgeDataOn30Days(true) + .withEnableLogAccessUsingOnlyResourcePermissions(false) + .withClusterResourceId("tbaxk") + .withDisableLocalAuth(false) + .withAdditionalProperties(mapOf("associations", JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"pyklyhpluodpvru\",\"dlgzibthostgkt\"]", Object.class, SerializerEncoding.JSON), + "lkxt", "datadqkdlwwqfbu", "lhpl", "datadxeclzedqbcvh", "unifiedSentinelBillingOnly", false))) + .withDefaultDataCollectionRuleResourceId("jfsmlmbtxhwgfwsr") + .withReplication(new WorkspaceReplicationProperties().withLocation("coezbrhubskh").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()); model = BinaryData.fromObject(model).toObject(WorkspaceProperties.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(768184156, model.retentionInDays()); - Assertions.assertEquals(15.525265144439715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("zxnfaaz", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("bre", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); + Assertions.assertEquals(1036527354, model.sku().capacityReservationLevel()); + Assertions.assertEquals(1960555856, model.retentionInDays()); + Assertions.assertEquals(74.87413920302748D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertTrue(model.features().enableDataExport()); + Assertions.assertTrue(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("tbaxk", model.features().clusterResourceId()); + Assertions.assertFalse(model.features().disableLocalAuth()); + Assertions.assertEquals("jfsmlmbtxhwgfwsr", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("coezbrhubskh", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java index 723b5faea071..008eb5ecd653 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java @@ -12,14 +12,14 @@ public final class WorkspacePurgeResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspacePurgeResponseInner model - = BinaryData.fromString("{\"operationId\":\"hky\"}").toObject(WorkspacePurgeResponseInner.class); - Assertions.assertEquals("hky", model.operationId()); + = BinaryData.fromString("{\"operationId\":\"y\"}").toObject(WorkspacePurgeResponseInner.class); + Assertions.assertEquals("y", model.operationId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspacePurgeResponseInner model = new WorkspacePurgeResponseInner().withOperationId("hky"); + WorkspacePurgeResponseInner model = new WorkspacePurgeResponseInner().withOperationId("y"); model = BinaryData.fromObject(model).toObject(WorkspacePurgeResponseInner.class); - Assertions.assertEquals("hky", model.operationId()); + Assertions.assertEquals("y", model.operationId()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java index 3eddddd1f728..288fa7fc2f5e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.PurgeState; @@ -28,10 +28,10 @@ public void testGetPurgeStatusWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkspacePurgeStatusResponse response = manager.workspacePurges() - .getPurgeStatusWithResponse("yrrleaesinuqt", "jqo", "bpihehcecybmrqbr", com.azure.core.util.Context.NONE) + .getPurgeStatusWithResponse("osewxi", "pxvkqma", "pxvpifdfaif", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(PurgeState.COMPLETED, response.status()); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceReplicationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceReplicationPropertiesTests.java new file mode 100644 index 000000000000..8c4ef48a1d39 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceReplicationPropertiesTests.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 com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceReplicationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceReplicationProperties model = BinaryData.fromString( + "{\"location\":\"uaadraufactkahzo\",\"enabled\":true,\"provisioningState\":\"Canceled\",\"createdDate\":\"2021-03-14T01:25:46Z\",\"lastModifiedDate\":\"2021-02-20T11:59:59Z\"}") + .toObject(WorkspaceReplicationProperties.class); + Assertions.assertEquals("uaadraufactkahzo", model.location()); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceReplicationProperties model + = new WorkspaceReplicationProperties().withLocation("uaadraufactkahzo").withEnabled(true); + model = BinaryData.fromObject(model).toObject(WorkspaceReplicationProperties.class); + Assertions.assertEquals("uaadraufactkahzo", model.location()); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java index 0702c7e26406..6fc300fc797b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import org.junit.jupiter.api.Assertions; @@ -13,19 +12,19 @@ public final class WorkspaceSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WorkspaceSku model = BinaryData - .fromString("{\"name\":\"Standalone\",\"capacityReservationLevel\":5000,\"lastSkuUpdate\":\"sj\"}") + WorkspaceSku model = BinaryData.fromString( + "{\"name\":\"CapacityReservation\",\"capacityReservationLevel\":173772181,\"lastSkuUpdate\":\"2020-12-31T22:39:11Z\"}") .toObject(WorkspaceSku.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO, model.capacityReservationLevel()); + Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.name()); + Assertions.assertEquals(173772181, model.capacityReservationLevel()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceSku model = new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDALONE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO); + WorkspaceSku model = new WorkspaceSku().withName(WorkspaceSkuNameEnum.CAPACITY_RESERVATION) + .withCapacityReservationLevel(173772181); model = BinaryData.fromObject(model).toObject(WorkspaceSku.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO, model.capacityReservationLevel()); + Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.name()); + Assertions.assertEquals(173772181, model.capacityReservationLevel()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java index be12e3190dd4..b94e3856b518 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java @@ -6,18 +6,21 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.Workspace; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.nio.charset.StandardCharsets; @@ -32,56 +35,65 @@ public final class WorkspacesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"ldtve\",\"sku\":{\"name\":\"Premium\",\"capacityReservationLevel\":100,\"lastSkuUpdate\":\"hzjkn\"},\"retentionInDays\":1633027384,\"workspaceCapping\":{\"dailyQuotaGb\":61.251523393969165,\"quotaNextResetTime\":\"pnrupzaamrdi\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"kidswys\",\"modifiedDate\":\"ruffgllukk\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"vmblcouqe\",\"scopeId\":\"hbcdsziry\"},{\"resourceId\":\"ndo\",\"scopeId\":\"mbltoo\"},{\"resourceId\":\"kfqlwx\",\"scopeId\":\"ykalsyga\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"jksibjg\",\"disableLocalAuth\":true,\"\":{\"pinbmhwbjijkgqxn\":\"dataahmrnadzyqegxyi\",\"znj\":\"datambk\",\"cwkdtaaw\":\"dataujvaannggi\",\"mqkra\":\"datawfekaumrrqmb\"}},\"defaultDataCollectionRuleResourceId\":\"nxwbjsidbirkfp\"},\"identity\":{\"principalId\":\"kd\",\"tenantId\":\"gewi\",\"type\":\"None\",\"userAssignedIdentities\":{\"o\":{\"principalId\":\"bguzozky\",\"clientId\":\"nfnzhhh\"},\"pyc\":{\"principalId\":\"ffjkutycyarnroo\",\"clientId\":\"uabzoghkt\"},\"zptwrlohap\":{\"principalId\":\"coe\",\"clientId\":\"nhzqrottjzcfy\"},\"xpjb\":{\"principalId\":\"nfszpyglqdhmrjz\",\"clientId\":\"l\"}}},\"systemData\":{\"createdBy\":\"sjoqcjenkyhfqzvs\",\"createdByType\":\"Application\",\"createdAt\":\"2021-08-22T03:48:47Z\",\"lastModifiedBy\":\"l\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-04-25T15:23:25Z\"},\"etag\":\"jhhhqxu\",\"location\":\"yvca\",\"tags\":{\"vbsizusjszlbscm\":\"v\"},\"id\":\"lzijiufehgmvflnw\",\"name\":\"v\",\"type\":\"kxrerlniylylyfwx\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"edenrexkxbhxv\",\"sku\":{\"name\":\"Standard\",\"capacityReservationLevel\":1049789640,\"lastSkuUpdate\":\"2021-02-13T23:06:36Z\"},\"retentionInDays\":1169492818,\"workspaceCapping\":{\"dailyQuotaGb\":33.579421975520674,\"quotaNextResetTime\":\"znfaj\",\"dataIngestionStatus\":\"ForceOn\"},\"createdDate\":\"2021-06-14T13:50:50Z\",\"modifiedDate\":\"2021-06-29T16:28:10Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"rl\",\"scopeId\":\"zji\"},{\"resourceId\":\"qfhefkwabsol\",\"scopeId\":\"nqqlmgnl\"},{\"resourceId\":\"sjxtel\",\"scopeId\":\"hvuqbo\"},{\"resourceId\":\"o\",\"scopeId\":\"qocarkuzlbc\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"qytl\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"ckze\",\"nxakckyw\"],\"hfaogzv\":\"datagaabjkdtf\"},\"defaultDataCollectionRuleResourceId\":\"wrsiwdyjqurykc\",\"replication\":{\"location\":\"ueekcsue\",\"enabled\":false,\"provisioningState\":\"Canceled\",\"createdDate\":\"2021-03-11T17:26:18Z\",\"lastModifiedDate\":\"2021-07-31T15:46:45Z\"},\"failover\":{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-04-29T13:14:35Z\"}},\"identity\":{\"principalId\":\"d\",\"tenantId\":\"mhmpty\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"fnqt\":{\"principalId\":\"bnrqq\",\"clientId\":\"ztpb\"}}},\"etag\":\"omals\",\"location\":\"bnfddep\",\"tags\":{\"f\":\"qjn\",\"vmywhsbrcarycsjj\":\"ygleexa\",\"dmkrrb\":\"yvoaqajuvehzp\",\"ubefgybpmfbfunu\":\"mpfu\"},\"id\":\"mpzkrvfyifkd\",\"name\":\"chlzvfi\",\"type\":\"tnkjjwgcwnphb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Workspace response = manager.workspaces() - .define("jxl") - .withRegion("wsdrnpxqwodif") - .withExistingResourceGroup("ecmslclbl") - .withTags(mapOf("wibvjogj", "cjrmmua")) - .withIdentity(new Identity().withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf("efgwbmqjc", new UserIdentityProperties()))) - .withEtag("jcmmzrrscub") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDARD) - .withCapacityReservationLevel(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO)) - .withRetentionInDays(1106041304) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(17.1701428900364D)) + .define("gv") + .withRegion("oyfpuq") + .withExistingResourceGroup("yznclkfkee") + .withTags(mapOf("wvpsoz", "ezxlhdjzqdca", "pnx", "iihjriybmrzo")) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("xomeikjclwzacn", new UserIdentityProperties()))) + .withEtag("fsuqtaazyqbxy") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE).withCapacityReservationLevel(965244387)) + .withRetentionInDays(1510649527) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(15.022557422512794D)) .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) - .withForceCmkForQuery(false) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withForceCmkForQuery(true) .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("d") - .withDisableLocalAuth(true) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("ulrtywikdmh") + .withImmediatePurgeDataOn30Days(false) + .withEnableLogAccessUsingOnlyResourcePermissions(true) + .withClusterResourceId("llqxbdmvrscm") + .withDisableLocalAuth(false) + .withAdditionalProperties(mapOf("associations", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("[\"nyeofltfnnxrk\",\"dj\",\"ynnfmuiii\",\"ipfohykfkx\"]", Object.class, + SerializerEncoding.JSON), + "ewoi", "databrwjiutgnjizb", "uifr", "datad", "pezkis", "datavka", "unifiedSentinelBillingOnly", + true, "juyrsrziuctixg", "datamrvz"))) + .withDefaultDataCollectionRuleResourceId("jm") + .withReplication(new WorkspaceReplicationProperties().withLocation("syparybjufp").withEnabled(true)) + .withFailover(new WorkspaceFailoverProperties()) .create(); - Assertions.assertEquals("yvca", response.location()); - Assertions.assertEquals("v", response.tags().get("vbsizusjszlbscm")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("jhhhqxu", response.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PREMIUM, response.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO, response.sku().capacityReservationLevel()); - Assertions.assertEquals(1633027384, response.retentionInDays()); - Assertions.assertEquals(61.251523393969165D, response.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, response.forceCmkForQuery()); - Assertions.assertEquals(true, response.features().enableDataExport()); - Assertions.assertEquals(true, response.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, response.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("jksibjg", response.features().clusterResourceId()); - Assertions.assertEquals(true, response.features().disableLocalAuth()); - Assertions.assertEquals("nxwbjsidbirkfp", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("bnfddep", response.location()); + Assertions.assertEquals("qjn", response.tags().get("f")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.identity().type()); + Assertions.assertEquals("omals", response.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDARD, response.sku().name()); + Assertions.assertEquals(1049789640, response.sku().capacityReservationLevel()); + Assertions.assertEquals(1169492818, response.retentionInDays()); + Assertions.assertEquals(33.579421975520674D, response.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + response.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.publicNetworkAccessForQuery()); + Assertions.assertFalse(response.forceCmkForQuery()); + Assertions.assertFalse(response.features().enableDataExport()); + Assertions.assertFalse(response.features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(response.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("qytl", response.features().clusterResourceId()); + Assertions.assertFalse(response.features().disableLocalAuth()); + Assertions.assertEquals("wrsiwdyjqurykc", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("ueekcsue", response.replication().location()); + Assertions.assertFalse(response.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java index 4025d2a3e4b9..3fd769770841 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.workspaces().delete("odlfpyapucygvo", "vyuns", true, com.azure.core.util.Context.NONE); + manager.workspaces().delete("xmbjroum", "znv", false, com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java index 708ef7ba7672..043403b84e0a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java @@ -6,11 +6,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -25,35 +24,38 @@ public final class WorkspacesGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"uygdhgaqipirp\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":1000,\"lastSkuUpdate\":\"ulopmjnlexwhcb\"},\"retentionInDays\":1491693299,\"workspaceCapping\":{\"dailyQuotaGb\":3.5229410575627673,\"quotaNextResetTime\":\"uuuercta\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"ntqpbr\",\"modifiedDate\":\"yrduczkgofxyfsr\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"tbstvjeaqnrmv\",\"scopeId\":\"koxmlghk\"},{\"resourceId\":\"idvrmaz\",\"scopeId\":\"dwwexymz\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"wvqsgny\",\"disableLocalAuth\":true,\"\":{\"yyvpkpatlb\":\"datavensrpm\",\"gsksrfhf\":\"datajp\",\"bnxwc\":\"dataolmk\",\"fgbrtt\":\"dataommpvfqaw\"}},\"defaultDataCollectionRuleResourceId\":\"aclkiexhajlfnt\"},\"identity\":{\"principalId\":\"fyut\",\"tenantId\":\"iygbpvn\",\"type\":\"None\",\"userAssignedIdentities\":{\"fg\":{\"principalId\":\"xkyctwwgzwx\",\"clientId\":\"mecvogygzyvneeza\"}}},\"systemData\":{\"createdBy\":\"oqqtl\",\"createdByType\":\"Application\",\"createdAt\":\"2020-12-26T15:29:31Z\",\"lastModifiedBy\":\"rkjjjavfqnvhnq\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-01-06T07:59:03Z\"},\"etag\":\"iyet\",\"location\":\"sypvidbztjhqtfb\",\"tags\":{\"p\":\"ynkbwetnju\",\"piaccxnafb\":\"prkzya\"},\"id\":\"qroohtu\",\"name\":\"vmaonurjt\",\"type\":\"mghihp\"}"; + = "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"bpdbollgr\",\"sku\":{\"name\":\"Standalone\",\"capacityReservationLevel\":1441651500,\"lastSkuUpdate\":\"2021-01-18T17:52:58Z\"},\"retentionInDays\":693005184,\"workspaceCapping\":{\"dailyQuotaGb\":85.75670564450144,\"quotaNextResetTime\":\"nequy\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"2021-03-14T09:15:47Z\",\"modifiedDate\":\"2021-08-01T19:22:02Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"adrmmwiuawvcmjzk\",\"scopeId\":\"idisczskosw\"},{\"resourceId\":\"iqazugamxzkr\",\"scopeId\":\"oiisbamnppcce\"},{\"resourceId\":\"ztdsbeza\",\"scopeId\":\"f\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"hnepkpeti\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":true,\"associations\":[\"xdukecpxd\",\"zvdhctmmkosz\",\"dblnsntrp\",\"aqkiofkb\"],\"ezyquw\":\"datahklbnldpvcbh\",\"brruyuuatv\":\"datasqxutr\"},\"defaultDataCollectionRuleResourceId\":\"bjwcolbmx\",\"replication\":{\"location\":\"w\",\"enabled\":true,\"provisioningState\":\"EnableRequested\",\"createdDate\":\"2020-12-20T15:37:07Z\",\"lastModifiedDate\":\"2021-02-13T22:53:47Z\"},\"failover\":{\"state\":\"Activating\",\"lastModifiedDate\":\"2021-01-25T19:22:53Z\"}},\"identity\":{\"principalId\":\"hocn\",\"tenantId\":\"cmj\",\"type\":\"None\",\"userAssignedIdentities\":{\"tjfdoesxxhmw\":{\"principalId\":\"oqrxtdisnjevhdlm\",\"clientId\":\"idwhepfw\"},\"t\":{\"principalId\":\"bckyoikxk\",\"clientId\":\"negknjzrb\"},\"hjhgem\":{\"principalId\":\"plvukaobrlbpg\",\"clientId\":\"bagn\"}}},\"etag\":\"akywalhjymxcgqta\",\"location\":\"drclssoljome\",\"tags\":{\"gjiiytssiki\":\"ycnlbvgjcodk\",\"gmqsorhcekxg\":\"bcufqbvntn\"},\"id\":\"lykmxcpwzvmdo\",\"name\":\"sqdtiwlwxlbon\",\"type\":\"qba\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Workspace response = manager.workspaces() - .getByResourceGroupWithResponse("lghieegjlgvvpase", "sgb", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("qjrhuzgfxonj", "pusllywpv", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("sypvidbztjhqtfb", response.location()); - Assertions.assertEquals("ynkbwetnju", response.tags().get("p")); + Assertions.assertEquals("drclssoljome", response.location()); + Assertions.assertEquals("ycnlbvgjcodk", response.tags().get("gjiiytssiki")); Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("iyet", response.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, response.sku().capacityReservationLevel()); - Assertions.assertEquals(1491693299, response.retentionInDays()); - Assertions.assertEquals(3.5229410575627673D, response.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.forceCmkForQuery()); - Assertions.assertEquals(false, response.features().enableDataExport()); - Assertions.assertEquals(false, response.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, response.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wvqsgny", response.features().clusterResourceId()); - Assertions.assertEquals(true, response.features().disableLocalAuth()); - Assertions.assertEquals("aclkiexhajlfnt", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("akywalhjymxcgqta", response.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, response.sku().name()); + Assertions.assertEquals(1441651500, response.sku().capacityReservationLevel()); + Assertions.assertEquals(693005184, response.retentionInDays()); + Assertions.assertEquals(85.75670564450144D, response.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + response.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccessForQuery()); + Assertions.assertTrue(response.forceCmkForQuery()); + Assertions.assertTrue(response.features().enableDataExport()); + Assertions.assertFalse(response.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("hnepkpeti", response.features().clusterResourceId()); + Assertions.assertTrue(response.features().disableLocalAuth()); + Assertions.assertEquals("bjwcolbmx", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("w", response.replication().location()); + Assertions.assertTrue(response.replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspWithResponseMockTests.java new file mode 100644 index 000000000000..23aeb3cf2189 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspWithResponseMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesGetNspWithResponseMockTests { + @Test + public void testGetNspWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"provisioningIssues\":[{\"name\":\"qkaye\",\"properties\":{\"issueType\":\"MissingPerimeterConfiguration\",\"severity\":\"Error\",\"description\":\"lwfgziiu\",\"suggestedResourceIds\":[\"jceatlijjjrtva\",\"caszk\",\"xk\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"etyvkunmignohi\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Warning\",\"description\":\"wpin\",\"suggestedResourceIds\":[\"vabbx\",\"hmedeilbjywfcfxz\",\"rzzihvwypus\",\"vjslczwcii\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"fryvdmvxadqac\",\"perimeterGuid\":\"b2ab9a7a-0b15-4a2c-a582-6bbd6ffa49bb\",\"location\":\"naw\"},\"resourceAssociation\":{\"name\":\"gfbktyjmf\",\"accessMode\":\"Learning\"},\"profile\":{\"name\":\"yq\",\"accessRulesVersion\":988633110,\"accessRules\":[{\"name\":\"owoxqmj\",\"properties\":{}},{\"name\":\"cxn\",\"properties\":{}}],\"diagnosticSettingsVersion\":473965533,\"enabledLogCategories\":[\"usrvx\",\"simjceagbjqvlsu\"]}},\"id\":\"wzas\",\"name\":\"xgo\",\"type\":\"oyjfqipu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + LogAnalyticsManager manager = LogAnalyticsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + NetworkSecurityPerimeterConfiguration response = manager.workspaces() + .getNspWithResponse("grpxncakiqaondjr", "clamgglvlmfejdoq", "ykglt", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("fryvdmvxadqac", response.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("b2ab9a7a-0b15-4a2c-a582-6bbd6ffa49bb"), + response.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("naw", response.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("gfbktyjmf", response.properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + response.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("yq", response.properties().profile().name()); + Assertions.assertEquals(988633110, response.properties().profile().accessRulesVersion()); + Assertions.assertEquals("owoxqmj", response.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(473965533, response.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("usrvx", response.properties().profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java index a770ad13174e..e3375af4e2b8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,38 +25,38 @@ public final class WorkspacesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"customerId\":\"rxvbfihwuh\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"rbxrblmliowxihsp\"},\"retentionInDays\":510914114,\"workspaceCapping\":{\"dailyQuotaGb\":25.078160367574576,\"quotaNextResetTime\":\"pzwaklsbsbqqq\",\"dataIngestionStatus\":\"SubscriptionSuspended\"},\"createdDate\":\"rxaomzisglrrcze\",\"modifiedDate\":\"hhltnjadhqo\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"fbpcmsplb\",\"scopeId\":\"rueqthwm\"},{\"resourceId\":\"mbscbbx\",\"scopeId\":\"dhxiidlopedbwd\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"md\",\"disableLocalAuth\":true,\"\":{\"qacigeleo\":\"dataqwremjel\",\"vqvwzkjopwbe\":\"datad\",\"x\":\"datanrlkwzdqy\"}},\"defaultDataCollectionRuleResourceId\":\"akxcptsoqfyiaseq\"},\"identity\":{\"principalId\":\"rttzrazisgykiu\",\"tenantId\":\"vanbwzohmnrxxbs\",\"type\":\"user\",\"userAssignedIdentities\":{\"g\":{\"principalId\":\"nhmdptysprqs\",\"clientId\":\"zxojpslsv\"},\"q\":{\"principalId\":\"iufiqwo\",\"clientId\":\"qvapcohhoucq\"},\"ddtjwfljhznam\":{\"principalId\":\"xcxzrzdcgdzben\",\"clientId\":\"bcawetz\"},\"vgbgatzuuvbxng\":{\"principalId\":\"atmzw\",\"clientId\":\"jncqtjzmi\"}}},\"systemData\":{\"createdBy\":\"wggahttzlswvaj\",\"createdByType\":\"Key\",\"createdAt\":\"2021-09-26T07:25:25Z\",\"lastModifiedBy\":\"joqza\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-02-03T05:21:58Z\"},\"etag\":\"j\",\"location\":\"frgqhaohcm\",\"tags\":{\"l\":\"cnjrohmbpyryxame\"},\"id\":\"dyvkfkmr\",\"name\":\"cxneh\",\"type\":\"sm\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"vezcrcssbzhdd\",\"sku\":{\"name\":\"PerNode\",\"capacityReservationLevel\":1056555607,\"lastSkuUpdate\":\"2021-11-16T04:37:45Z\"},\"retentionInDays\":106775575,\"workspaceCapping\":{\"dailyQuotaGb\":55.74174962524516,\"quotaNextResetTime\":\"pavawugiqjtio\",\"dataIngestionStatus\":\"ForceOff\"},\"createdDate\":\"2021-09-30T21:30:49Z\",\"modifiedDate\":\"2021-08-09T13:44:28Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"iygspnbonhpczyk\",\"scopeId\":\"tp\"},{\"resourceId\":\"xqcsehch\",\"scopeId\":\"ufmpqumqyjgy\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"uzanhsfnhsenwphp\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"lidftujwjj\"],\"ssruqnmdvhazcvj\":\"databeqrkuorh\",\"wbqerzwxiytxtd\":\"datatiq\",\"ktg\":\"dataukvlb\"},\"defaultDataCollectionRuleResourceId\":\"tyouambewreswmow\",\"replication\":{\"location\":\"mut\",\"enabled\":false,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-05-23T20:36:12Z\",\"lastModifiedDate\":\"2021-05-17T10:49:14Z\"},\"failover\":{\"state\":\"Activating\",\"lastModifiedDate\":\"2021-06-23T04:35:50Z\"}},\"identity\":{\"principalId\":\"spxlzde\",\"tenantId\":\"grijwaiufanrayb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ygzmxieqvdsmak\":{\"principalId\":\"rojsydg\",\"clientId\":\"ydkygywezskieca\"},\"ybxawoijpodtblx\":{\"principalId\":\"xq\",\"clientId\":\"hyhxa\"},\"emehllizh\":{\"principalId\":\"kwjdjodqhy\",\"clientId\":\"ncn\"},\"dtluvvadswzsn\":{\"principalId\":\"umoqodkad\",\"clientId\":\"yibngqladywrxwh\"}}},\"etag\":\"mlowuowhl\",\"location\":\"lnwy\",\"tags\":{\"okzkltr\":\"uvblg\",\"rqcrjidhftukvh\":\"owtdvrfmvlihcvj\"},\"id\":\"xlwyoj\",\"name\":\"fqz\",\"type\":\"kfnjyixhafrat\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.workspaces().listByResourceGroup("qltgrd", com.azure.core.util.Context.NONE); + = manager.workspaces().listByResourceGroup("dbpb", com.azure.core.util.Context.NONE); - Assertions.assertEquals("frgqhaohcm", response.iterator().next().location()); - Assertions.assertEquals("cnjrohmbpyryxame", response.iterator().next().tags().get("l")); - Assertions.assertEquals(IdentityType.USER, response.iterator().next().identity().type()); - Assertions.assertEquals("j", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(510914114, response.iterator().next().retentionInDays()); - Assertions.assertEquals(25.078160367574576D, response.iterator().next().workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals("lnwy", response.iterator().next().location()); + Assertions.assertEquals("uvblg", response.iterator().next().tags().get("okzkltr")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals("mlowuowhl", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, response.iterator().next().sku().name()); + Assertions.assertEquals(1056555607, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(106775575, response.iterator().next().retentionInDays()); + Assertions.assertEquals(55.74174962524516D, response.iterator().next().workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForIngestion()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("md", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("akxcptsoqfyiaseq", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertFalse(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertTrue(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("uzanhsfnhsenwphp", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("tyouambewreswmow", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("mut", response.iterator().next().replication().location()); + Assertions.assertFalse(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java index f829a0836d61..dd45f0116751 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,37 +25,37 @@ public final class WorkspacesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"customerId\":\"wdtgukranblw\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":400,\"lastSkuUpdate\":\"c\"},\"retentionInDays\":1802278503,\"workspaceCapping\":{\"dailyQuotaGb\":33.5739290982965,\"quotaNextResetTime\":\"hoi\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"niiprglvaw\",\"modifiedDate\":\"z\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"bjpmcubk\",\"scopeId\":\"foxx\"},{\"resourceId\":\"bvphavpm\",\"scopeId\":\"rbqgvgov\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"knssqyzqed\",\"disableLocalAuth\":false,\"\":{\"qmrjg\":\"datadb\",\"mjpb\":\"dataihfqlggwfiwzc\",\"pgxh\":\"dataephmgtvljvrcmyfq\"}},\"defaultDataCollectionRuleResourceId\":\"omyqwcabvnuileey\"},\"identity\":{\"principalId\":\"lpaugmrm\",\"tenantId\":\"lrxw\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"psmgo\":{\"principalId\":\"hfkvcisizmoaedsx\",\"clientId\":\"uivedwcgyeewxeiq\"},\"gaufcs\":{\"principalId\":\"u\",\"clientId\":\"ljdlrgmspl\"}}},\"systemData\":{\"createdBy\":\"new\",\"createdByType\":\"User\",\"createdAt\":\"2021-05-21T08:44:22Z\",\"lastModifiedBy\":\"pqanxrjkix\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-11-28T23:05:19Z\"},\"etag\":\"ypnyghshxc\",\"location\":\"lhkgmnsghp\",\"tags\":{\"jkhvyomacluzvxnq\":\"phdrw\",\"df\":\"hrpq\",\"xuifmcsypobkdqz\":\"mkoisqcssf\",\"dmxzjijpv\":\"dzsylollgtrczz\"},\"id\":\"aurkihcirlde\",\"name\":\"xrdcoxnbkkja\",\"type\":\"urnnqbnqbpiz\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"uubeid\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":932346466,\"lastSkuUpdate\":\"2021-08-27T04:01:07Z\"},\"retentionInDays\":1084613444,\"workspaceCapping\":{\"dailyQuotaGb\":83.86160418016159,\"quotaNextResetTime\":\"fltgvdiho\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"2021-07-12T20:14:31Z\",\"modifiedDate\":\"2021-07-25T19:58:40Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"cpcunnuzdqum\",\"scopeId\":\"nod\"},{\"resourceId\":\"ienhqhskndnelq\",\"scopeId\":\"adlknwfoanni\"},{\"resourceId\":\"petxivcnrlyxnu\",\"scopeId\":\"ephblkwqpatvbqs\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"vuzqymt\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":true,\"associations\":[\"it\",\"qhzvb\"],\"cxmxeatkdb\":\"datadbanfznd\"},\"defaultDataCollectionRuleResourceId\":\"nrd\",\"replication\":{\"location\":\"bqbnaomhjrmkuh\",\"enabled\":true,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-08-22T07:08:52Z\",\"lastModifiedDate\":\"2021-07-09T10:57:05Z\"},\"failover\":{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-03-26T01:09:54Z\"}},\"identity\":{\"principalId\":\"anc\",\"tenantId\":\"xxqcwgaxf\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zyyfy\":{\"principalId\":\"okzwjjzrlt\",\"clientId\":\"l\"},\"ujivyqlkjuvsm\":{\"principalId\":\"qsix\",\"clientId\":\"m\"}}},\"etag\":\"lzoy\",\"location\":\"vwzdbpqvyb\",\"tags\":{\"okcvtlubses\":\"vmx\",\"pirykycndzfqiv\":\"vcuartrhun\"},\"id\":\"reuykbbmnwagl\",\"name\":\"bxoeeonql\",\"type\":\"fwmyymv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.workspaces().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("lhkgmnsghp", response.iterator().next().location()); - Assertions.assertEquals("phdrw", response.iterator().next().tags().get("jkhvyomacluzvxnq")); + Assertions.assertEquals("vwzdbpqvyb", response.iterator().next().location()); + Assertions.assertEquals("vmx", response.iterator().next().tags().get("okcvtlubses")); Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("ypnyghshxc", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FOUR_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(1802278503, response.iterator().next().retentionInDays()); - Assertions.assertEquals(33.5739290982965D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - response.iterator().next().publicNetworkAccessForIngestion()); + Assertions.assertEquals("lzoy", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, response.iterator().next().sku().name()); + Assertions.assertEquals(932346466, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(1084613444, response.iterator().next().retentionInDays()); + Assertions.assertEquals(83.86160418016159D, response.iterator().next().workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, + response.iterator().next().publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("knssqyzqed", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(false, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("omyqwcabvnuileey", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertFalse(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertTrue(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("vuzqymt", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("nrd", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("bqbnaomhjrmkuh", response.iterator().next().replication().location()); + Assertions.assertTrue(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspMockTests.java new file mode 100644 index 000000000000..093c9ed124cb --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesListNspMockTests { + @Test + public void testListNsp() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"provisioningIssues\":[{\"name\":\"kxyqvgxiaodetv\",\"properties\":{\"issueType\":\"MissingPerimeterConfiguration\",\"severity\":\"Warning\",\"description\":\"wsaifmcwno\",\"suggestedResourceIds\":[\"lehgcvkbc\",\"njolgjyyxpv\",\"lszerqzevx\",\"qe\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"waljglzoblqwaaf\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Warning\",\"description\":\"yqbhd\",\"suggestedResourceIds\":[\"jrqpjiyrqjcrga\",\"wmzwdfkbnrzorpdl\",\"bqc\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"xxsaetgz\",\"perimeterGuid\":\"7c25190c-b735-4965-9eab-ac58783e1b6a\",\"location\":\"pyigdaqqilzdc\"},\"resourceAssociation\":{\"name\":\"joedx\",\"accessMode\":\"Enforced\"},\"profile\":{\"name\":\"i\",\"accessRulesVersion\":652197370,\"accessRules\":[{\"name\":\"wgilfjqqac\",\"properties\":{}},{\"name\":\"xwxdcvjwc\",\"properties\":{}}],\"diagnosticSettingsVersion\":148579488,\"enabledLogCategories\":[\"ciqchxrtuicd\",\"iw\"]}},\"id\":\"m\",\"name\":\"p\",\"type\":\"hzzwvywrgyngy\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + LogAnalyticsManager manager = LogAnalyticsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.workspaces().listNsp("qicqchygt", "xbyja", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xxsaetgz", response.iterator().next().properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("7c25190c-b735-4965-9eab-ac58783e1b6a"), + response.iterator().next().properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("pyigdaqqilzdc", + response.iterator().next().properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("joedx", response.iterator().next().properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, + response.iterator().next().properties().resourceAssociation().accessMode()); + Assertions.assertEquals("i", response.iterator().next().properties().profile().name()); + Assertions.assertEquals(652197370, response.iterator().next().properties().profile().accessRulesVersion()); + Assertions.assertEquals("wgilfjqqac", + response.iterator().next().properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(148579488, + response.iterator().next().properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("ciqchxrtuicd", + response.iterator().next().properties().profile().enabledLogCategories().get(0)); + } +}