コード例 #1
0
        /// <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));
        }
コード例 #2
0
        /// <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));
        }
コード例 #3
0
        /// <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));
        }
コード例 #4
0
 private static Request BuildFetchRequest(FetchFormOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Verify,
                "/v2/Forms/" + options.PathFormType + "",
                queryParams: options.GetParams()
                ));
 }
コード例 #5
0
        /// <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));
        }