public Queue CreateQueue(string name, int size, string waitUrl, int waitTime) { var queue = twilio.CreateQueue(name); TwilioProvider.ThrowIfError(queue); return(new Queue(queue.Sid, name, size, waitUrl, waitTime)); }
public void ShouldDeleteQueue() { var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken); var originalQueue = client.CreateQueue("ShouldDeleteQueue"); var status = client.DeleteQueue(originalQueue.Sid); Assert.AreEqual(DeleteStatus.Success, status); }
public void ShouldCreateNewQueue() { var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken); var result = client.CreateQueue("ShouldCreateNewQueue"); Assert.IsNotNull(result); Assert.IsNull(result.RestException); Assert.IsNotNull(result.Sid); client.DeleteQueue(result.Sid); //cleanup }
static void Main(string[] args) { // Find your Account Sid and Auth Token at twilio.com/user/account string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; string AuthToken = "your_auth_token"; var twilio = new TwilioRestClient(AccountSid, AuthToken); var queue = twilio.CreateQueue("newqueue"); Console.WriteLine(queue.Sid); }
public Queue CreateQueue(string name, int size, string waitUrl, int waitTime) { var queues = twilio.ListQueues(); var queue = queues.Queues.FirstOrDefault(r => r.FriendlyName == name); if (queue == null) { queue = twilio.CreateQueue(name); TwilioProvider.ThrowIfError(queue); } return(new Queue(queue.Sid, name, size, waitUrl, waitTime)); }
public void ShouldUpdateQueue() { var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken); var originalQueue = client.CreateQueue("ShouldUpdateQueue"); var queuesid = originalQueue.Sid; var result = client.UpdateQueue(queuesid, "ShouldUpdateQueueUpdated", originalQueue.MaxSize.Value); Assert.IsNotNull(result); Assert.IsNull(result.RestException); Assert.AreEqual("ShouldUpdateQueueUpdated", result.FriendlyName); client.DeleteQueue(queuesid); //cleanup }
public void ShouldGetQueue() { var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken); var originalQueue = client.CreateQueue("ShouldGetQueue"); var queuesid = originalQueue.Sid; var result = client.GetQueue(queuesid); Assert.IsNotNull(result); Assert.IsNull(result.RestException); Assert.IsNotNull(result.Sid); client.DeleteQueue(queuesid); //cleanup }