Example #1
0
        /// <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));
        }
Example #2
0
        /// <summary>
        /// challenge a specific Verification Check.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </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));
        }
Example #3
0
        /// <summary>
        /// challenge a specific Verification Check.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </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));
        }
Example #4
0
 private static Request BuildCreateRequest(CreateVerificationCheckOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/Verification/Services/" + options.PathServiceSid + "/VerificationCheck",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Example #5
0
        /// <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));
        }