Example #1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="type"> The type </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 Channel </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ChannelResource> > ReadAsync(string pathServiceSid,
                                                                                                   List <ChannelResource.ChannelTypeEnum> type = null,
                                                                                                   int?pageSize             = null,
                                                                                                   long?limit               = null,
                                                                                                   ITwilioRestClient client = null)
        {
            var options = new ReadChannelOptions(pathServiceSid)
            {
                Type = type, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Example #2
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="type"> The type </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 Channel </returns>
        public static ResourceSet <ChannelResource> Read(string pathServiceSid,
                                                         List <ChannelResource.ChannelTypeEnum> type = null,
                                                         int?pageSize             = null,
                                                         long?limit               = null,
                                                         ITwilioRestClient client = null)
        {
            var options = new ReadChannelOptions(pathServiceSid)
            {
                Type = type, PageSize = pageSize, Limit = limit
            };

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

            var page = Page <ChannelResource> .FromJson("channels", response.Content);

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