/// <summary> /// Create a new Verification Service. /// </summary> /// <param name="options"> Create Service parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Service </returns> public static ServiceResource Create(CreateServiceOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateServiceOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Verify, "/v1/Services", client.Region, postParams: options.GetParams() )); }
/// <summary> /// Create a new Verification Service. /// </summary> /// <param name="friendlyName"> Friendly name of the service </param> /// <param name="codeLength"> Length of verification code. Valid values are 4-10 </param> /// <param name="lookupEnabled"> Indicates whether or not to perform a lookup with each verification started </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Service </returns> public static async System.Threading.Tasks.Task <ServiceResource> CreateAsync(string friendlyName, int?codeLength = null, bool?lookupEnabled = null, ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName) { CodeLength = codeLength, LookupEnabled = lookupEnabled }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Verification Service. /// </summary> /// <param name="friendlyName"> Friendly name of the service </param> /// <param name="codeLength"> Length of verification code. Valid values are 4-10 </param> /// <param name="lookupEnabled"> Indicates whether or not to perform a lookup with each verification started </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Service </returns> public static ServiceResource Create(string friendlyName, int?codeLength = null, bool?lookupEnabled = null, ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName) { CodeLength = codeLength, LookupEnabled = lookupEnabled }; return(Create(options, client)); }
/// <summary> /// Create a new Verification Service. /// </summary> /// <param name="friendlyName"> Friendly name of the service </param> /// <param name="codeLength"> Length of verification code. Valid values are 4-10 </param> /// <param name="lookupEnabled"> Indicates whether or not to perform a lookup with each verification started </param> /// <param name="skipSmsToLandlines"> Indicates whether or not to ignore SMS verifications for landlines </param> /// <param name="dtmfInputRequired"> Indicates whether or not to require a random number input to deliver the verify /// code via phone calls </param> /// <param name="ttsName"> Alternative to be used as Service friendly name in phone calls </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Service </returns> public static ServiceResource Create(string friendlyName, int?codeLength = null, bool?lookupEnabled = null, bool?skipSmsToLandlines = null, bool?dtmfInputRequired = null, string ttsName = null, ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName) { CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName }; return(Create(options, client)); }
/// <summary> /// Create a new Verification Service. /// </summary> /// <param name="friendlyName"> Friendly name of the service </param> /// <param name="codeLength"> Length of verification code. Valid values are 4-10 </param> /// <param name="lookupEnabled"> Indicates whether or not to perform a lookup with each verification started </param> /// <param name="skipSmsToLandlines"> Indicates whether or not to ignore SMS verifications for landlines </param> /// <param name="dtmfInputRequired"> Indicates whether or not to require a random number input to deliver the verify /// code via phone calls </param> /// <param name="ttsName"> Alternative to be used as Service friendly name in phone calls </param> /// <param name="psd2Enabled"> Indicates whether PSD2 parameters are enabled or not </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Service </returns> public static async System.Threading.Tasks.Task <ServiceResource> CreateAsync(string friendlyName, int?codeLength = null, bool?lookupEnabled = null, bool?skipSmsToLandlines = null, bool?dtmfInputRequired = null, string ttsName = null, bool?psd2Enabled = null, ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName) { CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Verification Service. /// </summary> /// <param name="options"> Create Service parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Service </returns> public static async System.Threading.Tasks.Task <ServiceResource> CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }