Пример #1
0
        /// <summary>
        /// Update a specific Rate Limit.
        /// </summary>
        /// <param name="options"> Update RateLimit parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of RateLimit </returns>
        public static RateLimitResource Update(UpdateRateLimitOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildUpdateRequest(UpdateRateLimitOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Verify,
                "/v2/Services/" + options.PathServiceSid + "/RateLimits/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Пример #3
0
        /// <summary>
        /// Update a specific Rate Limit.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service that the resource is associated with </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="description"> Description of this Rate Limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of RateLimit </returns>
        public static async System.Threading.Tasks.Task <RateLimitResource> UpdateAsync(string pathServiceSid,
                                                                                        string pathSid,
                                                                                        string description       = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new UpdateRateLimitOptions(pathServiceSid, pathSid)
            {
                Description = description
            };

            return(await UpdateAsync(options, client));
        }
Пример #4
0
        /// <summary>
        /// Update a specific Rate Limit.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service that the resource is associated with </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="description"> Description of this Rate Limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of RateLimit </returns>
        public static RateLimitResource Update(string pathServiceSid,
                                               string pathSid,
                                               string description       = null,
                                               ITwilioRestClient client = null)
        {
            var options = new UpdateRateLimitOptions(pathServiceSid, pathSid)
            {
                Description = description
            };

            return(Update(options, client));
        }
Пример #5
0
        /// <summary>
        /// Update a specific Rate Limit.
        /// </summary>
        /// <param name="options"> Update RateLimit parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of RateLimit </returns>
        public static async System.Threading.Tasks.Task <RateLimitResource> UpdateAsync(UpdateRateLimitOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }