/// <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, "/v2/Services/" + options.PathServiceSid + "/VerificationCheck", postParams: options.GetParams() ); }
/// <summary> /// challenge a specific Verification Check. /// </summary> /// <param name="pathServiceSid"> The SID of the verification Service to create the resource under </param> /// <param name="code"> The verification string </param> /// <param name="to"> The phone number or email to verify </param> /// <param name="verificationSid"> A SID that uniquely identifies the Verification Check </param> /// <param name="amount"> The amount of the associated PSD2 compliant transaction. </param> /// <param name="payee"> The 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="pathServiceSid"> The SID of the verification Service to create the resource under </param> /// <param name="code"> The verification string </param> /// <param name="to"> The phone number or email to verify </param> /// <param name="verificationSid"> A SID that uniquely identifies the Verification Check </param> /// <param name="amount"> The amount of the associated PSD2 compliant transaction. </param> /// <param name="payee"> The payee of the associated PSD2 compliant transaction </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, 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 await CreateAsync(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); }