/// <summary> /// Updates the application's properties /// </summary> /// <param name="pathSid"> The unique string that identifies the resource </param> /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param> /// <param name="friendlyName"> A string to describe the resource </param> /// <param name="apiVersion"> The API version to use to start a new TwiML session </param> /// <param name="voiceUrl"> The URL to call when the phone number receives a call </param> /// <param name="voiceMethod"> The HTTP method to use with the voice_url </param> /// <param name="voiceFallbackUrl"> The URL to call when a TwiML error occurs </param> /// <param name="voiceFallbackMethod"> The HTTP method to use with voice_fallback_url </param> /// <param name="statusCallback"> The URL to send status information to your application </param> /// <param name="statusCallbackMethod"> The HTTP method to use to call status_callback </param> /// <param name="voiceCallerIdLookup"> Whether to lookup the caller's name </param> /// <param name="smsUrl"> The URL to call when the phone number receives an incoming SMS message </param> /// <param name="smsMethod"> The HTTP method to use with sms_url </param> /// <param name="smsFallbackUrl"> The URL to call when an error occurs while retrieving or executing the TwiML </param> /// <param name="smsFallbackMethod"> The HTTP method to use with sms_fallback_url </param> /// <param name="smsStatusCallback"> Same as message_status_callback. Deprecated, included for backwards compatibility. /// </param> /// <param name="messageStatusCallback"> The URL to send message status information to your application </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Application </returns> public static async System.Threading.Tasks.Task <ApplicationResource> UpdateAsync(string pathSid, string pathAccountSid = null, string friendlyName = null, string apiVersion = null, Uri voiceUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Uri voiceFallbackUrl = null, Twilio.Http.HttpMethod voiceFallbackMethod = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, bool?voiceCallerIdLookup = null, Uri smsUrl = null, Twilio.Http.HttpMethod smsMethod = null, Uri smsFallbackUrl = null, Twilio.Http.HttpMethod smsFallbackMethod = null, Uri smsStatusCallback = null, Uri messageStatusCallback = null, ITwilioRestClient client = null) { var options = new UpdateApplicationOptions(pathSid) { PathAccountSid = pathAccountSid, FriendlyName = friendlyName, ApiVersion = apiVersion, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceCallerIdLookup = voiceCallerIdLookup, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsStatusCallback = smsStatusCallback, MessageStatusCallback = messageStatusCallback }; return(await UpdateAsync(options, client)); }
/// <summary> /// Updates the application's properties /// </summary> /// <param name="options"> Update Application parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Application </returns> public static ApplicationResource Update(UpdateApplicationOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildUpdateRequest(UpdateApplicationOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Applications/" + options.PathSid + ".json", postParams: options.GetParams() )); }
/// <summary> /// Updates the application's properties /// </summary> /// <param name="options"> Update Application parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Application </returns> public static async System.Threading.Tasks.Task <ApplicationResource> UpdateAsync(UpdateApplicationOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }