/// <summary>
        /// challenge a specific Verification Check.
        /// </summary>
        /// <param name="options"> Create VerificationCheck parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of VerificationCheck </returns>
        public static VerificationCheckResource Create(CreateVerificationCheckOptions options,
                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildCreateRequest(CreateVerificationCheckOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Verify,
                "/v1/Services/" + options.PathServiceSid + "/VerificationCheck",
                client.Region,
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// challenge a specific Verification Check.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Verify Service to be used to check a verification. </param>
        /// <param name="code"> The verification string </param>
        /// <param name="to"> To phonenumber </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of VerificationCheck </returns>
        public static VerificationCheckResource Create(string pathServiceSid,
                                                       string code,
                                                       string to = null,
                                                       ITwilioRestClient client = null)
        {
            var options = new CreateVerificationCheckOptions(pathServiceSid, code)
            {
                To = to
            };

            return(Create(options, client));
        }
        /// <summary>
        /// challenge a specific Verification Check.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Verify Service to be used to check a verification. </param>
        /// <param name="code"> The verification string </param>
        /// <param name="to"> To phonenumber </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of VerificationCheck </returns>
        public static async System.Threading.Tasks.Task <VerificationCheckResource> CreateAsync(string pathServiceSid,
                                                                                                string code,
                                                                                                string to = null,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new CreateVerificationCheckOptions(pathServiceSid, code)
            {
                To = to
            };

            return(await CreateAsync(options, client));
        }
Beispiel #5
0
        /// <summary>
        /// challenge a specific Verification Check.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Verify Service to be used to check a verification. </param>
        /// <param name="code"> The verification string </param>
        /// <param name="to"> To phone number </param>
        /// <param name="verificationSid"> A SID that uniquely identifies this Verification Check </param>
        /// <param name="amount"> Amount of the associated PSD2 compliant transaction. </param>
        /// <param name="payee"> Payee of the associated PSD2 compliant transaction. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of VerificationCheck </returns>
        public static VerificationCheckResource Create(string pathServiceSid,
                                                       string code,
                                                       string to = null,
                                                       string verificationSid   = null,
                                                       string amount            = null,
                                                       string payee             = null,
                                                       ITwilioRestClient client = null)
        {
            var options = new CreateVerificationCheckOptions(pathServiceSid, code)
            {
                To = to, VerificationSid = verificationSid, Amount = amount, Payee = payee
            };

            return(Create(options, client));
        }
        /// <summary>
        /// challenge a specific Verification Check.
        /// </summary>
        /// <param name="options"> Create VerificationCheck parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of VerificationCheck </returns>
        public static async System.Threading.Tasks.Task <VerificationCheckResource> CreateAsync(CreateVerificationCheckOptions options,
                                                                                                ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }