Ejemplo n.º 1
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
 private static Request BuildUpdateRequest(UpdateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Verify,
                "/v1/Services/" + options.PathSid + "",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        /// <param name="pathSid"> Service Sid. </param>
        /// <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> UpdateAsync(string pathSid,
                                                                                      string friendlyName      = null,
                                                                                      int?codeLength           = null,
                                                                                      bool?lookupEnabled       = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled
            };

            return(await UpdateAsync(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        /// <param name="pathSid"> Service Sid. </param>
        /// <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 Update(string pathSid,
                                             string friendlyName      = null,
                                             int?codeLength           = null,
                                             bool?lookupEnabled       = null,
                                             ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled
            };

            return(Update(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        /// <param name="pathSid"> Service Sid. </param>
        /// <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> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(string pathSid,
                                                                                      string friendlyName      = null,
                                                                                      int?codeLength           = null,
                                                                                      bool?lookupEnabled       = null,
                                                                                      bool?skipSmsToLandlines  = null,
                                                                                      bool?dtmfInputRequired   = null,
                                                                                      string ttsName           = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName
            };

            return(await UpdateAsync(options, client));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        /// <param name="pathSid"> Service Sid. </param>
        /// <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> A single instance of Service </returns>
        public static ServiceResource Update(string pathSid,
                                             string friendlyName      = null,
                                             int?codeLength           = null,
                                             bool?lookupEnabled       = null,
                                             bool?skipSmsToLandlines  = null,
                                             bool?dtmfInputRequired   = null,
                                             string ttsName           = null,
                                             bool?psd2Enabled         = null,
                                             ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled
            };

            return(Update(options, client));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        /// <param name="options"> Update 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> UpdateAsync(UpdateServiceOptions options,
                                                                                      ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }