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 AudioCollectionRules
    {
        public enum UserInputCollectType
        {
            DO_NOT_COLLECT_USER_RESPONSE,            
            SEND_UTTERANCE_AUDIO,
            SEND_DTMF_ONLY_AS_TEXT
        }

        // Will be supported in future, for Satmetrix use case
        /// • SEND_CONFIRMATION_OF_ARCHIVED_UTTERANCE - Prompt for and collect an utterance (of fixed length and/or DTMF digit detection), and archive it to Storage Services per utteranceCollectAndArchive, dtmfRules, and the overall "millisecondsToWaitForUserResponse"

        // Will be supported in future with Transcription service, for text based bots
        /// • SEND_TRANSCRIBED_TEXT - invoke generic transcription and submit text transcript in the next response.  DTMF is submitted as TEXT.


        /// <summary>
        /// Control the method for the next response collection from the user.  Only applicable for Voice sessions
        /// Possible values:
        /// • DO_NOT_COLLECT_USER_RESPONSE - Send informational prompts to user, but do not collect response
        /// • SEND_UTTERANCE_AUDIO - submit the actual audio samples in the next response.  DTMF is submitted as TEXT.

        /// • SEND_DTMF_ONLY_AS_TEXT - do not detect audio utterances or record audio.  Only collect DTMF responses as TEXT.
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public UserInputCollectType collectionType { get; set; }

        /// <summary>
        /// Rules defining if and how the next round of user input can be collected by DTMF.
        /// </summary>
        public CollectDtmfRules dtmfRules { get; set; }

        /// <summary>
        /// Rules determining if human can interrupt a bot prompt, including sensitivity settings
        /// </summary>
        public PromptBargeConfiguration bargeConfiguration { get; set; }

        /// <summary>
        /// Configuration for custom transcription that will override the transcription configuration on the VirtualAgent for this turn
        /// </summary>
        public AudioTranscriptionConfig audioTranscriptionConfig { get; set; }
        
        /// <summary>
        /// Rules defining how an utterance should be collected and archived to Storage Services.
        /// This is only applicable if collectionType is set as "SEND_CONFIRMATION_OF_ARCHIVED_UTTERANCE"
        /// MattPage 8-19-2019 This use case is needed for Satmetrix, but not supported at time of initial DialogFlow spec
        /// </summary>
        //public UtteranceCollectAndArchiveRules utteranceCollectAndArchiveRuleSet { get; set; }
    }
}
