コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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()
                ));
 }
コード例 #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));
        }