/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
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() )); }