/// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Activity parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Activity </returns>
        public static ResourceSet <ActivityResource> Read(ReadActivityOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <ActivityResource> .FromJson("activities", response.Content);

            return(new ResourceSet <ActivityResource>(page, options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="available"> The available </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 Activity </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ActivityResource> > ReadAsync(string pathWorkspaceSid, string friendlyName = null, string available = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadActivityOptions(pathWorkspaceSid)
            {
                FriendlyName = friendlyName, Available = available, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
示例#3
0
 private static Request BuildReadRequest(ReadActivityOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Activities",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="available"> The available </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Activity </returns>
        public static ResourceSet <ActivityResource> Read(string pathWorkspaceSid, string friendlyName = null, string available = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadActivityOptions(pathWorkspaceSid)
            {
                FriendlyName = friendlyName, Available = available, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Activity parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Activity </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ActivityResource> > ReadAsync(ReadActivityOptions options,
                                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <ActivityResource> .FromJson("activities", response.Content);

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