コード例 #1
0
        /// <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));
        }
コード例 #2
0
 private static Request BuildUpdateRequest(UpdateAssistantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Assistants/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
コード例 #3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> The sid </param>
        /// <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> UpdateAsync(string pathSid,
                                                                                        string friendlyName      = null,
                                                                                        bool?logQueries          = null,
                                                                                        string uniqueName        = null,
                                                                                        Uri responseUrl          = null,
                                                                                        Uri callbackUrl          = null,
                                                                                        string callbackEvents    = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new UpdateAssistantOptions(pathSid)
            {
                FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, ResponseUrl = responseUrl, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents
            };

            return(await UpdateAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> The sid </param>
        /// <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 Update(string pathSid,
                                               string friendlyName      = null,
                                               bool?logQueries          = null,
                                               string uniqueName        = null,
                                               Uri responseUrl          = null,
                                               Uri callbackUrl          = null,
                                               string callbackEvents    = null,
                                               ITwilioRestClient client = null)
        {
            var options = new UpdateAssistantOptions(pathSid)
            {
                FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, ResponseUrl = responseUrl, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents
            };

            return(Update(options, client));
        }
コード例 #5
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <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> UpdateAsync(string pathSid,
                                                                                        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 UpdateAssistantOptions(pathSid)
            {
                FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, FallbackActions = fallbackActions, InitiationActions = initiationActions, StyleSheet = styleSheet
            };

            return(await UpdateAsync(options, client));
        }
コード例 #6
0
        /// <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));
        }