/// <summary> /// Update a specific Proxy Number. /// </summary> /// <param name="options"> Update PhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of PhoneNumber </returns> public static PhoneNumberResource Update(UpdatePhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildUpdateRequest(UpdatePhoneNumberOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Proxy, "/v1/Services/" + options.PathServiceSid + "/PhoneNumbers/" + options.PathSid + "", postParams: options.GetParams() )); }
/// <summary> /// Update a specific Proxy Number. /// </summary> /// <param name="pathServiceSid"> The SID of the parent Service resource of the PhoneNumber resource to update </param> /// <param name="pathSid"> The unique string that identifies the resource </param> /// <param name="isReserved"> Whether the new phone number should be reserved </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of PhoneNumber </returns> public static async System.Threading.Tasks.Task <PhoneNumberResource> UpdateAsync(string pathServiceSid, string pathSid, bool?isReserved = null, ITwilioRestClient client = null) { var options = new UpdatePhoneNumberOptions(pathServiceSid, pathSid) { IsReserved = isReserved }; return(await UpdateAsync(options, client)); }
/// <summary> /// Update a specific Proxy Number. /// </summary> /// <param name="pathServiceSid"> The SID of the parent Service resource of the PhoneNumber resource to update </param> /// <param name="pathSid"> The unique string that identifies the resource </param> /// <param name="isReserved"> Whether the new phone number should be reserved </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of PhoneNumber </returns> public static PhoneNumberResource Update(string pathServiceSid, string pathSid, bool?isReserved = null, ITwilioRestClient client = null) { var options = new UpdatePhoneNumberOptions(pathServiceSid, pathSid) { IsReserved = isReserved }; return(Update(options, client)); }
/// <summary> /// Update a specific Proxy Number. /// </summary> /// <param name="options"> Update PhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of PhoneNumber </returns> public static async System.Threading.Tasks.Task <PhoneNumberResource> UpdateAsync(UpdatePhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }