Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Lists/" + options.PathListSid + "/Items",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the List Item resources to read </param>
        /// <param name="pathListSid"> The SID of the Sync List with the List Items to read </param>
        /// <param name="order"> The order to return the List Items </param>
        /// <param name="from"> The index of the first Sync List Item resource to read </param>
        /// <param name="bounds"> Whether to include the List Item referenced by the from parameter </param>
        /// <param name="hideExpired"> Hide expired Sync List items and show only active ones. </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 SyncListItem </returns>
        public static ResourceSet <SyncListItemResource> Read(string pathServiceSid,
                                                              string pathListSid,
                                                              SyncListItemResource.QueryResultOrderEnum order = null,
                                                              string from = null,
                                                              SyncListItemResource.QueryFromBoundTypeEnum bounds   = null,
                                                              SyncListItemResource.HideExpiredTypeEnum hideExpired = null,
                                                              int?pageSize             = null,
                                                              long?limit               = null,
                                                              ITwilioRestClient client = null)
        {
            var options = new ReadSyncListItemOptions(pathServiceSid, pathListSid)
            {
                Order = order, From = from, Bounds = bounds, HideExpired = hideExpired, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Ejemplo n.º 5
0
        /// <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));
        }