/// <summary> /// create /// </summary> /// /// <param name="options"> Create PhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of PhoneNumber </returns> public static PhoneNumberResource Create(CreatePhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// create /// </summary> /// <param name="pathTrunkSid"> The SID of the Trunk to associate the phone number with </param> /// <param name="phoneNumberSid"> The SID of the Incoming Phone Number that you want to associate with the trunk /// </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> CreateAsync(string pathTrunkSid, string phoneNumberSid, ITwilioRestClient client = null) { var options = new CreatePhoneNumberOptions(pathTrunkSid, phoneNumberSid); return(await CreateAsync(options, client)); }
private static Request BuildCreateRequest(CreatePhoneNumberOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Trunking, "/v1/Trunks/" + options.PathTrunkSid + "/PhoneNumbers", postParams: options.GetParams() )); }
/// <summary> /// create /// </summary> /// /// <param name="pathTrunkSid"> The trunk_sid </param> /// <param name="phoneNumberSid"> The phone_number_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of PhoneNumber </returns> public static PhoneNumberResource Create(string pathTrunkSid, string phoneNumberSid, ITwilioRestClient client = null) { var options = new CreatePhoneNumberOptions(pathTrunkSid, phoneNumberSid); return(Create(options, client)); }
/// <summary> /// create /// </summary> /// /// <param name="options"> Create 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> CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }