private static Request BuildReadRequest(ReadSyncListOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Lists",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read SyncList parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncList </returns>
        public static ResourceSet <SyncListResource> Read(ReadSyncListOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <SyncListResource> .FromJson("lists", response.Content);

            return(new ResourceSet <SyncListResource>(page, options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </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 SyncList </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SyncListResource> > ReadAsync(string pathServiceSid,
                                                                                                    int?pageSize             = null,
                                                                                                    long?limit               = null,
                                                                                                    ITwilioRestClient client = null)
        {
            var options = new ReadSyncListOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </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 SyncList </returns>
        public static ResourceSet <SyncListResource> Read(string pathServiceSid,
                                                          int?pageSize             = null,
                                                          long?limit               = null,
                                                          ITwilioRestClient client = null)
        {
            var options = new ReadSyncListOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

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

            var page = Page <SyncListResource> .FromJson("lists", response.Content);

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