Exemplo n.º 1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="priority"> The priority </param>
        /// <param name="assignmentStatus"> The assignment_status </param>
        /// <param name="workflowSid"> The workflow_sid </param>
        /// <param name="workflowName"> The workflow_name </param>
        /// <param name="taskQueueSid"> The task_queue_sid </param>
        /// <param name="taskQueueName"> The task_queue_name </param>
        /// <param name="evaluateTaskAttributes"> The evaluate_task_attributes </param>
        /// <param name="ordering"> The ordering </param>
        /// <param name="hasAddons"> The has_addons </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </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 <ResourceSet <TaskResource> > ReadAsync(string pathWorkspaceSid, int?priority = null, List <string> assignmentStatus = null, string workflowSid = null, string workflowName = null, string taskQueueSid = null, string taskQueueName = null, string evaluateTaskAttributes = null, string ordering = null, bool?hasAddons = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadTaskOptions(pathWorkspaceSid)
            {
                Priority = priority, AssignmentStatus = assignmentStatus, WorkflowSid = workflowSid, WorkflowName = workflowName, TaskQueueSid = taskQueueSid, TaskQueueName = taskQueueName, EvaluateTaskAttributes = evaluateTaskAttributes, Ordering = ordering, HasAddons = hasAddons, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Exemplo n.º 2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read Task parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Task </returns>
        public static ResourceSet <TaskResource> Read(ReadTaskOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <TaskResource> .FromJson("tasks", response.Content);

            return(new ResourceSet <TaskResource>(page, options, client));
        }
Exemplo n.º 3
0
 private static Request BuildReadRequest(ReadTaskOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Tasks",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 4
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read 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 <ResourceSet <TaskResource> > ReadAsync(ReadTaskOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <TaskResource> .FromJson("tasks", response.Content);

            return(new ResourceSet <TaskResource>(page, options, client));
        }