예제 #1
0
        /// <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));
        }
예제 #2
0
        /// <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));
        }
예제 #3
0
        /// <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));
        }
예제 #4
0
 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()
                ));
 }
예제 #5
0
        /// <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));
        }