/// <summary> /// update /// </summary> /// <param name="options"> Update Key parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Key </returns> public static KeyResource Update(UpdateKeyOptions 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 Key parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Key </returns> public static async System.Threading.Tasks.Task <KeyResource> UpdateAsync(UpdateKeyOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// update /// </summary> /// /// <param name="pathSid"> The sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="friendlyName"> The friendly_name </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Key </returns> public static async System.Threading.Tasks.Task <KeyResource> UpdateAsync(string pathSid, string pathAccountSid = null, string friendlyName = null, ITwilioRestClient client = null) { var options = new UpdateKeyOptions(pathSid) { PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// /// <param name="pathSid"> The sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="friendlyName"> The friendly_name </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Key </returns> public static KeyResource Update(string pathSid, string pathAccountSid = null, string friendlyName = null, ITwilioRestClient client = null) { var options = new UpdateKeyOptions(pathSid) { PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return(Update(options, client)); }
private static Request BuildUpdateRequest(UpdateKeyOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Keys/" + options.PathSid + ".json", postParams: options.GetParams() )); }