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

            return(FromJson(response.Content));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="assignmentCallbackUrl"> The assignment_callback_url </param>
        /// <param name="fallbackAssignmentCallbackUrl"> The fallback_assignment_callback_url </param>
        /// <param name="configuration"> The configuration </param>
        /// <param name="taskReservationTimeout"> The task_reservation_timeout </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Workflow </returns>
        public static async System.Threading.Tasks.Task <WorkflowResource> UpdateAsync(string pathWorkspaceSid, string pathSid, string friendlyName = null, Uri assignmentCallbackUrl = null, Uri fallbackAssignmentCallbackUrl = null, string configuration = null, int?taskReservationTimeout = null, ITwilioRestClient client = null)
        {
            var options = new UpdateWorkflowOptions(pathWorkspaceSid, pathSid)
            {
                FriendlyName = friendlyName, AssignmentCallbackUrl = assignmentCallbackUrl, FallbackAssignmentCallbackUrl = fallbackAssignmentCallbackUrl, Configuration = configuration, TaskReservationTimeout = taskReservationTimeout
            };

            return(await UpdateAsync(options, client));
        }
 private static Request BuildUpdateRequest(UpdateWorkflowOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Workflows/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathWorkspaceSid"> The SID of the Workspace with the Workflow to update </param>
        /// <param name="pathSid"> The SID of the resource </param>
        /// <param name="friendlyName">  descriptive string that you create to describe the Workflow resource </param>
        /// <param name="assignmentCallbackUrl"> The URL from your application that will process task assignment events </param>
        /// <param name="fallbackAssignmentCallbackUrl"> The URL that we should call when a call to the
        ///                                     `assignment_callback_url` fails </param>
        /// <param name="configuration"> A JSON string that contains the rules to apply to the Workflow </param>
        /// <param name="taskReservationTimeout"> How long TaskRouter will wait for a confirmation response from your
        ///                              application after it assigns a Task to a Worker </param>
        /// <param name="reEvaluateTasks"> Whether or not to re-evaluate Tasks </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Workflow </returns>
        public static WorkflowResource Update(string pathWorkspaceSid,
                                              string pathSid,
                                              string friendlyName               = null,
                                              Uri assignmentCallbackUrl         = null,
                                              Uri fallbackAssignmentCallbackUrl = null,
                                              string configuration              = null,
                                              int?taskReservationTimeout        = null,
                                              string reEvaluateTasks            = null,
                                              ITwilioRestClient client          = null)
        {
            var options = new UpdateWorkflowOptions(pathWorkspaceSid, pathSid)
            {
                FriendlyName = friendlyName, AssignmentCallbackUrl = assignmentCallbackUrl, FallbackAssignmentCallbackUrl = fallbackAssignmentCallbackUrl, Configuration = configuration, TaskReservationTimeout = taskReservationTimeout, ReEvaluateTasks = reEvaluateTasks
            };

            return(Update(options, client));
        }
Example #5
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Workflow parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Workflow </returns>
        public static async System.Threading.Tasks.Task <WorkflowResource> UpdateAsync(UpdateWorkflowOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }