Esempio n. 1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Query parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Query </returns>
        public static QueryResource Create(CreateQueryOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Query parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Query </returns>
        public static async System.Threading.Tasks.Task <QueryResource> CreateAsync(CreateQueryOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 3
0
 private static Request BuildCreateRequest(CreateQueryOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Autopilot,
                "/v1/Assistants/" + options.PathAssistantSid + "/Queries",
                postParams: options.GetParams()
                ));
 }
Esempio n. 4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the parent Assistant. </param>
        /// <param name="language"> An [ISO language-country
        ///                string](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) that specifies the
        ///                language used for this query. For example: `en-US`. </param>
        /// <param name="query"> A user-provided string that uniquely identifies this resource as an alternative to the sid. It
        ///             can be up to 2048 characters long. </param>
        /// <param name="tasks"> Constraints the query to a set of tasks. Useful when you need to constrain the paths the user
        ///             can take. Tasks should be comma separated task-unique-name-1, task-unique-name-2 </param>
        /// <param name="modelBuild"> The Sid or unique name of the [Model
        ///                  Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Query </returns>
        public static async System.Threading.Tasks.Task <QueryResource> CreateAsync(string pathAssistantSid,
                                                                                    string language,
                                                                                    string query,
                                                                                    string tasks             = null,
                                                                                    string modelBuild        = null,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new CreateQueryOptions(pathAssistantSid, language, query)
            {
                Tasks = tasks, ModelBuild = modelBuild
            };

            return(await CreateAsync(options, client));
        }
Esempio n. 5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the parent Assistant. </param>
        /// <param name="language"> An [ISO language-country
        ///                string](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) that specifies the
        ///                language used for this query. For example: `en-US`. </param>
        /// <param name="query"> A user-provided string that uniquely identifies this resource as an alternative to the sid. It
        ///             can be up to 2048 characters long. </param>
        /// <param name="tasks"> Constraints the query to a set of tasks. Useful when you need to constrain the paths the user
        ///             can take. Tasks should be comma separated task-unique-name-1, task-unique-name-2 </param>
        /// <param name="modelBuild"> The Sid or unique name of the [Model
        ///                  Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Query </returns>
        public static QueryResource Create(string pathAssistantSid,
                                           string language,
                                           string query,
                                           string tasks             = null,
                                           string modelBuild        = null,
                                           ITwilioRestClient client = null)
        {
            var options = new CreateQueryOptions(pathAssistantSid, language, query)
            {
                Tasks = tasks, ModelBuild = modelBuild
            };

            return(Create(options, client));
        }