/// <summary> /// read /// </summary> /// /// <param name="pathAccountSid"> The account_sid </param> /// <param name="category"> The category </param> /// <param name="startDate"> The start_date </param> /// <param name="endDate"> The end_date </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 AllTime </returns> public static async System.Threading.Tasks.Task <ResourceSet <AllTimeResource> > ReadAsync(string pathAccountSid = null, AllTimeResource.CategoryEnum category = null, DateTime?startDate = null, DateTime?endDate = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadAllTimeOptions { PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read AllTime parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AllTime </returns> public static ResourceSet <AllTimeResource> Read(ReadAllTimeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <AllTimeResource> .FromJson("usage_records", response.Content); return(new ResourceSet <AllTimeResource>(page, options, client)); }
private static Request BuildReadRequest(ReadAllTimeOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Usage/Records/AllTime.json", queryParams: options.GetParams() )); }
/// <summary> /// read /// </summary> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="category"> Only include usage of this usage category. </param> /// <param name="startDate"> Only include usage that has occurred on or after this date. </param> /// <param name="endDate"> Only include usage that has occurred on or before this date. </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 AllTime </returns> public static ResourceSet <AllTimeResource> Read(string pathAccountSid = null, AllTimeResource.CategoryEnum category = null, DateTime?startDate = null, DateTime?endDate = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadAllTimeOptions() { PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read AllTime parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AllTime </returns> public static async System.Threading.Tasks.Task <ResourceSet <AllTimeResource> > ReadAsync(ReadAllTimeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <AllTimeResource> .FromJson("usage_records", response.Content); return(new ResourceSet <AllTimeResource>(page, options, client)); }