/// <summary> /// Update an instance of a usage trigger /// </summary> /// /// <param name="options"> Update Trigger parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Trigger </returns> public static TriggerResource Update(UpdateTriggerOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Update an instance of a usage trigger /// </summary> /// /// <param name="pathSid"> The sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="callbackMethod"> HTTP method to use with callback_url </param> /// <param name="callbackUrl"> URL Twilio will request when the trigger fires </param> /// <param name="friendlyName"> A user-specified, human-readable name for the trigger. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Trigger </returns> public static async System.Threading.Tasks.Task <TriggerResource> UpdateAsync(string pathSid, string pathAccountSid = null, Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, string friendlyName = null, ITwilioRestClient client = null) { var options = new UpdateTriggerOptions(pathSid) { PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName }; return(await UpdateAsync(options, client)); }
/// <summary> /// Update an instance of a usage trigger /// </summary> /// /// <param name="pathSid"> The sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="callbackMethod"> HTTP method to use with callback_url </param> /// <param name="callbackUrl"> URL Twilio will request when the trigger fires </param> /// <param name="friendlyName"> A user-specified, human-readable name for the trigger. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Trigger </returns> public static TriggerResource Update(string pathSid, string pathAccountSid = null, Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, string friendlyName = null, ITwilioRestClient client = null) { var options = new UpdateTriggerOptions(pathSid) { PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName }; return(Update(options, client)); }
private static Request BuildUpdateRequest(UpdateTriggerOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Usage/Triggers/" + options.PathSid + ".json", client.Region, postParams: options.GetParams() )); }
/// <summary> /// Update an instance of a usage trigger /// </summary> /// /// <param name="options"> Update Trigger parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Trigger </returns> public static async System.Threading.Tasks.Task <TriggerResource> UpdateAsync(UpdateTriggerOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }