namespace TrinityRepublic.Trello
{
	using System;
	using System.IO;
	using System.Net.Http;
	using System.Net.Http.Headers;
	using System.Threading;
	using System.Threading.Tasks;
	
	public class HttpClientAdapter : IHttpClient
	{
		private HttpClient _client;
		
		public HttpClientAdapter()
		{
			_client = new HttpClient();
		}
		
		public virtual HttpRequestHeaders DefaultRequestHeaders { get { return _client.DefaultRequestHeaders; } }
		
		public virtual Uri BaseAddress 
		{
			get { return _client.BaseAddress; }
			set { _client.BaseAddress = value; }
		}
		
		public virtual TimeSpan Timeout 
		{ 
			get { return _client.Timeout; }
			set { _client.Timeout = value; }
		}
		
		public virtual long MaxReponseContentBufferSize
		{
			get { return _client.MaxResponseContentBufferSize; }
			set { _client.MaxResponseContentBufferSize = value; }
		}

		public virtual Task<string> GetStringAsync(string requestUri)
		{
			return _client.GetStringAsync(requestUri);
		}
		
		public virtual Task<string> GetStringAsync(Uri requestUri)
		{
			return _client.GetStringAsync(requestUri);
		}
		
		public virtual Task<byte[]> GetByteArrayAsync(string requestUri)
		{
			return _client.GetByteArrayAsync(requestUri);
		}
		
		public virtual Task<byte[]> GetByteArrayAsync(Uri requestUri)
		{
			return _client.GetByteArrayAsync(requestUri);
		}
		
		public virtual Task<Stream> GetStreamAsync(string requestUri)
		{
			return _client.GetStreamAsync(requestUri);
		}
		
		public virtual Task<Stream> GetStreamAsync(Uri requestUri)
		{
			return _client.GetStreamAsync(requestUri);
		}

		public virtual Task<HttpResponseMessage> GetAsync(string requestUri)
		{
			return _client.GetAsync(requestUri);
		}
		
		public virtual Task<HttpResponseMessage> GetAsync(Uri requestUri)
		{
			return _client.GetAsync(requestUri);
		}
		
		public virtual Task<HttpResponseMessage> GetAsync(string requestUri, HttpCompletionOption completionOption)
		{
			return _client.GetAsync(requestUri, completionOption);
		}
		
		public virtual Task<HttpResponseMessage> GetAsync(Uri requestUri, HttpCompletionOption completionOption)
		{
			return _client.GetAsync(requestUri, completionOption);
		}
		
		public virtual Task<HttpResponseMessage> GetAsync(string requestUri, CancellationToken cancellationToken)
		{
			return _client.GetAsync(requestUri, cancellationToken);
		}
		
		public virtual Task<HttpResponseMessage> GetAsync(Uri requestUri, CancellationToken cancellationToken)
		{
			return _client.GetAsync(requestUri, cancellationToken);
		}
		
		public virtual Task<HttpResponseMessage> GetAsync(string requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken)
		{
			return _client.GetAsync(requestUri, completionOption, cancellationToken);
		}
		
		public virtual Task<HttpResponseMessage> GetAsync(Uri requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken)
		{
			return _client.GetAsync(requestUri, completionOption, cancellationToken);
		}

		public virtual Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)
		{
			return _client.PostAsync(requestUri, content);
		}
		
		public virtual Task<HttpResponseMessage> PostAsync(Uri requestUri, HttpContent content)
		{
			return _client.PostAsync(requestUri, content);
		}
		
		public virtual Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content, CancellationToken cancellationToken)
		{
			return _client.PostAsync(requestUri, content, cancellationToken);
		}
		
		public virtual Task<HttpResponseMessage> PostAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken)
		{
			return _client.PostAsync(requestUri, content, cancellationToken);
		}

		public virtual Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content)
		{
			return _client.PutAsync(requestUri, content);
		}
		
		public virtual Task<HttpResponseMessage> PutAsync(Uri requestUri, HttpContent content)
		{
			return _client.PutAsync(requestUri, content);
		}
		
		public virtual Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content, CancellationToken cancellationToken)
		{
			return _client.PutAsync(requestUri, content, cancellationToken);
		}
		
		public virtual Task<HttpResponseMessage> PutAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken)
		{
			return _client.PutAsync(requestUri, content, cancellationToken);
		}

		public virtual Task<HttpResponseMessage> DeleteAsync(string requestUri)
		{
			return _client.DeleteAsync(requestUri);
		}
		
		public virtual Task<HttpResponseMessage> DeleteAsync(Uri requestUri)
		{
			return _client.DeleteAsync(requestUri);
		}
		
		public virtual Task<HttpResponseMessage> DeleteAsync(string requestUri, CancellationToken cancellationToken)
		{
			return _client.DeleteAsync(requestUri, cancellationToken);
		}
		
		public virtual Task<HttpResponseMessage> DeleteAsync(Uri requestUri, CancellationToken cancellationToken)
		{
			return _client.DeleteAsync(requestUri, cancellationToken);
		}

		public virtual Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
		{
			return _client.SendAsync(request);
		}
		
		public virtual Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
		{
			return _client.SendAsync(request, cancellationToken);
		}
		
		public virtual Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption)
		{
			return _client.SendAsync(request, completionOption);
		}
		
		public virtual Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
		{
			return _client.SendAsync(request, completionOption, cancellationToken);
		}
		
		public virtual void CancelPendingRequests()
		{
			_client.CancelPendingRequests();
		}
		
		public void Dispose()
		{
			_client.Dispose();
		}
	}
}