Пример #1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="beta"> The beta </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="phoneNumber"> The phone_number </param>
        /// <param name="origin"> The origin </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 Local </returns>
        public static ResourceSet <LocalResource> Read(string pathAccountSid = null, bool?beta = null, string friendlyName = null, Types.PhoneNumber phoneNumber = null, string origin = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadLocalOptions {
                PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Пример #2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="beta"> The beta </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="phoneNumber"> The phone_number </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 Local </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <LocalResource> > ReadAsync(string pathAccountSid = null, bool?beta = null, string friendlyName = null, Types.PhoneNumber phoneNumber = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadLocalOptions {
                PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Пример #3
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read Local parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Local </returns>
        public static ResourceSet <LocalResource> Read(ReadLocalOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <LocalResource> .FromJson("incoming_phone_numbers", response.Content);

            return(new ResourceSet <LocalResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadLocalOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/IncomingPhoneNumbers/Local.json",
                queryParams: options.GetParams()
                ));
 }
Пример #5
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read Local parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Local </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <LocalResource> > ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <LocalResource> .FromJson("incoming_phone_numbers", response.Content);

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