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

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

            return(FromJson(response.Content));
        }
 private static Request BuildCreateRequest(CreateTaskOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Assistants/" + options.PathAssistantSid + "/Tasks",
                postParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the Assistant. </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="friendlyName"> A user-provided string that identifies this resource. It is non-unique and can up to
        ///                    255 characters long. </param>
        /// <param name="actions"> A user-provided JSON object encoded as a string to specify the actions for this task. It is
        ///               optional and non-unique. </param>
        /// <param name="actionsUrl"> User-provided HTTP endpoint where from the assistant fetches actions </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Task </returns>
        public static async System.Threading.Tasks.Task <TaskResource> CreateAsync(string pathAssistantSid,
                                                                                   string uniqueName,
                                                                                   string friendlyName      = null,
                                                                                   object actions           = null,
                                                                                   Uri actionsUrl           = null,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new CreateTaskOptions(pathAssistantSid, uniqueName)
            {
                FriendlyName = friendlyName, Actions = actions, ActionsUrl = actionsUrl
            };

            return(await CreateAsync(options, client));
        }
Example #5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the Assistant. </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="friendlyName"> A user-provided string that identifies this resource. It is non-unique and can up to
        ///                    255 characters long. </param>
        /// <param name="actions"> A user-provided JSON object encoded as a string to specify the actions for this task. It is
        ///               optional and non-unique. </param>
        /// <param name="actionsUrl"> User-provided HTTP endpoint where from the assistant fetches actions </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Task </returns>
        public static TaskResource Create(string pathAssistantSid,
                                          string uniqueName,
                                          string friendlyName      = null,
                                          object actions           = null,
                                          Uri actionsUrl           = null,
                                          ITwilioRestClient client = null)
        {
            var options = new CreateTaskOptions(pathAssistantSid, uniqueName)
            {
                FriendlyName = friendlyName, Actions = actions, ActionsUrl = actionsUrl
            };

            return(Create(options, client));
        }