public override UpdatedRequest ReadJson(JsonReader reader, Type objectType, UpdatedRequest existingValue, bool hasExistingValue,
                                                JsonSerializer serializer)
        {
            var jObject     = JObject.Load(reader);
            var requestType = jObject.Value <string>("type");

            if (requestType == IntentRequest.RequestType)
            {
                existingValue = new IntentRequest();
            }
            else
            {
                existingValue = new DialogInputRequest();
            }

            serializer.Populate(jObject.CreateReader(), existingValue);
            return(existingValue);
        }
 public static DialogDelegateRequestDirective ToConversations(DelegatePeriod period, DialogInputRequest updatedRequest = null) => new DialogDelegateRequestDirective
 {
     Target         = DialogManager.Conversations,
     Period         = period,
     UpdatedRequest = updatedRequest
 };