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