Spotify.NET/SpotifyAPI.Web/Http/Interfaces/IAPIConnector.cs

52 lines
2.1 KiB
C#
Raw Permalink Normal View History

2020-05-03 07:10:41 +01:00
using System.Net;
2020-05-01 19:05:28 +01:00
using System;
using System.Collections.Generic;
using System.Net.Http;
2020-05-01 19:05:28 +01:00
using System.Threading.Tasks;
namespace SpotifyAPI.Web.Http
{
public interface IAPIConnector
{
// IAuthenticator Authenticator { get; }
// IJSONSerializer JSONSerializer { get; }
// IHTTPClient HTTPClient { get; }
event EventHandler<IResponse>? ResponseReceived;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716")]
2020-05-01 19:05:28 +01:00
Task<T> Get<T>(Uri uri);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716")]
2020-05-25 17:00:38 +01:00
Task<T> Get<T>(Uri uri, IDictionary<string, string>? parameters);
2020-05-07 17:03:20 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716")]
2020-05-25 17:00:38 +01:00
Task<HttpStatusCode> Get(Uri uri, IDictionary<string, string>? parameters, object? body);
2020-05-01 19:05:28 +01:00
Task<T> Post<T>(Uri uri);
2020-05-25 17:00:38 +01:00
Task<T> Post<T>(Uri uri, IDictionary<string, string>? parameters);
Task<T> Post<T>(Uri uri, IDictionary<string, string>? parameters, object? body);
Task<T> Post<T>(Uri uri, IDictionary<string, string>? parameters, object? body, Dictionary<string, string>? headers);
Task<HttpStatusCode> Post(Uri uri, IDictionary<string, string>? parameters, object? body);
2020-05-01 19:05:28 +01:00
Task<T> Put<T>(Uri uri);
2020-05-25 17:00:38 +01:00
Task<T> Put<T>(Uri uri, IDictionary<string, string>? parameters);
Task<T> Put<T>(Uri uri, IDictionary<string, string>? parameters, object? body);
Task<HttpStatusCode> Put(Uri uri, IDictionary<string, string>? parameters, object? body);
Task<HttpStatusCode> PutRaw(Uri uri, IDictionary<string, string>? parameters, object? body);
2020-05-01 19:05:28 +01:00
Task<T> Delete<T>(Uri uri);
2020-05-25 17:00:38 +01:00
Task<T> Delete<T>(Uri uri, IDictionary<string, string>? parameters);
Task<T> Delete<T>(Uri uri, IDictionary<string, string>? parameters, object? body);
Task<HttpStatusCode> Delete(Uri uri, IDictionary<string, string>? parameters, object? body);
2020-05-01 19:05:28 +01:00
Task<T> SendAPIRequest<T>(
Uri uri, HttpMethod method,
2020-05-25 17:00:38 +01:00
IDictionary<string, string>? parameters = null,
object? body = null,
IDictionary<string, string>? headers = null);
2020-05-01 19:05:28 +01:00
void SetRequestTimeout(TimeSpan timeout);
}
}