/// <summary> /// create /// </summary> /// /// <param name="options"> Create ValidationRequest parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ValidationRequest </returns> public static ValidationRequestResource Create(CreateValidationRequestOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateValidationRequestOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/OutgoingCallerIds.json", postParams: options.GetParams() )); }
/// <summary> /// create /// </summary> /// /// <param name="phoneNumber"> The phone_number </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="friendlyName"> The friendly_name </param> /// <param name="callDelay"> The call_delay </param> /// <param name="extension"> The extension </param> /// <param name="statusCallback"> The status_callback </param> /// <param name="statusCallbackMethod"> The status_callback_method </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ValidationRequest </returns> public static ValidationRequestResource Create(Types.PhoneNumber phoneNumber, string pathAccountSid = null, string friendlyName = null, int?callDelay = null, string extension = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, ITwilioRestClient client = null) { var options = new CreateValidationRequestOptions(phoneNumber) { PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CallDelay = callDelay, Extension = extension, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod }; return(Create(options, client)); }
/// <summary> /// create /// </summary> /// <param name="options"> Create ValidationRequest parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ValidationRequest </returns> public static async System.Threading.Tasks.Task <ValidationRequestResource> CreateAsync(CreateValidationRequestOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }