From 46113e7f27313c47a919ea3d547808c7b1aee74a Mon Sep 17 00:00:00 2001 From: Harrie Oriowo Date: Wed, 29 May 2024 14:39:44 -0700 Subject: [PATCH] Resolving comments --- .../EventGridExplorerLibrary.csproj | 4 ++-- src/EventGridExplorerLibrary/EventGridLibrary.cs | 11 +++++------ .../Management/NamespaceTopic.cs | 3 +-- src/ServiceBusExplorer/Forms/MainForm.cs | 3 --- src/ServiceBusExplorer/ServiceBusExplorer.csproj | 1 - 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/EventGridExplorerLibrary/EventGridExplorerLibrary.csproj b/src/EventGridExplorerLibrary/EventGridExplorerLibrary.csproj index 23507c7d..a69f4e94 100644 --- a/src/EventGridExplorerLibrary/EventGridExplorerLibrary.csproj +++ b/src/EventGridExplorerLibrary/EventGridExplorerLibrary.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/src/EventGridExplorerLibrary/EventGridLibrary.cs b/src/EventGridExplorerLibrary/EventGridLibrary.cs index beed1113..ac701cb0 100644 --- a/src/EventGridExplorerLibrary/EventGridLibrary.cs +++ b/src/EventGridExplorerLibrary/EventGridLibrary.cs @@ -8,7 +8,6 @@ using Azure.Messaging.EventGrid.Namespaces; using Azure.ResourceManager.EventGrid; using ServiceBusExplorer.Utilities.Helpers; -using Microsoft.Azure.Management.EventGridV2; namespace EventGridExplorerLibrary { @@ -151,17 +150,17 @@ public async Task EventActionsAsync(string action, List lockTokens switch (action) { case "Acknowledge": - AcknowledgeResult acknowledgeResult = await dataPlaneClients[topicName].AcknowledgeCloudEventsAsync(topicName, subscriptionName, lockTokens); + AcknowledgeResult acknowledgeResult = await dataPlaneClients[topicName].AcknowledgeCloudEventsAsync(topicName, subscriptionName, new AcknowledgeOptions(lockTokens)); succeededLockTokens = acknowledgeResult.SucceededLockTokens; failedLockTokens = acknowledgeResult.FailedLockTokens; break; case "Release": - ReleaseResult releaseResult = await dataPlaneClients[topicName].ReleaseCloudEventsAsync(topicName, subscriptionName, lockTokens); + ReleaseResult releaseResult = await dataPlaneClients[topicName].ReleaseCloudEventsAsync(topicName, subscriptionName, new ReleaseOptions(lockTokens)); succeededLockTokens = releaseResult.SucceededLockTokens; failedLockTokens = releaseResult.FailedLockTokens; break; case "Reject": - RejectResult rejectResult = await dataPlaneClients[topicName].RejectCloudEventsAsync(topicName, subscriptionName, lockTokens); + RejectResult rejectResult = await dataPlaneClients[topicName].RejectCloudEventsAsync(topicName, subscriptionName, new RejectOptions(lockTokens)); succeededLockTokens = rejectResult.SucceededLockTokens; failedLockTokens = rejectResult.FailedLockTokens; break; @@ -184,8 +183,8 @@ public async Task EventActionsAsync(string action, List lockTokens foreach (FailedLockToken lockToken in failedLockTokens) { writeToLog($"Lock Token: {lockToken.LockToken}"); - writeToLog($"Error Code: {lockToken.ErrorCode}"); - writeToLog($"Error Description: {lockToken.ErrorDescription}"); + writeToLog($"Error Code: {lockToken.Error.Code}"); + writeToLog($"Error Description: {lockToken.Error.Message}"); } } diff --git a/src/EventGridExplorerLibrary/Management/NamespaceTopic.cs b/src/EventGridExplorerLibrary/Management/NamespaceTopic.cs index 6b9578d6..fe16a58c 100644 --- a/src/EventGridExplorerLibrary/Management/NamespaceTopic.cs +++ b/src/EventGridExplorerLibrary/Management/NamespaceTopic.cs @@ -8,14 +8,13 @@ // regenerated. // -namespace Microsoft.Azure.Management.EventGridV2 +namespace EventGridExplorerLibrary { using global::Azure.ResourceManager.Models; /// /// Namespace topic details. /// - [Rest.Serialization.JsonTransformation] public partial class NamespaceTopic { /// diff --git a/src/ServiceBusExplorer/Forms/MainForm.cs b/src/ServiceBusExplorer/Forms/MainForm.cs index b1326c42..989e54b5 100644 --- a/src/ServiceBusExplorer/Forms/MainForm.cs +++ b/src/ServiceBusExplorer/Forms/MainForm.cs @@ -21,12 +21,9 @@ #region Using Directives using Azure; -using Azure.Messaging.EventGrid.Namespaces; using Azure.ResourceManager.EventGrid; using EventGridExplorerLibrary; -using Microsoft.Azure.Management.EventGridV2; using Microsoft.Azure.NotificationHubs; -using Microsoft.Rest.Azure; using Microsoft.ServiceBus.Messaging; using ServiceBusExplorer.Controls; using ServiceBusExplorer.Enums; diff --git a/src/ServiceBusExplorer/ServiceBusExplorer.csproj b/src/ServiceBusExplorer/ServiceBusExplorer.csproj index 6dc625eb..6ac2c130 100644 --- a/src/ServiceBusExplorer/ServiceBusExplorer.csproj +++ b/src/ServiceBusExplorer/ServiceBusExplorer.csproj @@ -547,7 +547,6 @@ -