예제 #1
0
        /// <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));
        }
예제 #2
0
 private static Request BuildCreateRequest(CreateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Verify,
                "/v1/Services",
                client.Region,
                postParams: options.GetParams()
                ));
 }
예제 #3
0
        /// <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));
        }
예제 #4
0
        /// <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));
        }
예제 #5
0
        /// <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));
        }
예제 #6
0
        /// <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));
        }
예제 #7
0
        /// <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));
        }