Пример #1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathListSid"> The list_sid </param>
        /// <param name="order"> The order </param>
        /// <param name="from"> The from </param>
        /// <param name="bounds"> The bounds </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 SyncListItem </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SyncListItemResource> > ReadAsync(string pathServiceSid, string pathListSid, SyncListItemResource.QueryResultOrderEnum order = null, string from = null, SyncListItemResource.QueryFromBoundTypeEnum bounds = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadSyncListItemOptions(pathServiceSid, pathListSid)
            {
                Order = order, From = from, Bounds = bounds, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
 private static Request BuildReadRequest(ReadSyncListItemOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Lists/" + options.PathListSid + "/Items",
                queryParams: options.GetParams()
                ));
 }
Пример #3
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read SyncListItem parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncListItem </returns>
        public static ResourceSet <SyncListItemResource> Read(ReadSyncListItemOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <SyncListItemResource> .FromJson("items", response.Content);

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

            var page = Page <SyncListItemResource> .FromJson("items", response.Content);

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