Ejemplo n.º 1
0
        /// <summary>
        /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}.
        /// </summary>
        /// <param name="options"> Update TaskActions parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskActions </returns>
        public static TaskActionsResource Update(UpdateTaskActionsOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
 private static Request BuildUpdateRequest(UpdateTaskActionsOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Autopilot,
                "/v1/Assistants/" + options.PathAssistantSid + "/Tasks/" + options.PathTaskSid + "/Actions",
                postParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}.
        /// </summary>
        /// <param name="pathAssistantSid"> The SID of the Assistant that is the parent of the Task for which the task actions
        ///                        to update were defined </param>
        /// <param name="pathTaskSid"> The SID of the Task for which the task actions to update were defined </param>
        /// <param name="actions"> The JSON string that specifies the actions that instruct the Assistant on how to perform the
        ///               task </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskActions </returns>
        public static TaskActionsResource Update(string pathAssistantSid,
                                                 string pathTaskSid,
                                                 object actions           = null,
                                                 ITwilioRestClient client = null)
        {
            var options = new UpdateTaskActionsOptions(pathAssistantSid, pathTaskSid)
            {
                Actions = actions
            };

            return(Update(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}.
        /// </summary>
        /// <param name="options"> Update TaskActions parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskActions </returns>
        public static async System.Threading.Tasks.Task <TaskActionsResource> UpdateAsync(UpdateTaskActionsOptions options,
                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }