Exemplo n.º 1
0
        /// <summary>
        /// Fetch an instance of a queue identified by the QueueSid
        /// </summary>
        /// <param name="options"> Fetch Queue parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Queue </returns>
        public static QueueResource Fetch(FetchQueueOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Fetch an instance of a queue identified by the QueueSid
        /// </summary>
        ///
        /// <param name="options"> Fetch 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 <QueueResource> FetchAsync(FetchQueueOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Fetch an instance of a queue identified by the QueueSid
        /// </summary>
        /// <param name="pathSid"> Fetch by unique queue Sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Queue </returns>
        public static QueueResource Fetch(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchQueueOptions(pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(Fetch(options, client));
        }
Exemplo n.º 4
0
 private static Request BuildFetchRequest(FetchQueueOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Queues/" + options.PathSid + ".json",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Fetch an instance of a queue identified by the QueueSid
        /// </summary>
        ///
        /// <param name="pathSid"> Fetch by unique queue Sid </param>
        /// <param name="pathAccountSid"> The account_sid </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 <QueueResource> FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchQueueOptions(pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(await FetchAsync(options, client));
        }