using ServiceStack.Web;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Net
{
///
/// Interface IHttpResultFactory
///
public interface IHttpResultFactory
{
///
/// Throws the error.
///
/// The status code.
/// The error message.
/// The response headers.
void ThrowError(int statusCode, string errorMessage, IDictionary responseHeaders = null);
///
/// Gets the result.
///
/// The content.
/// Type of the content.
/// The response headers.
/// System.Object.
object GetResult(object content, string contentType, IDictionary responseHeaders = null);
object GetAsyncStreamWriter(IAsyncStreamSource streamSource);
///
/// Gets the optimized result.
///
///
/// The request context.
/// The result.
/// The response headers.
/// System.Object.
object GetOptimizedResult(IRequest requestContext, T result, IDictionary responseHeaders = null)
where T : class;
///
/// Gets the optimized result using cache.
///
///
/// The request context.
/// The cache key.
/// The last date modified.
/// Duration of the cache.
/// The factory function that creates the response object.
/// The response headers.
/// System.Object.
object GetOptimizedResultUsingCache(IRequest requestContext, Guid cacheKey, DateTime? lastDateModified, TimeSpan? cacheDuration, Func factoryFn, IDictionary responseHeaders = null)
where T : class;
///
/// Gets the cached result.
///
///
/// The request context.
/// The cache key.
/// The last date modified.
/// Duration of the cache.
/// The factory fn.
/// Type of the content.
/// The response headers.
/// System.Object.
object GetCachedResult(IRequest requestContext, Guid cacheKey, DateTime? lastDateModified, TimeSpan? cacheDuration, Func factoryFn, string contentType, IDictionary responseHeaders = null)
where T : class;
///
/// Gets the static result.
///
/// The request context.
/// The cache key.
/// The last date modified.
/// Duration of the cache.
/// Type of the content.
/// The factory fn.
/// The response headers.
/// if set to true [is head request].
/// System.Object.
Task