Ejemplo n.º 1
0
 private static Request BuildReadRequest(ReadSyncListOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Lists",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
        /// <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));
        }
Ejemplo n.º 4
0
        /// <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));
        }