/// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathTrunkSid"> The trunk_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 OriginationUrl </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <OriginationUrlResource> > ReadAsync(string pathTrunkSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadOriginationUrlOptions(pathTrunkSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read OriginationUrl parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of OriginationUrl </returns>
        public static ResourceSet <OriginationUrlResource> Read(ReadOriginationUrlOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <OriginationUrlResource> .FromJson("origination_urls", response.Content);

            return(new ResourceSet <OriginationUrlResource>(page, options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathTrunkSid"> The trunk_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 OriginationUrl </returns>
        public static ResourceSet <OriginationUrlResource> Read(string pathTrunkSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadOriginationUrlOptions(pathTrunkSid)
            {
                PageSize = pageSize, Limit = limit
            };

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

            var page = Page <OriginationUrlResource> .FromJson("origination_urls", response.Content);

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