示例#1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="customerName"> The customer_name </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="isoCountry"> The iso_country </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 Address </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <AddressResource> > ReadAsync(string pathAccountSid = null, string customerName = null, string friendlyName = null, string isoCountry = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadAddressOptions {
                PathAccountSid = pathAccountSid, CustomerName = customerName, FriendlyName = friendlyName, IsoCountry = isoCountry, PageSize = pageSize, Limit = limit
            };

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

            var page = Page <AddressResource> .FromJson("addresses", response.Content);

            return(new ResourceSet <AddressResource>(page, options, client));
        }
示例#3
0
 private static Request BuildReadRequest(ReadAddressOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Addresses.json",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="customerName"> The customer_name </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="isoCountry"> The iso_country </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 Address </returns>
        public static ResourceSet <AddressResource> Read(string pathAccountSid    = null,
                                                         string customerName      = null,
                                                         string friendlyName      = null,
                                                         string isoCountry        = null,
                                                         int?pageSize             = null,
                                                         long?limit               = null,
                                                         ITwilioRestClient client = null)
        {
            var options = new ReadAddressOptions()
            {
                PathAccountSid = pathAccountSid, CustomerName = customerName, FriendlyName = friendlyName, IsoCountry = isoCountry, PageSize = pageSize, Limit = limit
            };

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

            var page = Page <AddressResource> .FromJson("addresses", response.Content);

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