예제 #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 Mobile </returns>
        public static ResourceSet <MobileResource> 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 ReadMobileOptions {
                PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <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 Mobile </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MobileResource> > 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 ReadMobileOptions {
                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 Mobile parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Mobile </returns>
        public static ResourceSet <MobileResource> Read(ReadMobileOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

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

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

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

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