public void Post([FromBody] DataOpti value) { Enqueue enqueue = new Enqueue(COLAENTRANTE, SERVER); var message = GetMessage(value); enqueue.add(message); }
public void EnqueueRequiredTest() { Enqueue enqueue = new Enqueue("14f487e2-de1a-4a45-a682-5df8e3f3458d", "http://foo.com"); string json = enqueue.toJson(); Assert.IsNotNull(json); Assert.AreEqual(json, "{\"Enqueue\":{\"queueId\":\"14f487e2-de1a-4a45-a682-5df8e3f3458d\",\"actionUrl\":\"http://foo.com\",\"waitUrl\":null,\"notificationUrl\":null}}"); }
public void TestEmptyElement() { var elem = new Enqueue(); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Enqueue></Enqueue>", elem.ToString() ); }
public ActionResult Index() { var mvcName = typeof(Controller).Assembly.GetName(); var isMono = Type.GetType("Mono.Runtime") != null; ViewData["Version"] = mvcName.Version.Major + "." + mvcName.Version.Minor; ViewData["Runtime"] = isMono ? "Mono" : ".NET"; Enqueue.Command(new SayHello()).Dispatch(); return(View()); }
public void TestElementWithTextNode() { var elem = new Enqueue(); elem.AddText("Here is the content"); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Enqueue>Here is the content</Enqueue>", elem.ToString() ); }
public void TestElementWithExtraAttributes() { var elem = new Enqueue(); elem.SetOption("newParam1", "value"); elem.SetOption("newParam2", 1); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Enqueue newParam1=\"value\" newParam2=\"1\"></Enqueue>", elem.ToString() ); }
public void TestAllowGenericChildNodes() { var elem = new Enqueue(); elem.AddChild("generic-tag").AddText("Content").SetOption("tag", true); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Enqueue>" + Environment.NewLine + " <generic-tag tag=\"True\">Content</generic-tag>" + Environment.NewLine + "</Enqueue>", elem.ToString() ); }
public void TestMixedContent() { var elem = new Enqueue(); elem.AddText("before") .AddChild("Child").AddText("content"); elem.AddText("after"); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Enqueue>before<Child>content</Child>after</Enqueue>", elem.ToString() ); }
public void TestElementWithChildren() { var elem = new Enqueue(); elem.Task("body", 1, 1); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Enqueue>" + Environment.NewLine + " <Task priority=\"1\" timeout=\"1\">body</Task>" + Environment.NewLine + "</Enqueue>", elem.ToString() ); }
public void TestElementWithParams() { var elem = new Enqueue( "name", new Uri("https://example.com"), Twilio.Http.HttpMethod.Get, new Uri("https://example.com"), Twilio.Http.HttpMethod.Get, "workflow_sid" ); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Enqueue action=\"https://example.com\" method=\"GET\" waitUrl=\"https://example.com\" waitUrlMethod=\"GET\" workflowSid=\"workflow_sid\">name</Enqueue>", elem.ToString() ); }
public IActionResult ProcessDigits() { var response = new VoiceResponse(); Dictionary <string, string> department = new Dictionary <string, string>(); department.Add("1", "sales"); department.Add("2", "support"); department.Add("3", "billing"); var enqueue = new Enqueue(workflowSid: _workflow_sid); enqueue.Task("{'selected_product': '" + department[HttpContext.Request.Query["Digits"]] + @"'}"); response.Append(enqueue); return(Content(response.ToString(), contentType: "text/xml")); }
public ActionResult InboundCall(CallStatusCallback freeClimbRequest) { // Create an empty PerCL script container PerCLScript script = new PerCLScript(); // Verify inbound call is in proper state if (freeClimbRequest.getCallStatus == ECallStatus.Ringing) { // Create PerCL say script with US English as the language Say say = new Say(); say.setLanguage(ELanguage.EnglishUS); // Set greeting prompt say.setText("Hello. Your call will be queued."); // Add PerCL say script to PerCL container script.Add(say); // Create PerCL pause script with a 100 millisecond pause script.Add(new Pause(100)); // Create queue options with an alias QueueOptions options = new QueueOptions(); options.setAlias("InboundCallQueue"); // Create FreeClimbClient object FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(), getFreeClimbApiKeys()); // Create a queue with an alias Queue queue = client.getQueuesRequester.create(options); // Create PerCL say to enqueue the call into the newly created queue with an actionUrl Enqueue enqueue = new Enqueue(queue.getQueueId, getAppUrl() + "/voice/InboundCallAction"); // Add waitUrl enqueue.setWaitUrl(getAppUrl() + "/voice/InboundCallWait"); // Add PerCL enqueue script to PerCL container script.Add(enqueue); } // Convert PerCL container to JSON and append to response return(Content(script.toJson(), "application/json")); }
public ActionResult ProcessDigits() { var response = new VoiceResponse(); Dictionary <string, string> department = new Dictionary <string, string>(); department.Add("1", "sales"); department.Add("2", "support"); department.Add("3", "billing"); var enqueue = new Enqueue(workflowSid: _workflowSid); enqueue.Task("{\"selected_product\": \"" + department[Request.Params.Get("digits")] + "\"}"); response.Append(enqueue); return(Content(response.ToString(), contentType: "text/xml")); }
public static void SendResponse(HttpListenerContext ctx) { HttpListenerRequest request = ctx.Request; HttpListenerResponse response = ctx.Response; response.StatusCode = (int)HttpStatusCode.OK; response.ContentType = "text/xml"; // Generate TwiML var twiml = new VoiceResponse(); var enqueue = new Enqueue(workflowSid: "WW0123456789abcdef0123456789abcdef"); enqueue.Task("{\"account_number\": \"12345abcdef\"}"); twiml.Append(enqueue); // Write the output and close the stream byte[] buffer = Encoding.UTF8.GetBytes(twiml.ToString()); response.ContentLength64 = buffer.Length; response.OutputStream.Write(buffer, 0, buffer.Length); response.OutputStream.Close(); }
public override void QueueOnClients(Enqueue queue) { queue(Controller.Id, CommandId.PlayerSetFaceDown, Card.Id); queue(Controller.Opponent.Id, CommandId.RivalSetFaceDown); }
public override void QueueOnClients(Enqueue queue) { queue(Controller.Id, CommandId.PlayerDraw, Card.Id); queue(Controller.Opponent.Id, CommandId.RivalDraw); }
public override void QueueOnClients(Enqueue queue) { queue(Attacker.Controller.Id, CommandId.AttackUnit, Attacker.Id, Defender.Id); queue(Defender.Controller.Id, CommandId.AttackUnit, Attacker.Id, Defender.Id); }
public override void QueueOnClients(Enqueue queue) { queue(Card.Owner.Id, CommandId.SentToGraveyard, Card.Id); queue(Card.Owner.Opponent.Id, CommandId.SentToGraveyard, Card.Id); }
public override void QueueOnClients(Enqueue queue) { queue(Controller.Id, CommandId.PlayerDeploy, Card.Id); queue(Controller.Opponent.Id, CommandId.RivalDeploy, Card.Id, Card.SetCodes); }
public override void QueueOnClients(Enqueue queue) { queue(Damaged.Id, CommandId.SetHealth, Who.Player, NewHealth); queue(Damaged.Opponent.Id, CommandId.SetHealth, Who.Rival, NewHealth); }
public override void QueueOnClients(Enqueue queue) { queue(Player.Id, CommandId.PlayerActivate, Activated.Id); queue(Player.Opponent.Id, CommandId.RivalActivate, Activated.Id, Activated.SetCodes); }
public override void QueueOnClients(Enqueue queue) { queue(Controller.Id, CommandId.PlayerLoadDeck, Deck.AsEnumerable()); queue(Controller.Opponent.Id, CommandId.RivalLoadDeck); }
public override void QueueOnClients(Enqueue queue) { queue(Attacker.Controller.Id, CommandId.AttackParticipant, Attacker.Id); queue(Attacker.Controller.Opponent.Id, CommandId.AttackParticipant, Attacker.Id); }
public override void Run() { var settings = InEngineSettings.Make(); var queue = QueueAdapter.Make(true, settings.Queue, settings.Mail); queue.ClearPendingQueue(); queue.Publish(new Echo() { VerbatimText = "Core echo command." }); new Length { QueueSettings = settings.Queue, MailSettings = settings.Mail, }.Run(); new Peek { PendingQueue = true, QueueSettings = settings.Queue, MailSettings = settings.Mail, }.Run(); Enqueue.Command(() => Console.WriteLine("Core lambda command.")) .Dispatch(); Enqueue.Command(() => new Echo { VerbatimText = "Core echo command in a lambda command." }.Run()) .Dispatch(); Enqueue.Command(new AlwaysFail()) .WriteOutputTo("queueWriteTest-TheFileShouldNotExist.txt") .WithRetries(4) .Dispatch(); Enqueue.Commands(new[] { new Echo { VerbatimText = "Chain Link 1", MailSettings = settings.Mail, }, new Echo { VerbatimText = "Chain Link 2", MailSettings = settings.Mail, }, }).Dispatch(); Enqueue.Commands(new List <AbstractCommand> { new Echo { VerbatimText = "Chain Link A", MailSettings = settings.Mail, }, new AlwaysFail(), new Echo { VerbatimText = "Chain Link C", MailSettings = settings.Mail, }, }).Dispatch(); Enqueue.Commands(new List <AbstractCommand> { new Echo { VerbatimText = "Chain Link A", MailSettings = settings.Mail, }, new AlwaysFail(), new Echo { VerbatimText = "Chain Link C", MailSettings = settings.Mail, }, }).Dispatch(); Enqueue.Commands(Enumerable.Range(0, 10).Select(x => new AlwaysSucceed() as AbstractCommand).ToList()) .Dispatch(); var queueWriteIntegrationTest = "queueWriteIntegrationTest.txt"; var queueAppendIntegrationTest = "queueAppendIntegrationTest.txt"; File.Delete(queueWriteIntegrationTest); File.Delete(queueAppendIntegrationTest); Enqueue.Command(new Echo { VerbatimText = "Core echo command.", MailSettings = settings.Mail, }) .PingAfter("http://www.google.com") .PingBefore("http://www.google.com") .EmailOutputTo("*****@*****.**") .WriteOutputTo(queueWriteIntegrationTest) .AppendOutputTo(queueAppendIntegrationTest) .Dispatch(); }
public override void QueueOnClients(Enqueue queue) { queue(Loser.Id, CommandId.GameOver, IsLoser); queue(Loser.Opponent.Id, CommandId.GameOver, !IsLoser); }
public abstract void QueueOnClients(Enqueue queue);
public override void QueueOnClients(Enqueue queue) { queue(Player.Id, CommandId.EndTurn); queue(Player.Opponent.Id, CommandId.EndTurn); }
public IHttpActionResult Get() { Enqueue.Command(new SayHello()).Dispatch(); return(Ok("ok")); }