// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Text.Json.Serialization;
using Microsoft.Teams.Common;
namespace Microsoft.Teams.Api.MessageExtensions;
///
/// The context from which the command originates.
// Possible values include: 'message', 'compose', 'commandbox'
///
[JsonConverter(typeof(JsonConverter))]
public class MessagePreviewAction(string value) : StringEnum(value)
{
public static readonly MessagePreviewAction Edit = new("edit");
public bool IsEdit => Edit.Equals(Value);
public static readonly MessagePreviewAction Send = new("send");
public bool IsSend => Send.Equals(Value);
}
///
/// Messaging extension action
///
public class Action : TaskModules.Request
{
///
/// Id of the command assigned by Bot
///
[JsonPropertyName("commandId")]
[JsonPropertyOrder(2)]
public string? CommandId { get; set; }
///
/// The context from which the command originates.
// Possible values include: 'message', 'compose', 'commandbox'
///
[JsonPropertyName("commandContext")]
[JsonPropertyOrder(3)]
public required Commands.Context CommandContext { get; set; }
///
/// Bot message preview action taken by user. Possible values include: 'edit', 'send'
///
[JsonPropertyName("botMessagePreviewAction")]
[JsonPropertyOrder(4)]
public MessagePreviewAction? BotMessagePreviewAction { get; set; }
///
/// the activities to preview
///
[JsonPropertyName("botActivityPreview")]
[JsonPropertyOrder(5)]
public IList? BotActivityPreview { get; set; }
///
/// Message content sent as part of the command request.
///
[JsonPropertyName("messagePayload")]
[JsonPropertyOrder(6)]
public Messages.Message? MessagePayload { get; set; }
}