/// <summary> /// Updates the given properties of a Sim instance from your account. /// </summary> /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param> /// <param name="uniqueName"> A user-provided string that uniquely identifies this resource as an alternative to the /// Sid. </param> /// <param name="callbackMethod"> The HTTP method Twilio will use when making a request to the callback URL. </param> /// <param name="callbackUrl"> Twilio will make a request to this URL when the Sim has finished updating. </param> /// <param name="friendlyName"> A user-provided string that identifies this resource. </param> /// <param name="ratePlan"> The Sid or UniqueName of the RatePlan that this Sim should use. </param> /// <param name="status"> A string representing the status of the Sim. </param> /// <param name="commandsCallbackMethod"> A string representing the HTTP method to use when making a request to /// CommandsCallbackUrl. </param> /// <param name="commandsCallbackUrl"> The URL that will receive a webhook when this Sim originates a Command. </param> /// <param name="smsFallbackMethod"> The HTTP method Twilio will use when requesting the sms_fallback_url. </param> /// <param name="smsFallbackUrl"> The URL that Twilio will request if an error occurs retrieving or executing the TwiML /// requested by sms_url. </param> /// <param name="smsMethod"> The HTTP method Twilio will use when requesting the above Url. </param> /// <param name="smsUrl"> The URL Twilio will request when the SIM-connected device sends an SMS message that is not a /// Command. </param> /// <param name="voiceFallbackMethod"> The HTTP method Twilio will use when requesting the voice_fallback_url. </param> /// <param name="voiceFallbackUrl"> The URL that Twilio will request if an error occurs retrieving or executing the /// TwiML requested by voice_url. </param> /// <param name="voiceMethod"> The HTTP method Twilio will use when requesting the above Url. </param> /// <param name="voiceUrl"> The URL Twilio will request when the SIM-connected device makes a call. </param> /// <param name="resetStatus"> Initiate a connectivity reset on a Sim. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Sim </returns> public static async System.Threading.Tasks.Task <SimResource> UpdateAsync(string pathSid, string uniqueName = null, Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, string friendlyName = null, string ratePlan = null, SimResource.StatusEnum status = null, Twilio.Http.HttpMethod commandsCallbackMethod = null, Uri commandsCallbackUrl = null, Twilio.Http.HttpMethod smsFallbackMethod = null, Uri smsFallbackUrl = null, Twilio.Http.HttpMethod smsMethod = null, Uri smsUrl = null, Twilio.Http.HttpMethod voiceFallbackMethod = null, Uri voiceFallbackUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Uri voiceUrl = null, SimResource.ResetStatusEnum resetStatus = null, ITwilioRestClient client = null) { var options = new UpdateSimOptions(pathSid) { UniqueName = uniqueName, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName, RatePlan = ratePlan, Status = status, CommandsCallbackMethod = commandsCallbackMethod, CommandsCallbackUrl = commandsCallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, ResetStatus = resetStatus }; return(await UpdateAsync(options, client)); }
/// <summary> /// Updates the given properties of a Sim instance from your account. /// </summary> /// <param name="options"> Update Sim parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Sim </returns> public static SimResource Update(UpdateSimOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// update /// </summary> /// /// <param name="options"> Update Sim parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Sim </returns> public static async System.Threading.Tasks.Task <SimResource> UpdateAsync(UpdateSimOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Updates the given properties of a Sim instance from your account. /// </summary> /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param> /// <param name="uniqueName"> A user-provided string that uniquely identifies this resource as an alternative to the /// Sid. </param> /// <param name="callbackMethod"> The HTTP method Twilio will use when making a request to the callback URL. </param> /// <param name="callbackUrl"> Twilio will make a request to this URL when the Sim has finished updating. </param> /// <param name="friendlyName"> A user-provided string that identifies this resource. </param> /// <param name="ratePlan"> The Sid or UniqueName of the RatePlan that this Sim should use. </param> /// <param name="status"> A string representing the status of the Sim. </param> /// <param name="commandsCallbackMethod"> A string representing the HTTP method to use when making a request to /// CommandsCallbackUrl. </param> /// <param name="commandsCallbackUrl"> The URL that will receive a webhook when this Sim originates a Command. </param> /// <param name="smsFallbackMethod"> The HTTP method Twilio will use when requesting the sms_fallback_url. </param> /// <param name="smsFallbackUrl"> The URL that Twilio will request if an error occurs retrieving or executing the TwiML /// requested by sms_url. </param> /// <param name="smsMethod"> The HTTP method Twilio will use when requesting the above Url. </param> /// <param name="smsUrl"> The URL Twilio will request when the SIM-connected device sends an SMS message that is not a /// Command. </param> /// <param name="voiceFallbackMethod"> The HTTP method Twilio will use when requesting the voice_fallback_url. </param> /// <param name="voiceFallbackUrl"> The URL that Twilio will request if an error occurs retrieving or executing the /// TwiML requested by voice_url. </param> /// <param name="voiceMethod"> The HTTP method Twilio will use when requesting the above Url. </param> /// <param name="voiceUrl"> The URL Twilio will request when the SIM-connected device makes a call. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Sim </returns> public static SimResource Update(string pathSid, string uniqueName = null, Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, string friendlyName = null, string ratePlan = null, SimResource.StatusEnum status = null, Twilio.Http.HttpMethod commandsCallbackMethod = null, Uri commandsCallbackUrl = null, Twilio.Http.HttpMethod smsFallbackMethod = null, Uri smsFallbackUrl = null, Twilio.Http.HttpMethod smsMethod = null, Uri smsUrl = null, Twilio.Http.HttpMethod voiceFallbackMethod = null, Uri voiceFallbackUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Uri voiceUrl = null, ITwilioRestClient client = null) { var options = new UpdateSimOptions(pathSid) { UniqueName = uniqueName, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName, RatePlan = ratePlan, Status = status, CommandsCallbackMethod = commandsCallbackMethod, CommandsCallbackUrl = commandsCallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl }; return(Update(options, client)); }
private static Request BuildUpdateRequest(UpdateSimOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Wireless, "/v1/Sims/" + options.PathSid + "", postParams: options.GetParams() )); }