From e4afa430ea73dd725be39a30d16fe361e77d07c8 Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Thu, 2 Nov 2023 10:11:12 -0400 Subject: [PATCH] fix responseType (#6702) Co-authored-by: Alex Terentiev --- .../SharePoint/BaseHandleActionResponse.cs | 13 +++++++++++-- .../SharePoint/CardViewHandleActionResponse.cs | 10 ++++++---- .../SharePoint/NoOpHandleActionResponse.cs | 10 ++++++---- .../SharePoint/QuickViewHandleActionResponse.cs | 10 ++++++---- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/libraries/Microsoft.Bot.Schema/SharePoint/BaseHandleActionResponse.cs b/libraries/Microsoft.Bot.Schema/SharePoint/BaseHandleActionResponse.cs index 1be7543313..4aa33238e8 100644 --- a/libraries/Microsoft.Bot.Schema/SharePoint/BaseHandleActionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/SharePoint/BaseHandleActionResponse.cs @@ -34,14 +34,23 @@ public enum ViewResponseType /// /// Response returned when handling a client-side action on an Adaptive Card Extension. /// - public abstract class BaseHandleActionResponse + public class BaseHandleActionResponse { /// /// Gets the response type. /// /// Response type. [JsonProperty(PropertyName = "responseType")] - public abstract ViewResponseType ResponseType { get; } + private readonly ViewResponseType responseType; + + /// + /// Initializes a new instance of the class. + /// + /// Response type. + protected BaseHandleActionResponse(ViewResponseType responseType) + { + this.responseType = responseType; + } /// /// Gets or sets render arguments. diff --git a/libraries/Microsoft.Bot.Schema/SharePoint/CardViewHandleActionResponse.cs b/libraries/Microsoft.Bot.Schema/SharePoint/CardViewHandleActionResponse.cs index aa4558cbb1..fcdd10f5e2 100644 --- a/libraries/Microsoft.Bot.Schema/SharePoint/CardViewHandleActionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/SharePoint/CardViewHandleActionResponse.cs @@ -14,11 +14,13 @@ namespace Microsoft.Bot.Schema.SharePoint public class CardViewHandleActionResponse : BaseHandleActionResponse { /// - /// Gets the response type. + /// Initializes a new instance of the class. /// - /// Card. - [JsonProperty(PropertyName = "responseType")] - public override ViewResponseType ResponseType => ViewResponseType.Card; + public CardViewHandleActionResponse() + : base(ViewResponseType.Card) + { + // Do nothing + } /// /// Gets or sets card view render arguments. diff --git a/libraries/Microsoft.Bot.Schema/SharePoint/NoOpHandleActionResponse.cs b/libraries/Microsoft.Bot.Schema/SharePoint/NoOpHandleActionResponse.cs index 214036414f..b0ae6ad1d0 100644 --- a/libraries/Microsoft.Bot.Schema/SharePoint/NoOpHandleActionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/SharePoint/NoOpHandleActionResponse.cs @@ -14,11 +14,13 @@ namespace Microsoft.Bot.Schema.SharePoint public class NoOpHandleActionResponse : BaseHandleActionResponse { /// - /// Gets the response type. + /// Initializes a new instance of the class. /// - /// Card. - [JsonProperty(PropertyName = "responseType")] - public override ViewResponseType ResponseType => ViewResponseType.NoOp; + public NoOpHandleActionResponse() + : base(ViewResponseType.NoOp) + { + // Do nothing + } /// /// Gets or sets card view render arguments. diff --git a/libraries/Microsoft.Bot.Schema/SharePoint/QuickViewHandleActionResponse.cs b/libraries/Microsoft.Bot.Schema/SharePoint/QuickViewHandleActionResponse.cs index dd89c9ce13..6774c0b12c 100644 --- a/libraries/Microsoft.Bot.Schema/SharePoint/QuickViewHandleActionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/SharePoint/QuickViewHandleActionResponse.cs @@ -14,11 +14,13 @@ namespace Microsoft.Bot.Schema.SharePoint public class QuickViewHandleActionResponse : BaseHandleActionResponse { /// - /// Gets the response type. + /// Initializes a new instance of the class. /// - /// Card. - [JsonProperty(PropertyName = "responseType")] - public override ViewResponseType ResponseType => ViewResponseType.QuickView; + public QuickViewHandleActionResponse() + : base(ViewResponseType.QuickView) + { + // Do nothing + } /// /// Gets or sets card view render arguments.