Example #1
0
        /// <summary>
        /// Fetch a specific Bucket.
        /// </summary>
        /// <param name="options"> Fetch Bucket parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Bucket </returns>
        public static BucketResource Fetch(FetchBucketOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// Fetch a specific Bucket.
        /// </summary>
        /// <param name="options"> Fetch Bucket parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Bucket </returns>
        public static async System.Threading.Tasks.Task <BucketResource> FetchAsync(FetchBucketOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #3
0
        /// <summary>
        /// Fetch a specific Bucket.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service that the resource is associated with </param>
        /// <param name="pathRateLimitSid"> Rate Limit Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Bucket. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Bucket </returns>
        public static async System.Threading.Tasks.Task <BucketResource> FetchAsync(string pathServiceSid,
                                                                                    string pathRateLimitSid,
                                                                                    string pathSid,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new FetchBucketOptions(pathServiceSid, pathRateLimitSid, pathSid);

            return(await FetchAsync(options, client));
        }
Example #4
0
        /// <summary>
        /// Fetch a specific Bucket.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service that the resource is associated with </param>
        /// <param name="pathRateLimitSid"> Rate Limit Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Bucket. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Bucket </returns>
        public static BucketResource Fetch(string pathServiceSid,
                                           string pathRateLimitSid,
                                           string pathSid,
                                           ITwilioRestClient client = null)
        {
            var options = new FetchBucketOptions(pathServiceSid, pathRateLimitSid, pathSid);

            return(Fetch(options, client));
        }
Example #5
0
 private static Request BuildFetchRequest(FetchBucketOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Verify,
                "/v2/Services/" + options.PathServiceSid + "/RateLimits/" + options.PathRateLimitSid + "/Buckets/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }