/// <summary>
        /// Retrieve a list of queues belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Queue </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <QueueResource> > ReadAsync(string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadQueueOptions {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Retrieve a list of queues belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Queue </returns>
        public static ResourceSet <QueueResource> Read(string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadQueueOptions {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Example #3
0
        /// <summary>
        /// Retrieve a list of queues belonging to the account used to make the request
        /// </summary>
        /// <param name="options"> Read Queue parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Queue </returns>
        public static ResourceSet <QueueResource> Read(ReadQueueOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <QueueResource> .FromJson("queues", response.Content);

            return(new ResourceSet <QueueResource>(page, options, client));
        }
Example #4
0
 private static Request BuildReadRequest(ReadQueueOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Queues.json",
                queryParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// Retrieve a list of queues belonging to the account used to make the request
        /// </summary>
        /// <param name="options"> Read Queue parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Queue </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <QueueResource> > ReadAsync(ReadQueueOptions options,
                                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <QueueResource> .FromJson("queues", response.Content);

            return(new ResourceSet <QueueResource>(page, options, client));
        }