Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> The sid </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="callbackMethod"> The callback_method </param>
        /// <param name="callbackUrl"> The callback_url </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="ratePlan"> The rate_plan </param>
        /// <param name="status"> The status </param>
        /// <param name="commandsCallbackMethod"> The commands_callback_method </param>
        /// <param name="commandsCallbackUrl"> The commands_callback_url </param>
        /// <param name="smsFallbackMethod"> The sms_fallback_method </param>
        /// <param name="smsFallbackUrl"> The sms_fallback_url </param>
        /// <param name="smsMethod"> The sms_method </param>
        /// <param name="smsUrl"> The sms_url </param>
        /// <param name="voiceFallbackMethod"> The voice_fallback_method </param>
        /// <param name="voiceFallbackUrl"> The voice_fallback_url </param>
        /// <param name="voiceMethod"> The voice_method </param>
        /// <param name="voiceUrl"> The voice_url </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,
                                                                                  string callbackMethod = null,
                                                                                  Uri callbackUrl       = null,
                                                                                  string friendlyName   = null,
                                                                                  string ratePlan       = null,
                                                                                  string 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(await UpdateAsync(options, client));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// update
        /// </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));
        }
Ejemplo n.º 4
0
 private static Request BuildUpdateRequest(UpdateSimOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/wireless/Sims/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }