Esempio n. 1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <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 Trunk </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <TrunkResource> > ReadAsync(int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadTrunkOptions {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Esempio n. 2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <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 Trunk </returns>
        public static ResourceSet <TrunkResource> Read(int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadTrunkOptions {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Esempio n. 3
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Trunk parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Trunk </returns>
        public static ResourceSet <TrunkResource> Read(ReadTrunkOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <TrunkResource> .FromJson("trunks", response.Content);

            return(new ResourceSet <TrunkResource>(page, options, client));
        }
Esempio n. 4
0
 private static Request BuildReadRequest(ReadTrunkOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Trunking,
                "/v1/Trunks",
                queryParams: options.GetParams()
                ));
 }
Esempio n. 5
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Trunk parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Trunk </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <TrunkResource> > ReadAsync(ReadTrunkOptions options,
                                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <TrunkResource> .FromJson("trunks", response.Content);

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