/// <summary> /// Retrieve a list of incoming-phone-numbers belonging to the account used to make the request /// </summary> /// /// <param name="pathAccountSid"> The account_sid </param> /// <param name="beta"> Include new phone numbers </param> /// <param name="friendlyName"> Filter by friendly name </param> /// <param name="phoneNumber"> Filter by incoming 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> Task that resolves to A single instance of IncomingPhoneNumber </returns> public static async System.Threading.Tasks.Task <ResourceSet <IncomingPhoneNumberResource> > ReadAsync(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 ReadIncomingPhoneNumberOptions { PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of incoming-phone-numbers belonging to the account used to make the request /// </summary> /// /// <param name="pathAccountSid"> The account_sid </param> /// <param name="beta"> Include new phone numbers </param> /// <param name="friendlyName"> Filter by friendly name </param> /// <param name="phoneNumber"> Filter by incoming 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> A single instance of IncomingPhoneNumber </returns> public static ResourceSet <IncomingPhoneNumberResource> Read(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 ReadIncomingPhoneNumberOptions { PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a list of incoming-phone-numbers belonging to the account used to make the request /// </summary> /// /// <param name="options"> Read IncomingPhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IncomingPhoneNumber </returns> public static ResourceSet <IncomingPhoneNumberResource> Read(ReadIncomingPhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <IncomingPhoneNumberResource> .FromJson("incoming_phone_numbers", response.Content); return(new ResourceSet <IncomingPhoneNumberResource>(page, options, client)); }
private static Request BuildReadRequest(ReadIncomingPhoneNumberOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/IncomingPhoneNumbers.json", client.Region, queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of incoming-phone-numbers belonging to the account used to make the request /// </summary> /// /// <param name="options"> Read IncomingPhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of IncomingPhoneNumber </returns> public static async System.Threading.Tasks.Task <ResourceSet <IncomingPhoneNumberResource> > ReadAsync(ReadIncomingPhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <IncomingPhoneNumberResource> .FromJson("incoming_phone_numbers", response.Content); return(new ResourceSet <IncomingPhoneNumberResource>(page, options, client)); }