示例#1
0
        /// <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));
        }
示例#2
0
        /// <summary>
        /// Updates the given properties of a Sim resource on your Account.
        /// </summary>
        /// <param name="pathSid"> The SID of the Sim resource to update </param>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="callbackMethod"> The HTTP method we should use to call callback_url </param>
        /// <param name="callbackUrl"> The URL we should call when the Sim resource has finished updating </param>
        /// <param name="friendlyName"> A string to describe the Sim resource </param>
        /// <param name="ratePlan"> The SID or unique name of the RatePlan resource to which the Sim resource should be
        ///                assigned </param>
        /// <param name="status"> The new status of the Sim resource </param>
        /// <param name="commandsCallbackMethod"> The HTTP method we should use to call commands_callback_url </param>
        /// <param name="commandsCallbackUrl"> The URL we should call when the SIM sends a Command </param>
        /// <param name="smsFallbackMethod"> The HTTP method we should use to call sms_fallback_url </param>
        /// <param name="smsFallbackUrl"> The URL we should call when an error occurs while retrieving or executing the TwiML
        ///                      requested from sms_url </param>
        /// <param name="smsMethod"> The HTTP method we should use to call sms_url </param>
        /// <param name="smsUrl"> The URL we should call when the SIM-connected device sends an SMS message that is not a
        ///              Command </param>
        /// <param name="voiceFallbackMethod"> The HTTP method we should use to call voice_fallback_url </param>
        /// <param name="voiceFallbackUrl"> The URL we should call when an error occurs while retrieving or executing the TwiML
        ///                        requested from voice_url </param>
        /// <param name="voiceMethod"> The HTTP method we should use when we call voice_url </param>
        /// <param name="voiceUrl"> The URL we should call when the SIM-connected device makes a voice call </param>
        /// <param name="resetStatus"> Initiate a connectivity reset on a SIM </param>
        /// <param name="accountSid"> The SID of the Account to which the Sim resource should belong </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,
                                         SimResource.ResetStatusEnum resetStatus = null,
                                         string accountSid        = 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, AccountSid = accountSid
            };

            return(Update(options, client));
        }