/// <summary>
        /// Fetch a specific Export.
        /// </summary>
        /// <param name="pathResourceType"> The type of communication – Messages, Calls </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Export </returns>
        public static async System.Threading.Tasks.Task <ExportResource> FetchAsync(string pathResourceType,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new FetchExportOptions(pathResourceType);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="options"> Fetch Export parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Export </returns>
        public static async System.Threading.Tasks.Task <ExportResource> FetchAsync(FetchExportOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Fetch a specific Export.
        /// </summary>
        /// <param name="options"> Fetch Export parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Export </returns>
        public static ExportResource Fetch(FetchExportOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #4
0
 private static Request BuildFetchRequest(FetchExportOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/BulkExports/Exports/" + options.PathResourceType + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Fetch a specific Export.
        /// </summary>
        /// <param name="pathResourceType"> The type of communication – Messages, Calls </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Export </returns>
        public static ExportResource Fetch(string pathResourceType, ITwilioRestClient client = null)
        {
            var options = new FetchExportOptions(pathResourceType);

            return(Fetch(options, client));
        }