/// <summary> /// Retrieve a list of all faxes. /// </summary> /// <param name="options"> Read Fax parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Fax </returns> public static ResourceSet<FaxResource> Read(ReadFaxOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page<FaxResource>.FromJson("faxes", response.Content); return new ResourceSet<FaxResource>(page, options, client); }
/// <summary> /// Retrieve a list of all faxes. /// </summary> /// /// <param name="from"> Include only faxes sent from </param> /// <param name="to"> Include only faxes sent to </param> /// <param name="dateCreatedOnOrBefore"> Include only faxes created on or before </param> /// <param name="dateCreatedAfter"> Include only faxes created after </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 Fax </returns> public static async System.Threading.Tasks.Task <ResourceSet <FaxResource> > ReadAsync(string from = null, string to = null, DateTime?dateCreatedOnOrBefore = null, DateTime?dateCreatedAfter = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadFaxOptions { From = from, To = to, DateCreatedOnOrBefore = dateCreatedOnOrBefore, DateCreatedAfter = dateCreatedAfter, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of all faxes. /// </summary> /// /// <param name="from"> Include only faxes sent from </param> /// <param name="to"> Include only faxes sent to </param> /// <param name="dateCreatedOnOrBefore"> Include only faxes created on or before </param> /// <param name="dateCreatedAfter"> Include only faxes created after </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 Fax </returns> public static ResourceSet <FaxResource> Read(string from = null, string to = null, DateTime?dateCreatedOnOrBefore = null, DateTime?dateCreatedAfter = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadFaxOptions { From = from, To = to, DateCreatedOnOrBefore = dateCreatedOnOrBefore, DateCreatedAfter = dateCreatedAfter, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
private static Request BuildReadRequest(ReadFaxOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Fax, "/v1/Faxes", queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of all faxes. /// </summary> /// <param name="options"> Read Fax parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Fax </returns> public static async System.Threading.Tasks.Task<ResourceSet<FaxResource>> ReadAsync(ReadFaxOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page<FaxResource>.FromJson("faxes", response.Content); return new ResourceSet<FaxResource>(page, options, client); }