Exemple #1
0
        /// <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));
        }
Exemple #2
0
 private static Request BuildCreateRequest(CreateAssistantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Autopilot,
                "/v1/Assistants",
                postParams: options.GetParams()
                ));
 }
Exemple #3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="friendlyName"> A string to describe the new 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 new 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 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> CreateAsync(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 CreateAssistantOptions()
            {
                FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, StyleSheet = styleSheet, Defaults = defaults
            };

            return(await CreateAsync(options, client));
        }
Exemple #4
0
        /// <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));
        }