/// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update Sandbox parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sandbox </returns>
        public static SandboxResource Update(UpdateSandboxOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="voiceUrl"> The voice_url </param>
        /// <param name="voiceMethod"> The voice_method </param>
        /// <param name="smsUrl"> The sms_url </param>
        /// <param name="smsMethod"> The sms_method </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sandbox </returns>
        public static async System.Threading.Tasks.Task <SandboxResource> UpdateAsync(string pathAccountSid = null, Uri voiceUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Uri smsUrl = null, Twilio.Http.HttpMethod smsMethod = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, ITwilioRestClient client = null)
        {
            var options = new UpdateSandboxOptions {
                PathAccountSid = pathAccountSid, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, SmsUrl = smsUrl, SmsMethod = smsMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="voiceUrl"> The voice_url </param>
        /// <param name="voiceMethod"> The voice_method </param>
        /// <param name="smsUrl"> The sms_url </param>
        /// <param name="smsMethod"> The sms_method </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sandbox </returns>
        public static SandboxResource Update(string pathAccountSid = null, Uri voiceUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Uri smsUrl = null, Twilio.Http.HttpMethod smsMethod = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, ITwilioRestClient client = null)
        {
            var options = new UpdateSandboxOptions {
                PathAccountSid = pathAccountSid, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, SmsUrl = smsUrl, SmsMethod = smsMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod
            };

            return(Update(options, client));
        }
 private static Request BuildUpdateRequest(UpdateSandboxOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Sandbox.json",
                client.Region,
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update Sandbox parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sandbox </returns>
        public static async System.Threading.Tasks.Task <SandboxResource> UpdateAsync(UpdateSandboxOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }