/// <summary>
        /// Update a specific Short Code.
        /// </summary>
        /// <param name="options"> Update ShortCode parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ShortCode </returns>
        public static ShortCodeResource Update(UpdateShortCodeOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildUpdateRequest(UpdateShortCodeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Proxy,
                "/v1/Services/" + options.PathServiceSid + "/ShortCodes/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Update a specific Short Code.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="isReserved"> Whether the short code should be reserved for manual assignment to participants only
        ///                  </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ShortCode </returns>
        public static async System.Threading.Tasks.Task <ShortCodeResource> UpdateAsync(string pathServiceSid,
                                                                                        string pathSid,
                                                                                        bool?isReserved          = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new UpdateShortCodeOptions(pathServiceSid, pathSid)
            {
                IsReserved = isReserved
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// Update a specific Short Code.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="isReserved"> Whether the short code should be reserved for manual assignment to participants only
        ///                  </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ShortCode </returns>
        public static ShortCodeResource Update(string pathServiceSid,
                                               string pathSid,
                                               bool?isReserved          = null,
                                               ITwilioRestClient client = null)
        {
            var options = new UpdateShortCodeOptions(pathServiceSid, pathSid)
            {
                IsReserved = isReserved
            };

            return(Update(options, client));
        }
        /// <summary>
        /// Update a specific Short Code.
        /// </summary>
        /// <param name="options"> Update ShortCode parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ShortCode </returns>
        public static async System.Threading.Tasks.Task <ShortCodeResource> UpdateAsync(UpdateShortCodeOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }