Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
        /// <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));
        }
Ejemplo n.º 4
0
 private static Request BuildFetchRequest(FetchFormOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Authy,
                "/v1/Forms/" + options.PathFormType + "",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 5
0
        /// <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));
        }