/// <summary> /// update /// </summary> /// <param name="options"> Update Assistant parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Assistant </returns> public static AssistantResource Update(UpdateAssistantOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildUpdateRequest(UpdateAssistantOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Autopilot, "/v1/Assistants/" + options.PathSid + "", postParams: options.GetParams() )); }
/// <summary> /// update /// </summary> /// <param name="pathSid"> The sid </param> /// <param name="friendlyName"> A text description for the Assistant. It is non-unique and can be 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"> The callback_url </param> /// <param name="callbackEvents"> The callback_events </param> /// <param name="styleSheet"> A JSON object that defines the assistant style sheet </param> /// <param name="defaults"> A JSON object that defines the assistant's default tasks for various scenarios </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> UpdateAsync(string pathSid, string friendlyName = null, bool?logQueries = null, string uniqueName = null, Uri callbackUrl = null, string callbackEvents = null, object styleSheet = null, object defaults = null, ITwilioRestClient client = null) { var options = new UpdateAssistantOptions(pathSid) { FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, StyleSheet = styleSheet, Defaults = defaults }; return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// <param name="pathSid"> The unique string that identifies the resource </param> /// <param name="friendlyName"> A string to describe the resource </param> /// <param name="logQueries"> Whether queries should be logged and kept after training </param> /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param> /// <param name="callbackUrl"> Reserved </param> /// <param name="callbackEvents"> Reserved </param> /// <param name="styleSheet"> A JSON string that defines the Assistant's style sheet </param> /// <param name="defaults"> A JSON object that defines the Assistant's [default /// tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios </param> /// <param name="developmentStage"> A string describing the state of the assistant. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Assistant </returns> public static AssistantResource Update(string pathSid, string friendlyName = null, bool?logQueries = null, string uniqueName = null, Uri callbackUrl = null, string callbackEvents = null, object styleSheet = null, object defaults = null, string developmentStage = null, ITwilioRestClient client = null) { var options = new UpdateAssistantOptions(pathSid) { FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, StyleSheet = styleSheet, Defaults = defaults, DevelopmentStage = developmentStage }; return(Update(options, client)); }
/// <summary> /// update /// </summary> /// <param name="options"> Update 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> UpdateAsync(UpdateAssistantOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }