/// <summary> /// create /// </summary> /// <param name="options"> Create Assistant parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Assistant </returns> public static AssistantResource Create(CreateAssistantOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateAssistantOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Preview, "/understand/Assistants", postParams: options.GetParams() )); }
/// <summary> /// create /// </summary> /// <param name="friendlyName"> A text description for the Assistant. It is non-unique and can up to 255 characters /// long. </param> /// <param name="logQueries"> A boolean that specifies whether queries should be logged for 30 days further training. /// If false, no queries will be stored, if true, queries will be stored for 30 days and deleted /// thereafter. Defaults to true if no value is provided. </param> /// <param name="uniqueName"> A user-provided string that uniquely identifies this resource as an alternative to the /// sid. Unique up to 64 characters long. </param> /// <param name="responseUrl"> The webhook URL called to fetch the response to an incoming communication expressed in /// Assistant TwiML. </param> /// <param name="callbackUrl"> The callback_url </param> /// <param name="callbackEvents"> The callback_events </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Assistant </returns> public static async System.Threading.Tasks.Task <AssistantResource> CreateAsync(string friendlyName = null, bool?logQueries = null, string uniqueName = null, Uri responseUrl = null, Uri callbackUrl = null, string callbackEvents = null, ITwilioRestClient client = null) { var options = new CreateAssistantOptions() { FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, ResponseUrl = responseUrl, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents }; return(await CreateAsync(options, client)); }
/// <summary> /// create /// </summary> /// <param name="friendlyName"> A text description for the Assistant. It is non-unique and can up to 255 characters /// long. </param> /// <param name="logQueries"> A boolean that specifies whether queries should be logged for 30 days further training. /// If false, no queries will be stored, if true, queries will be stored for 30 days and deleted /// thereafter. Defaults to true if no value is provided. </param> /// <param name="uniqueName"> A user-provided string that uniquely identifies this resource as an alternative to the /// sid. Unique up to 64 characters long. </param> /// <param name="responseUrl"> The webhook URL called to fetch the response to an incoming communication expressed in /// Assistant TwiML. </param> /// <param name="callbackUrl"> The callback_url </param> /// <param name="callbackEvents"> The callback_events </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Assistant </returns> public static AssistantResource Create(string friendlyName = null, bool?logQueries = null, string uniqueName = null, Uri responseUrl = null, Uri callbackUrl = null, string callbackEvents = null, ITwilioRestClient client = null) { var options = new CreateAssistantOptions() { FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, ResponseUrl = responseUrl, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents }; return(Create(options, client)); }
/// <summary> /// create /// </summary> /// <param name="friendlyName"> A text description for the Assistant. It is non-unique and can up to 255 characters /// long. </param> /// <param name="logQueries"> A boolean that specifies whether queries should be logged for 30 days further training. /// If false, no queries will be stored, if true, queries will be stored for 30 days and deleted /// thereafter. Defaults to true if no value is provided. </param> /// <param name="uniqueName"> A user-provided string that uniquely identifies this resource as an alternative to the /// sid. Unique up to 64 characters long. </param> /// <param name="callbackUrl"> A user-provided URL to send event callbacks to. </param> /// <param name="callbackEvents"> Space-separated list of callback events that will trigger callbacks. </param> /// <param name="fallbackActions"> The JSON actions to be executed when the user's input is not recognized as matching /// any Task. </param> /// <param name="initiationActions"> The JSON actions to be executed on inbound phone calls when the Assistant has to /// say something first. </param> /// <param name="styleSheet"> The JSON object that holds the style sheet for the assistant </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Assistant </returns> public static async System.Threading.Tasks.Task <AssistantResource> CreateAsync(string friendlyName = null, bool?logQueries = null, string uniqueName = null, Uri callbackUrl = null, string callbackEvents = null, object fallbackActions = null, object initiationActions = null, object styleSheet = null, ITwilioRestClient client = null) { var options = new CreateAssistantOptions() { FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, FallbackActions = fallbackActions, InitiationActions = initiationActions, StyleSheet = styleSheet }; return(await CreateAsync(options, client)); }
/// <summary> /// create /// </summary> /// <param name="options"> Create Assistant parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Assistant </returns> public static async System.Threading.Tasks.Task <AssistantResource> CreateAsync(CreateAssistantOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }