/// <summary> /// Fetch the forms for a specific type. /// </summary> /// <param name="pathType"> 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 pathType, ITwilioRestClient client = null) { var options = new FetchFormOptions(pathType); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch the forms for a specific 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 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.Authy, "/v1/Forms/" + options.PathFormType + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch the forms for a specific type. /// </summary> /// <param name="pathType"> 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 pathType, ITwilioRestClient client = null) { var options = new FetchFormOptions(pathType); return(Fetch(options, client)); }