/// <summary> /// Fetch a specific Day. /// </summary> /// <param name="options"> Fetch Day parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Day </returns> public static DayResource Fetch(FetchDayOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch a specific Day. /// </summary> /// <param name="pathResourceType"> The type of communication – Messages, Calls </param> /// <param name="pathDay"> The date of the data in the file </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 <DayResource> FetchAsync(string pathResourceType, string pathDay, ITwilioRestClient client = null) { var options = new FetchDayOptions(pathResourceType, pathDay); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch a specific Day. /// </summary> /// <param name="options"> Fetch 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 <DayResource> FetchAsync(FetchDayOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildFetchRequest(FetchDayOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Preview, "/BulkExports/Exports/" + options.PathResourceType + "/Days/" + options.PathDay + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch a specific Day. /// </summary> /// <param name="pathResourceType"> The type of communication – Messages, Calls </param> /// <param name="pathDay"> The date of the data in the file </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Day </returns> public static DayResource Fetch(string pathResourceType, string pathDay, ITwilioRestClient client = null) { var options = new FetchDayOptions(pathResourceType, pathDay); return(Fetch(options, client)); }