Esempio n. 1
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update Task parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Task </returns>
        public static TaskResource Update(UpdateTaskOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 2
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update 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> UpdateAsync(UpdateTaskOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 3
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="attributes"> The attributes </param>
        /// <param name="assignmentStatus"> The assignment_status </param>
        /// <param name="reason"> The reason </param>
        /// <param name="priority"> The priority </param>
        /// <param name="taskChannel"> The task_channel </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> UpdateAsync(string pathWorkspaceSid, string pathSid, string attributes = null, TaskResource.StatusEnum assignmentStatus = null, string reason = null, int?priority = null, string taskChannel = null, ITwilioRestClient client = null)
        {
            var options = new UpdateTaskOptions(pathWorkspaceSid, pathSid)
            {
                Attributes = attributes, AssignmentStatus = assignmentStatus, Reason = reason, Priority = priority, TaskChannel = taskChannel
            };

            return(await UpdateAsync(options, client));
        }
 private static Request BuildUpdateRequest(UpdateTaskOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Tasks/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }