예제 #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Sample parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sample </returns>
        public static SampleResource Create(CreateSampleOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Sample parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sample </returns>
        public static async System.Threading.Tasks.Task <SampleResource> CreateAsync(CreateSampleOptions options,
                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIntentSid"> The intent_sid </param>
        /// <param name="language"> The language </param>
        /// <param name="taggedText"> The tagged_text </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sample </returns>
        public static async System.Threading.Tasks.Task <SampleResource> CreateAsync(string pathServiceSid,
                                                                                     string pathIntentSid,
                                                                                     string language,
                                                                                     string taggedText,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new CreateSampleOptions(pathServiceSid, pathIntentSid, language, taggedText);

            return(await CreateAsync(options, client));
        }
예제 #4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIntentSid"> The intent_sid </param>
        /// <param name="language"> The language </param>
        /// <param name="taggedText"> The tagged_text </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sample </returns>
        public static SampleResource Create(string pathServiceSid,
                                            string pathIntentSid,
                                            string language,
                                            string taggedText,
                                            ITwilioRestClient client = null)
        {
            var options = new CreateSampleOptions(pathServiceSid, pathIntentSid, language, taggedText);

            return(Create(options, client));
        }
예제 #5
0
 private static Request BuildCreateRequest(CreateSampleOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Services/" + options.PathServiceSid + "/Intents/" + options.PathIntentSid + "/Samples",
                client.Region,
                postParams: options.GetParams()
                ));
 }