/// <summary> /// Fetch the forms for a specific Form Type. /// </summary> /// <param name="options"> Fetch Form parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Form </returns> public static FormResource Fetch(FetchFormOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch the forms for a specific Form Type. /// </summary> /// <param name="pathFormType"> The Type of this Form </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Form </returns> public static async System.Threading.Tasks.Task <FormResource> FetchAsync(FormResource.FormTypesEnum pathFormType, ITwilioRestClient client = null) { var options = new FetchFormOptions(pathFormType); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch the forms for a specific Form Type. /// </summary> /// <param name="options"> Fetch Form parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Form </returns> public static async System.Threading.Tasks.Task <FormResource> FetchAsync(FetchFormOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildFetchRequest(FetchFormOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Verify, "/v2/Forms/" + options.PathFormType + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch the forms for a specific Form Type. /// </summary> /// <param name="pathFormType"> The Type of this Form </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Form </returns> public static FormResource Fetch(FormResource.FormTypesEnum pathFormType, ITwilioRestClient client = null) { var options = new FetchFormOptions(pathFormType); return(Fetch(options, client)); }