コード例 #1
0
        /// <summary>
        /// Update a specific 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));
        }
コード例 #2
0
 private static Request BuildUpdateRequest(UpdateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Verify,
                "/v2/Services/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
コード例 #3
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> A string to describe the verification service </param>
        /// <param name="codeLength"> The length of the verification code to generate </param>
        /// <param name="lookupEnabled"> Whether to perform a lookup with each verification </param>
        /// <param name="skipSmsToLandlines"> Whether to skip sending SMS verifications to landlines </param>
        /// <param name="dtmfInputRequired"> Whether to ask the user to press a number before delivering the verify code in a
        ///                         phone call </param>
        /// <param name="ttsName"> The name of an alternative text-to-speech service to use in phone calls </param>
        /// <param name="psd2Enabled"> Whether to pass PSD2 transaction parameters when starting a verification </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,
                                                                                      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(await UpdateAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// Update a specific Verification Service.
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> A string to describe the verification service </param>
        /// <param name="codeLength"> The length of the verification code to generate </param>
        /// <param name="lookupEnabled"> Whether to perform a lookup with each verification </param>
        /// <param name="skipSmsToLandlines"> Whether to skip sending SMS verifications to landlines </param>
        /// <param name="dtmfInputRequired"> Whether to ask the user to press a number before delivering the verify code in a
        ///                         phone call </param>
        /// <param name="ttsName"> The name of an alternative text-to-speech service to use in phone calls </param>
        /// <param name="psd2Enabled"> Whether to pass PSD2 transaction parameters when starting a verification </param>
        /// <param name="doNotShareWarningEnabled"> Whether to add a privacy warning at the end of an SMS. </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,
                                             bool?doNotShareWarningEnabled = null,
                                             ITwilioRestClient client      = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled
            };

            return(Update(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Update a specific Verification Service.
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> A string to describe the verification service </param>
        /// <param name="codeLength"> The length of the verification code to generate </param>
        /// <param name="lookupEnabled"> Whether to perform a lookup with each verification </param>
        /// <param name="skipSmsToLandlines"> Whether to skip sending SMS verifications to landlines </param>
        /// <param name="dtmfInputRequired"> Whether to ask the user to press a number before delivering the verify code in a
        ///                         phone call </param>
        /// <param name="ttsName"> The name of an alternative text-to-speech service to use in phone calls </param>
        /// <param name="psd2Enabled"> Whether to pass PSD2 transaction parameters when starting a verification </param>
        /// <param name="doNotShareWarningEnabled"> Whether to add a privacy warning at the end of an SMS. </param>
        /// <param name="customCodeEnabled"> Whether to allow sending verifications with a custom code. </param>
        /// <param name="pushIncludeDate"> Optional. Include the date in the Challenge's reponse. Default: true </param>
        /// <param name="pushApnCredentialSid"> Optional. Set APN Credential for this service. </param>
        /// <param name="pushFcmCredentialSid"> Optional. Set FCM Credential for this service. </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,
                                                                                      bool?psd2Enabled              = null,
                                                                                      bool?doNotShareWarningEnabled = null,
                                                                                      bool?customCodeEnabled        = null,
                                                                                      bool?pushIncludeDate          = null,
                                                                                      string pushApnCredentialSid   = null,
                                                                                      string pushFcmCredentialSid   = null,
                                                                                      ITwilioRestClient client      = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid
            };

            return(await UpdateAsync(options, client));
        }
コード例 #6
0
        /// <summary>
        /// Update a specific 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));
        }