/// <summary> /// read /// </summary> /// <param name="options"> Read Day parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Day </returns> public static ResourceSet <DayResource> Read(ReadDayOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <DayResource> .FromJson("days", response.Content); return(new ResourceSet <DayResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// /// <param name="pathResourceType"> The resource_type </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 Day </returns> public static async System.Threading.Tasks.Task <ResourceSet <DayResource> > ReadAsync(string pathResourceType, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadDayOptions(pathResourceType) { PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// read /// </summary> /// /// <param name="pathResourceType"> The resource_type </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 Day </returns> public static ResourceSet <DayResource> Read(string pathResourceType, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadDayOptions(pathResourceType) { PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
private static Request BuildReadRequest(ReadDayOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Preview, "/BulkExports/Exports/" + options.PathResourceType + "/Days", queryParams: options.GetParams() )); }
/// <summary> /// read /// </summary> /// <param name="options"> Read Day parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Day </returns> public static async System.Threading.Tasks.Task <ResourceSet <DayResource> > ReadAsync(ReadDayOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <DayResource> .FromJson("days", response.Content); return(new ResourceSet <DayResource>(page, options, client)); }