/// <summary> /// update /// </summary> /// <param name="options"> Update Address parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Address </returns> public static AddressResource Update(UpdateAddressOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildUpdateRequest(UpdateAddressOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Addresses/" + options.PathSid + ".json", postParams: options.GetParams() )); }
/// <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="customerName"> The customer_name </param> /// <param name="street"> The street </param> /// <param name="city"> The city </param> /// <param name="region"> The region </param> /// <param name="postalCode"> The postal_code </param> /// <param name="emergencyEnabled"> The emergency_enabled </param> /// <param name="autoCorrectAddress"> The auto_correct_address </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Address </returns> public static async System.Threading.Tasks.Task <AddressResource> UpdateAsync(string pathSid, string pathAccountSid = null, string friendlyName = null, string customerName = null, string street = null, string city = null, string region = null, string postalCode = null, bool?emergencyEnabled = null, bool?autoCorrectAddress = null, ITwilioRestClient client = null) { var options = new UpdateAddressOptions(pathSid) { PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CustomerName = customerName, Street = street, City = city, Region = region, PostalCode = postalCode, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress }; 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="customerName"> The customer_name </param> /// <param name="street"> The street </param> /// <param name="city"> The city </param> /// <param name="region"> The region </param> /// <param name="postalCode"> The postal_code </param> /// <param name="emergencyEnabled"> The emergency_enabled </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Address </returns> public static AddressResource Update(string pathSid, string pathAccountSid = null, string friendlyName = null, string customerName = null, string street = null, string city = null, string region = null, string postalCode = null, bool?emergencyEnabled = null, ITwilioRestClient client = null) { var options = new UpdateAddressOptions(pathSid) { PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CustomerName = customerName, Street = street, City = city, Region = region, PostalCode = postalCode, EmergencyEnabled = emergencyEnabled }; return(Update(options, client)); }
/// <summary> /// update /// </summary> /// <param name="options"> Update Address parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Address </returns> public static async System.Threading.Tasks.Task <AddressResource> UpdateAsync(UpdateAddressOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }