using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
//using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace ProxyTunnel.Models
{
    public class BotErrorDetails
    {
        /// <summary>
        /// Behavior to perform if BotProvider is unreachable or returns errors from any BotExchange
        /// </summary>
        public enum BotLoopErrorBehavior
        {
            ReturnControlToScriptThroughErrorBranch,
            EndContact
        }

        /// <summary>
        /// Behavior to perform if BotProvider is unreachable or returns errors from any BotExchange
        /// Possible values:
        /// •ReturnControlToScriptThroughErrorBranch - Return control to script through Error Branch
        /// •EndContact - End the bot session (hang up on phone call, end chat, etc)
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public BotLoopErrorBehavior errorBehavior { get; set; }

        /// <summary>
        /// Optional sequence of prompts to play in case of error during the BotLoop.
        /// If populated, the sequence will be rendered to user PRIOR to executing the specified 'errorBehavior'
        /// </summary>
        public PromptSequence errorPromptSequence { get; set; }
        
        /// <summary>
        /// Debug level information that will be logged by the system to assist in troubleshooting
        /// </summary>
        public string systemErrorMessage { get; set; }
    }
}
