Skip to content

Commit

Permalink
fix responseType (#6702)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Terentiev <aterentiev@microsoft.com>
  • Loading branch information
AJIXuMuK and Alex Terentiev authored Nov 2, 2023
1 parent 4d64c20 commit e4afa43
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,23 @@ public enum ViewResponseType
/// <summary>
/// Response returned when handling a client-side action on an Adaptive Card Extension.
/// </summary>
public abstract class BaseHandleActionResponse
public class BaseHandleActionResponse
{
/// <summary>
/// Gets the response type.
/// </summary>
/// <value>Response type.</value>
[JsonProperty(PropertyName = "responseType")]
public abstract ViewResponseType ResponseType { get; }
private readonly ViewResponseType responseType;

/// <summary>
/// Initializes a new instance of the <see cref="BaseHandleActionResponse"/> class.
/// </summary>
/// <param name="responseType">Response type.</param>
protected BaseHandleActionResponse(ViewResponseType responseType)
{
this.responseType = responseType;
}

/// <summary>
/// Gets or sets render arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ namespace Microsoft.Bot.Schema.SharePoint
public class CardViewHandleActionResponse : BaseHandleActionResponse
{
/// <summary>
/// Gets the response type.
/// Initializes a new instance of the <see cref="CardViewHandleActionResponse"/> class.
/// </summary>
/// <value>Card.</value>
[JsonProperty(PropertyName = "responseType")]
public override ViewResponseType ResponseType => ViewResponseType.Card;
public CardViewHandleActionResponse()
: base(ViewResponseType.Card)
{
// Do nothing
}

/// <summary>
/// Gets or sets card view render arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ namespace Microsoft.Bot.Schema.SharePoint
public class NoOpHandleActionResponse : BaseHandleActionResponse
{
/// <summary>
/// Gets the response type.
/// Initializes a new instance of the <see cref="NoOpHandleActionResponse"/> class.
/// </summary>
/// <value>Card.</value>
[JsonProperty(PropertyName = "responseType")]
public override ViewResponseType ResponseType => ViewResponseType.NoOp;
public NoOpHandleActionResponse()
: base(ViewResponseType.NoOp)
{
// Do nothing
}

/// <summary>
/// Gets or sets card view render arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ namespace Microsoft.Bot.Schema.SharePoint
public class QuickViewHandleActionResponse : BaseHandleActionResponse
{
/// <summary>
/// Gets the response type.
/// Initializes a new instance of the <see cref="QuickViewHandleActionResponse"/> class.
/// </summary>
/// <value>Card.</value>
[JsonProperty(PropertyName = "responseType")]
public override ViewResponseType ResponseType => ViewResponseType.QuickView;
public QuickViewHandleActionResponse()
: base(ViewResponseType.QuickView)
{
// Do nothing
}

/// <summary>
/// Gets or sets card view render arguments.
Expand Down

0 comments on commit e4afa43

Please sign in to comment.